From 873af498d81905207a8a305ad68a9029fca8ac43 Mon Sep 17 00:00:00 2001 From: DCL Team Date: Tue, 17 Jan 2023 15:02:59 -0800 Subject: [PATCH] Automated DCL import. - b4ff0f731422d115408a59c575c2adb74d38c061 Automatic import from cloud_mmv2_dcl_20230117_1446_RC00 by DCL Team GitOrigin-RevId: b4ff0f731422d115408a59c575c2adb74d38c061 --- python/proto/vmware/alpha/cluster.proto | 12 +- python/proto/vmware/alpha/private_cloud.proto | 6 - python/services/vmware/alpha/cluster.py | 55 - .../services/vmware/alpha/cluster_server.go | 28 - python/services/vmware/alpha/private_cloud.py | 53 +- .../vmware/alpha/private_cloud_server.go | 28 - .../apigee/alpha/organization_internal.go | 63 +- .../apigee/beta/organization_internal.go | 63 +- .../google/apigee/organization_internal.go | 63 +- services/google/apikeys/alpha/key_internal.go | 147 +- services/google/apikeys/beta/key_internal.go | 147 +- services/google/apikeys/key_internal.go | 147 +- .../alpha/workload_internal.go | 63 +- .../beta/workload_internal.go | 63 +- .../assuredworkloads/workload_internal.go | 63 +- .../google/bigquery/alpha/dataset_internal.go | 84 +- .../google/bigquery/beta/dataset_internal.go | 84 +- services/google/bigquery/dataset_internal.go | 84 +- .../billingbudgets/alpha/budget_internal.go | 210 +- .../billingbudgets/beta/budget_internal.go | 210 +- .../google/billingbudgets/budget_internal.go | 210 +- .../alpha/attestor_internal.go | 63 +- .../alpha/policy_internal.go | 126 +- .../binaryauthorization/attestor_internal.go | 63 +- .../beta/attestor_internal.go | 63 +- .../beta/policy_internal.go | 126 +- .../binaryauthorization/policy_internal.go | 126 +- .../cloudbuild/alpha/worker_pool_internal.go | 105 +- .../cloudbuild/beta/worker_pool_internal.go | 105 +- .../google/cloudbuild/worker_pool_internal.go | 105 +- .../cloudbuildv2/alpha/connection_internal.go | 105 +- .../cloudbuildv2/beta/connection_internal.go | 105 +- .../alpha/delivery_pipeline_internal.go | 147 +- .../clouddeploy/alpha/target_internal.go | 84 +- .../beta/delivery_pipeline_internal.go | 147 +- .../clouddeploy/beta/target_internal.go | 84 +- .../clouddeploy/delivery_pipeline_internal.go | 105 +- .../google/clouddeploy/target_internal.go | 63 +- .../cloudfunctions/alpha/function_internal.go | 63 +- .../cloudfunctions/beta/function_internal.go | 63 +- .../cloudfunctions/function_internal.go | 63 +- .../cloudidentity/alpha/group_internal.go | 168 +- .../alpha/membership_internal.go | 147 +- .../cloudidentity/beta/group_internal.go | 168 +- .../cloudidentity/beta/membership_internal.go | 147 +- .../google/cloudidentity/group_internal.go | 147 +- .../cloudidentity/membership_internal.go | 126 +- .../cloudkms/alpha/crypto_key_internal.go | 105 +- .../cloudkms/alpha/ekm_connection_internal.go | 42 +- .../cloudkms/beta/crypto_key_internal.go | 105 +- .../cloudkms/beta/ekm_connection_internal.go | 42 +- .../google/cloudkms/crypto_key_internal.go | 105 +- .../cloudkms/ekm_connection_internal.go | 42 +- .../cloudscheduler/alpha/job_internal.go | 189 +- .../cloudscheduler/beta/job_internal.go | 189 +- .../google/cloudscheduler/job_internal.go | 189 +- .../alpha/firewall_policy_rule_internal.go | 42 +- .../compute/alpha/forwarding_rule_internal.go | 63 +- .../alpha/instance_group_manager_internal.go | 399 +- .../google/compute/alpha/instance_internal.go | 252 +- .../alpha/interconnect_attachment_internal.go | 42 +- .../network_firewall_policy_rule_internal.go | 84 +- .../google/compute/alpha/network_internal.go | 21 +- .../alpha/packet_mirroring_internal.go | 126 +- .../google/compute/alpha/route_internal.go | 21 +- .../alpha/service_attachment_internal.go | 63 +- .../compute/alpha/subnetwork_internal.go | 42 +- .../beta/firewall_policy_rule_internal.go | 42 +- .../compute/beta/forwarding_rule_internal.go | 63 +- .../beta/instance_group_manager_internal.go | 399 +- .../google/compute/beta/instance_internal.go | 252 +- .../beta/interconnect_attachment_internal.go | 42 +- .../network_firewall_policy_rule_internal.go | 84 +- .../google/compute/beta/network_internal.go | 21 +- .../compute/beta/packet_mirroring_internal.go | 126 +- .../google/compute/beta/route_internal.go | 21 +- .../beta/service_attachment_internal.go | 63 +- .../compute/beta/subnetwork_internal.go | 42 +- .../compute/firewall_policy_rule_internal.go | 42 +- .../compute/forwarding_rule_internal.go | 63 +- .../instance_group_manager_internal.go | 357 +- services/google/compute/instance_internal.go | 252 +- .../interconnect_attachment_internal.go | 42 +- .../network_firewall_policy_rule_internal.go | 84 +- services/google/compute/network_internal.go | 21 +- .../compute/packet_mirroring_internal.go | 126 +- services/google/compute/route_internal.go | 21 +- .../compute/service_attachment_internal.go | 63 +- .../google/compute/subnetwork_internal.go | 42 +- .../alpha/instance_internal.go | 105 +- .../containeranalysis/alpha/note_internal.go | 420 +- .../containeranalysis/beta/note_internal.go | 420 +- .../google/containeranalysis/note_internal.go | 399 +- .../containeraws/alpha/cluster_internal.go | 378 +- .../containeraws/alpha/node_pool_internal.go | 210 +- .../containeraws/beta/cluster_internal.go | 378 +- .../containeraws/beta/node_pool_internal.go | 210 +- .../google/containeraws/cluster_internal.go | 273 +- .../google/containeraws/node_pool_internal.go | 189 +- .../containerazure/alpha/cluster_internal.go | 336 +- .../alpha/node_pool_internal.go | 126 +- .../containerazure/beta/cluster_internal.go | 336 +- .../containerazure/beta/node_pool_internal.go | 126 +- .../google/containerazure/cluster_internal.go | 252 +- .../containerazure/node_pool_internal.go | 126 +- .../datafusion/alpha/instance_internal.go | 42 +- .../datafusion/beta/instance_internal.go | 42 +- .../google/dataplex/alpha/asset_internal.go | 168 +- .../google/dataplex/alpha/lake_internal.go | 63 +- .../google/dataplex/alpha/zone_internal.go | 105 +- services/google/dataplex/asset_internal.go | 168 +- .../google/dataplex/beta/asset_internal.go | 168 +- .../google/dataplex/beta/lake_internal.go | 63 +- .../google/dataplex/beta/zone_internal.go | 105 +- services/google/dataplex/lake_internal.go | 63 +- services/google/dataplex/zone_internal.go | 105 +- .../alpha/autoscaling_policy_internal.go | 84 +- .../google/dataproc/alpha/cluster_internal.go | 1071 +++-- .../alpha/workflow_template_internal.go | 1176 ++--- .../dataproc/autoscaling_policy_internal.go | 84 +- .../beta/autoscaling_policy_internal.go | 84 +- .../google/dataproc/beta/cluster_internal.go | 1071 +++-- .../beta/workflow_template_internal.go | 1176 ++--- services/google/dataproc/cluster_internal.go | 1029 +++-- .../dataproc/workflow_template_internal.go | 1113 +++-- .../dlp/alpha/deidentify_template_internal.go | 3971 ++++++++++------- .../dlp/alpha/inspect_template_internal.go | 567 ++- .../google/dlp/alpha/job_trigger_internal.go | 1386 +++--- .../dlp/alpha/stored_info_type_internal.go | 210 +- .../dlp/beta/deidentify_template_internal.go | 3971 ++++++++++------- .../dlp/beta/inspect_template_internal.go | 567 ++- .../google/dlp/beta/job_trigger_internal.go | 1386 +++--- .../dlp/beta/stored_info_type_internal.go | 210 +- .../dlp/deidentify_template_internal.go | 3971 ++++++++++------- .../google/dlp/inspect_template_internal.go | 567 ++- services/google/dlp/job_trigger_internal.go | 1386 +++--- .../google/dlp/stored_info_type_internal.go | 210 +- .../google/eventarc/alpha/trigger_internal.go | 126 +- .../google/eventarc/beta/trigger_internal.go | 126 +- services/google/eventarc/trigger_internal.go | 126 +- .../filestore/alpha/instance_internal.go | 63 +- .../filestore/beta/instance_internal.go | 63 +- .../google/filestore/instance_internal.go | 63 +- .../alpha/firebase_project_internal.go | 21 +- .../beta/firebase_project_internal.go | 21 +- .../firebaserules/alpha/ruleset_internal.go | 63 +- .../firebaserules/beta/ruleset_internal.go | 63 +- .../google/firebaserules/ruleset_internal.go | 63 +- .../google/gkehub/alpha/feature_internal.go | 210 +- .../gkehub/alpha/feature_membership.yaml | 6 +- .../feature_membership_alpha_yaml_embed.go | 6 +- .../alpha/feature_membership_internal.go | 189 +- .../gkehub/alpha/feature_membership_schema.go | 2 +- .../gkehub/alpha/membership_internal.go | 189 +- .../google/gkehub/beta/feature_internal.go | 105 +- .../gkehub/beta/feature_membership.yaml | 6 +- .../feature_membership_beta_yaml_embed.go | 6 +- .../beta/feature_membership_internal.go | 189 +- .../gkehub/beta/feature_membership_schema.go | 2 +- .../google/gkehub/beta/membership_internal.go | 189 +- services/google/iam/alpha/role_internal.go | 21 +- .../iam/alpha/service_account_internal.go | 42 +- .../alpha/workforce_pool_provider_internal.go | 42 +- ...orkload_identity_pool_provider_internal.go | 42 +- services/google/iam/beta/role_internal.go | 21 +- .../iam/beta/service_account_internal.go | 42 +- .../beta/workforce_pool_provider_internal.go | 42 +- ...orkload_identity_pool_provider_internal.go | 42 +- services/google/iam/role_internal.go | 21 +- .../google/iam/service_account_internal.go | 42 +- .../iam/workforce_pool_provider_internal.go | 42 +- ...orkload_identity_pool_provider_internal.go | 42 +- .../identitytoolkit/alpha/config_internal.go | 546 ++- .../alpha/oauth_idp_config_internal.go | 21 +- .../identitytoolkit/alpha/tenant_internal.go | 21 +- .../alpha/tenant_oauth_idp_config_internal.go | 21 +- .../identitytoolkit/beta/config_internal.go | 546 ++- .../beta/oauth_idp_config_internal.go | 21 +- .../identitytoolkit/beta/tenant_internal.go | 21 +- .../beta/tenant_oauth_idp_config_internal.go | 21 +- .../google/identitytoolkit/config_internal.go | 546 ++- .../oauth_idp_config_internal.go | 21 +- .../google/identitytoolkit/tenant_internal.go | 21 +- .../tenant_oauth_idp_config_internal.go | 21 +- .../logging/alpha/log_metric_internal.go | 147 +- .../logging/beta/log_metric_internal.go | 147 +- .../google/logging/log_metric_internal.go | 147 +- .../monitoring/alpha/dashboard_internal.go | 3339 ++++++++------ .../alpha/metric_descriptor_internal.go | 42 +- .../alpha/metrics_scope_internal.go | 21 +- .../monitoring/alpha/service_internal.go | 42 +- .../alpha/service_level_objective_internal.go | 525 ++- .../alpha/uptime_check_config_internal.go | 126 +- .../monitoring/beta/dashboard_internal.go | 3339 ++++++++------ .../beta/metric_descriptor_internal.go | 42 +- .../monitoring/beta/metrics_scope_internal.go | 21 +- .../monitoring/beta/service_internal.go | 42 +- .../beta/service_level_objective_internal.go | 525 ++- .../beta/uptime_check_config_internal.go | 126 +- .../google/monitoring/dashboard_internal.go | 3339 ++++++++------ .../monitoring/metric_descriptor_internal.go | 42 +- .../monitoring/metrics_scope_internal.go | 21 +- .../google/monitoring/service_internal.go | 42 +- .../service_level_objective_internal.go | 525 ++- .../uptime_check_config_internal.go | 126 +- .../networkconnectivity/alpha/hub_internal.go | 21 +- .../alpha/spoke_internal.go | 84 +- .../networkconnectivity/beta/hub_internal.go | 21 +- .../beta/spoke_internal.go | 84 +- .../networkconnectivity/hub_internal.go | 21 +- .../networkconnectivity/spoke_internal.go | 84 +- .../alpha/authorization_policy_internal.go | 84 +- .../alpha/client_tls_policy_internal.go | 147 +- .../alpha/server_tls_policy_internal.go | 168 +- .../beta/authorization_policy_internal.go | 84 +- .../beta/client_tls_policy_internal.go | 126 +- .../beta/server_tls_policy_internal.go | 147 +- .../alpha/endpoint_policy_internal.go | 84 +- .../alpha/grpc_route_internal.go | 210 +- .../alpha/http_route_internal.go | 378 +- .../alpha/tcp_route_internal.go | 84 +- .../alpha/tls_route_internal.go | 84 +- .../beta/endpoint_policy_internal.go | 84 +- .../beta/grpc_route_internal.go | 210 +- .../beta/http_route_internal.go | 378 +- .../beta/tcp_route_internal.go | 84 +- .../beta/tls_route_internal.go | 84 +- .../networkservices/grpc_route_internal.go | 210 +- .../networkservices/http_route_internal.go | 378 +- .../networkservices/tcp_route_internal.go | 84 +- .../networkservices/tls_route_internal.go | 84 +- .../google/orgpolicy/alpha/policy_internal.go | 88 +- .../google/orgpolicy/beta/policy_internal.go | 88 +- services/google/orgpolicy/policy_internal.go | 88 +- .../orgpolicy/samples/folder.policy.json | 7 + .../osconfig/alpha/guest_policy_internal.go | 609 +-- .../alpha/os_policy_assignment_internal.go | 945 ++-- .../osconfig/beta/guest_policy_internal.go | 609 +-- .../beta/os_policy_assignment_internal.go | 945 ++-- .../osconfig/os_policy_assignment_internal.go | 945 ++-- .../privateca/alpha/ca_pool_internal.go | 399 +- .../alpha/certificate_authority_internal.go | 819 ++-- .../privateca/alpha/certificate_internal.go | 714 +-- .../alpha/certificate_template_internal.go | 273 +- .../google/privateca/beta/ca_pool_internal.go | 399 +- .../beta/certificate_authority_internal.go | 819 ++-- .../privateca/beta/certificate_internal.go | 714 +-- .../beta/certificate_template_internal.go | 273 +- services/google/privateca/ca_pool_internal.go | 399 +- .../certificate_authority_internal.go | 819 ++-- .../google/privateca/certificate_internal.go | 714 +-- .../certificate_template_internal.go | 273 +- .../google/pubsub/alpha/topic_internal.go | 21 +- services/google/pubsub/beta/topic_internal.go | 21 +- services/google/pubsub/topic_internal.go | 21 +- .../recaptchaenterprise/alpha/key_internal.go | 84 +- .../recaptchaenterprise/beta/key_internal.go | 84 +- .../recaptchaenterprise/key_internal.go | 84 +- services/google/run/alpha/job_internal.go | 399 +- services/google/run/alpha/service_internal.go | 378 +- .../google/storage/alpha/bucket_internal.go | 168 +- .../google/storage/beta/bucket_internal.go | 168 +- services/google/storage/bucket_internal.go | 168 +- services/google/vmware/alpha/cluster.go | 89 +- services/google/vmware/alpha/cluster.yaml | 25 - .../vmware/alpha/cluster_alpha_yaml_embed.go | 6 +- .../google/vmware/alpha/cluster_internal.go | 315 -- .../google/vmware/alpha/cluster_schema.go | 27 - services/google/vmware/alpha/private_cloud.go | 56 +- .../google/vmware/alpha/private_cloud.yaml | 27 - .../alpha/private_cloud_alpha_yaml_embed.go | 6 +- .../vmware/alpha/private_cloud_internal.go | 411 +- .../vmware/alpha/private_cloud_schema.go | 27 - .../alpha/vmware_engine_network_internal.go | 21 +- .../vpcaccess/alpha/connector_internal.go | 21 +- .../vpcaccess/beta/connector_internal.go | 21 +- .../google/vpcaccess/connector_internal.go | 21 +- unstructured/google/vmware/alpha/cluster.go | 44 - .../google/vmware/alpha/private_cloud.go | 44 - 279 files changed, 41592 insertions(+), 32296 deletions(-) diff --git a/python/proto/vmware/alpha/cluster.proto b/python/proto/vmware/alpha/cluster.proto index 9bd8f75daf..56ccc7900a 100755 --- a/python/proto/vmware/alpha/cluster.proto +++ b/python/proto/vmware/alpha/cluster.proto @@ -38,15 +38,9 @@ message VmwareAlphaCluster { VmwareAlphaClusterStateEnum state = 4; bool management = 5; string uid = 6; - map node_type_configs = 7; - string project = 8; - string location = 9; - string private_cloud = 10; -} - -message VmwareAlphaClusterNodeTypeConfigs { - int64 node_count = 1; - int64 custom_core_count = 2; + string project = 7; + string location = 8; + string private_cloud = 9; } message ApplyVmwareAlphaClusterRequest { diff --git a/python/proto/vmware/alpha/private_cloud.proto b/python/proto/vmware/alpha/private_cloud.proto index d4f07c038d..a12d156c75 100755 --- a/python/proto/vmware/alpha/private_cloud.proto +++ b/python/proto/vmware/alpha/private_cloud.proto @@ -80,12 +80,6 @@ message VmwareAlphaPrivateCloudNetworkConfig { message VmwareAlphaPrivateCloudManagementCluster { string cluster_id = 1; - map node_type_configs = 2; -} - -message VmwareAlphaPrivateCloudManagementClusterNodeTypeConfigs { - int64 node_count = 1; - int64 custom_core_count = 2; } message VmwareAlphaPrivateCloudHcx { diff --git a/python/services/vmware/alpha/cluster.py b/python/services/vmware/alpha/cluster.py index 2b5a10d6dd..b1c8489bbf 100755 --- a/python/services/vmware/alpha/cluster.py +++ b/python/services/vmware/alpha/cluster.py @@ -27,7 +27,6 @@ def __init__( state: str = None, management: bool = None, uid: str = None, - node_type_configs: dict = None, project: str = None, location: str = None, private_cloud: str = None, @@ -36,7 +35,6 @@ def __init__( channel.initialize() self.name = name - self.node_type_configs = node_type_configs self.project = project self.location = location self.private_cloud = private_cloud @@ -48,11 +46,6 @@ def apply(self): if Primitive.to_proto(self.name): request.resource.name = Primitive.to_proto(self.name) - if Primitive.to_proto(self.node_type_configs): - request.resource.node_type_configs = Primitive.to_proto( - self.node_type_configs - ) - if Primitive.to_proto(self.project): request.resource.project = Primitive.to_proto(self.project) @@ -71,7 +64,6 @@ def apply(self): self.state = ClusterStateEnum.from_proto(response.state) self.management = Primitive.from_proto(response.management) self.uid = Primitive.from_proto(response.uid) - self.node_type_configs = Primitive.from_proto(response.node_type_configs) self.project = Primitive.from_proto(response.project) self.location = Primitive.from_proto(response.location) self.private_cloud = Primitive.from_proto(response.private_cloud) @@ -83,11 +75,6 @@ def delete(self): if Primitive.to_proto(self.name): request.resource.name = Primitive.to_proto(self.name) - if Primitive.to_proto(self.node_type_configs): - request.resource.node_type_configs = Primitive.to_proto( - self.node_type_configs - ) - if Primitive.to_proto(self.project): request.resource.project = Primitive.to_proto(self.project) @@ -116,8 +103,6 @@ def to_proto(self): resource = cluster_pb2.VmwareAlphaCluster() if Primitive.to_proto(self.name): resource.name = Primitive.to_proto(self.name) - if Primitive.to_proto(self.node_type_configs): - resource.node_type_configs = Primitive.to_proto(self.node_type_configs) if Primitive.to_proto(self.project): resource.project = Primitive.to_proto(self.project) if Primitive.to_proto(self.location): @@ -127,46 +112,6 @@ def to_proto(self): return resource -class ClusterNodeTypeConfigs(object): - def __init__(self, node_count: int = None, custom_core_count: int = None): - self.node_count = node_count - self.custom_core_count = custom_core_count - - @classmethod - def to_proto(self, resource): - if not resource: - return None - - res = cluster_pb2.VmwareAlphaClusterNodeTypeConfigs() - if Primitive.to_proto(resource.node_count): - res.node_count = Primitive.to_proto(resource.node_count) - if Primitive.to_proto(resource.custom_core_count): - res.custom_core_count = Primitive.to_proto(resource.custom_core_count) - return res - - @classmethod - def from_proto(self, resource): - if not resource: - return None - - return ClusterNodeTypeConfigs( - node_count=Primitive.from_proto(resource.node_count), - custom_core_count=Primitive.from_proto(resource.custom_core_count), - ) - - -class ClusterNodeTypeConfigsArray(object): - @classmethod - def to_proto(self, resources): - if not resources: - return resources - return [ClusterNodeTypeConfigs.to_proto(i) for i in resources] - - @classmethod - def from_proto(self, resources): - return [ClusterNodeTypeConfigs.from_proto(i) for i in resources] - - class ClusterStateEnum(object): @classmethod def to_proto(self, resource): diff --git a/python/services/vmware/alpha/cluster_server.go b/python/services/vmware/alpha/cluster_server.go index 9f09ef8616..a83dbefcde 100755 --- a/python/services/vmware/alpha/cluster_server.go +++ b/python/services/vmware/alpha/cluster_server.go @@ -36,18 +36,6 @@ func ProtoToVmwareAlphaClusterStateEnum(e alphapb.VmwareAlphaClusterStateEnum) * return nil } -// ProtoToClusterNodeTypeConfigs converts a ClusterNodeTypeConfigs object from its proto representation. -func ProtoToVmwareAlphaClusterNodeTypeConfigs(p *alphapb.VmwareAlphaClusterNodeTypeConfigs) *alpha.ClusterNodeTypeConfigs { - if p == nil { - return nil - } - obj := &alpha.ClusterNodeTypeConfigs{ - NodeCount: dcl.Int64OrNil(p.GetNodeCount()), - CustomCoreCount: dcl.Int64OrNil(p.GetCustomCoreCount()), - } - return obj -} - // ProtoToCluster converts a Cluster resource from its proto representation. func ProtoToCluster(p *alphapb.VmwareAlphaCluster) *alpha.Cluster { obj := &alpha.Cluster{ @@ -75,17 +63,6 @@ func VmwareAlphaClusterStateEnumToProto(e *alpha.ClusterStateEnum) alphapb.Vmwar return alphapb.VmwareAlphaClusterStateEnum(0) } -// ClusterNodeTypeConfigsToProto converts a ClusterNodeTypeConfigs object to its proto representation. -func VmwareAlphaClusterNodeTypeConfigsToProto(o *alpha.ClusterNodeTypeConfigs) *alphapb.VmwareAlphaClusterNodeTypeConfigs { - if o == nil { - return nil - } - p := &alphapb.VmwareAlphaClusterNodeTypeConfigs{} - p.SetNodeCount(dcl.ValueOrEmptyInt64(o.NodeCount)) - p.SetCustomCoreCount(dcl.ValueOrEmptyInt64(o.CustomCoreCount)) - return p -} - // ClusterToProto converts a Cluster resource to its proto representation. func ClusterToProto(resource *alpha.Cluster) *alphapb.VmwareAlphaCluster { p := &alphapb.VmwareAlphaCluster{} @@ -98,11 +75,6 @@ func ClusterToProto(resource *alpha.Cluster) *alphapb.VmwareAlphaCluster { p.SetProject(dcl.ValueOrEmptyString(resource.Project)) p.SetLocation(dcl.ValueOrEmptyString(resource.Location)) p.SetPrivateCloud(dcl.ValueOrEmptyString(resource.PrivateCloud)) - mNodeTypeConfigs := make(map[string]*alphapb.VmwareAlphaClusterNodeTypeConfigs, len(resource.NodeTypeConfigs)) - for k, r := range resource.NodeTypeConfigs { - mNodeTypeConfigs[k] = VmwareAlphaClusterNodeTypeConfigsToProto(&r) - } - p.SetNodeTypeConfigs(mNodeTypeConfigs) return p } diff --git a/python/services/vmware/alpha/private_cloud.py b/python/services/vmware/alpha/private_cloud.py index 6151272a20..661c469b2a 100755 --- a/python/services/vmware/alpha/private_cloud.py +++ b/python/services/vmware/alpha/private_cloud.py @@ -235,9 +235,8 @@ def from_proto(self, resources): class PrivateCloudManagementCluster(object): - def __init__(self, cluster_id: str = None, node_type_configs: dict = None): + def __init__(self, cluster_id: str = None): self.cluster_id = cluster_id - self.node_type_configs = node_type_configs @classmethod def to_proto(self, resource): @@ -247,8 +246,6 @@ def to_proto(self, resource): res = private_cloud_pb2.VmwareAlphaPrivateCloudManagementCluster() if Primitive.to_proto(resource.cluster_id): res.cluster_id = Primitive.to_proto(resource.cluster_id) - if Primitive.to_proto(resource.node_type_configs): - res.node_type_configs = Primitive.to_proto(resource.node_type_configs) return res @classmethod @@ -258,7 +255,6 @@ def from_proto(self, resource): return PrivateCloudManagementCluster( cluster_id=Primitive.from_proto(resource.cluster_id), - node_type_configs=Primitive.from_proto(resource.node_type_configs), ) @@ -274,53 +270,6 @@ def from_proto(self, resources): return [PrivateCloudManagementCluster.from_proto(i) for i in resources] -class PrivateCloudManagementClusterNodeTypeConfigs(object): - def __init__(self, node_count: int = None, custom_core_count: int = None): - self.node_count = node_count - self.custom_core_count = custom_core_count - - @classmethod - def to_proto(self, resource): - if not resource: - return None - - res = ( - private_cloud_pb2.VmwareAlphaPrivateCloudManagementClusterNodeTypeConfigs() - ) - if Primitive.to_proto(resource.node_count): - res.node_count = Primitive.to_proto(resource.node_count) - if Primitive.to_proto(resource.custom_core_count): - res.custom_core_count = Primitive.to_proto(resource.custom_core_count) - return res - - @classmethod - def from_proto(self, resource): - if not resource: - return None - - return PrivateCloudManagementClusterNodeTypeConfigs( - node_count=Primitive.from_proto(resource.node_count), - custom_core_count=Primitive.from_proto(resource.custom_core_count), - ) - - -class PrivateCloudManagementClusterNodeTypeConfigsArray(object): - @classmethod - def to_proto(self, resources): - if not resources: - return resources - return [ - PrivateCloudManagementClusterNodeTypeConfigs.to_proto(i) for i in resources - ] - - @classmethod - def from_proto(self, resources): - return [ - PrivateCloudManagementClusterNodeTypeConfigs.from_proto(i) - for i in resources - ] - - class PrivateCloudHcx(object): def __init__( self, diff --git a/python/services/vmware/alpha/private_cloud_server.go b/python/services/vmware/alpha/private_cloud_server.go index 9cc5651bfd..2bbfdc0997 100755 --- a/python/services/vmware/alpha/private_cloud_server.go +++ b/python/services/vmware/alpha/private_cloud_server.go @@ -97,18 +97,6 @@ func ProtoToVmwareAlphaPrivateCloudManagementCluster(p *alphapb.VmwareAlphaPriva return obj } -// ProtoToPrivateCloudManagementClusterNodeTypeConfigs converts a PrivateCloudManagementClusterNodeTypeConfigs object from its proto representation. -func ProtoToVmwareAlphaPrivateCloudManagementClusterNodeTypeConfigs(p *alphapb.VmwareAlphaPrivateCloudManagementClusterNodeTypeConfigs) *alpha.PrivateCloudManagementClusterNodeTypeConfigs { - if p == nil { - return nil - } - obj := &alpha.PrivateCloudManagementClusterNodeTypeConfigs{ - NodeCount: dcl.Int64OrNil(p.GetNodeCount()), - CustomCoreCount: dcl.Int64OrNil(p.GetCustomCoreCount()), - } - return obj -} - // ProtoToPrivateCloudHcx converts a PrivateCloudHcx object from its proto representation. func ProtoToVmwareAlphaPrivateCloudHcx(p *alphapb.VmwareAlphaPrivateCloudHcx) *alpha.PrivateCloudHcx { if p == nil { @@ -237,22 +225,6 @@ func VmwareAlphaPrivateCloudManagementClusterToProto(o *alpha.PrivateCloudManage } p := &alphapb.VmwareAlphaPrivateCloudManagementCluster{} p.SetClusterId(dcl.ValueOrEmptyString(o.ClusterId)) - mNodeTypeConfigs := make(map[string]*alphapb.VmwareAlphaPrivateCloudManagementClusterNodeTypeConfigs, len(o.NodeTypeConfigs)) - for k, r := range o.NodeTypeConfigs { - mNodeTypeConfigs[k] = VmwareAlphaPrivateCloudManagementClusterNodeTypeConfigsToProto(&r) - } - p.SetNodeTypeConfigs(mNodeTypeConfigs) - return p -} - -// PrivateCloudManagementClusterNodeTypeConfigsToProto converts a PrivateCloudManagementClusterNodeTypeConfigs object to its proto representation. -func VmwareAlphaPrivateCloudManagementClusterNodeTypeConfigsToProto(o *alpha.PrivateCloudManagementClusterNodeTypeConfigs) *alphapb.VmwareAlphaPrivateCloudManagementClusterNodeTypeConfigs { - if o == nil { - return nil - } - p := &alphapb.VmwareAlphaPrivateCloudManagementClusterNodeTypeConfigs{} - p.SetNodeCount(dcl.ValueOrEmptyInt64(o.NodeCount)) - p.SetCustomCoreCount(dcl.ValueOrEmptyInt64(o.CustomCoreCount)) return p } diff --git a/services/google/apigee/alpha/organization_internal.go b/services/google/apigee/alpha/organization_internal.go index e34c26590a..d8dc0fc5d8 100755 --- a/services/google/apigee/alpha/organization_internal.go +++ b/services/google/apigee/alpha/organization_internal.go @@ -690,23 +690,26 @@ func canonicalizeNewOrganizationAddonsConfigSet(c *Client, des, nw []Organizatio if des == nil { return nw } - var reorderedNew []OrganizationAddonsConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OrganizationAddonsConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOrganizationAddonsConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOrganizationAddonsConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOrganizationAddonsConfigSlice(c *Client, des, nw []OrganizationAddonsConfig) []OrganizationAddonsConfig { @@ -805,23 +808,26 @@ func canonicalizeNewOrganizationAddonsConfigAdvancedApiOpsConfigSet(c *Client, d if des == nil { return nw } - var reorderedNew []OrganizationAddonsConfigAdvancedApiOpsConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OrganizationAddonsConfigAdvancedApiOpsConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOrganizationAddonsConfigAdvancedApiOpsConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOrganizationAddonsConfigAdvancedApiOpsConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOrganizationAddonsConfigAdvancedApiOpsConfigSlice(c *Client, des, nw []OrganizationAddonsConfigAdvancedApiOpsConfig) []OrganizationAddonsConfigAdvancedApiOpsConfig { @@ -920,23 +926,26 @@ func canonicalizeNewOrganizationAddonsConfigMonetizationConfigSet(c *Client, des if des == nil { return nw } - var reorderedNew []OrganizationAddonsConfigMonetizationConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OrganizationAddonsConfigMonetizationConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOrganizationAddonsConfigMonetizationConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOrganizationAddonsConfigMonetizationConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOrganizationAddonsConfigMonetizationConfigSlice(c *Client, des, nw []OrganizationAddonsConfigMonetizationConfig) []OrganizationAddonsConfigMonetizationConfig { diff --git a/services/google/apigee/beta/organization_internal.go b/services/google/apigee/beta/organization_internal.go index 263190b4ce..057db5604c 100755 --- a/services/google/apigee/beta/organization_internal.go +++ b/services/google/apigee/beta/organization_internal.go @@ -690,23 +690,26 @@ func canonicalizeNewOrganizationAddonsConfigSet(c *Client, des, nw []Organizatio if des == nil { return nw } - var reorderedNew []OrganizationAddonsConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OrganizationAddonsConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOrganizationAddonsConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOrganizationAddonsConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOrganizationAddonsConfigSlice(c *Client, des, nw []OrganizationAddonsConfig) []OrganizationAddonsConfig { @@ -805,23 +808,26 @@ func canonicalizeNewOrganizationAddonsConfigAdvancedApiOpsConfigSet(c *Client, d if des == nil { return nw } - var reorderedNew []OrganizationAddonsConfigAdvancedApiOpsConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OrganizationAddonsConfigAdvancedApiOpsConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOrganizationAddonsConfigAdvancedApiOpsConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOrganizationAddonsConfigAdvancedApiOpsConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOrganizationAddonsConfigAdvancedApiOpsConfigSlice(c *Client, des, nw []OrganizationAddonsConfigAdvancedApiOpsConfig) []OrganizationAddonsConfigAdvancedApiOpsConfig { @@ -920,23 +926,26 @@ func canonicalizeNewOrganizationAddonsConfigMonetizationConfigSet(c *Client, des if des == nil { return nw } - var reorderedNew []OrganizationAddonsConfigMonetizationConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OrganizationAddonsConfigMonetizationConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOrganizationAddonsConfigMonetizationConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOrganizationAddonsConfigMonetizationConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOrganizationAddonsConfigMonetizationConfigSlice(c *Client, des, nw []OrganizationAddonsConfigMonetizationConfig) []OrganizationAddonsConfigMonetizationConfig { diff --git a/services/google/apigee/organization_internal.go b/services/google/apigee/organization_internal.go index 171adce56b..26f4011bd2 100755 --- a/services/google/apigee/organization_internal.go +++ b/services/google/apigee/organization_internal.go @@ -690,23 +690,26 @@ func canonicalizeNewOrganizationAddonsConfigSet(c *Client, des, nw []Organizatio if des == nil { return nw } - var reorderedNew []OrganizationAddonsConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OrganizationAddonsConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOrganizationAddonsConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOrganizationAddonsConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOrganizationAddonsConfigSlice(c *Client, des, nw []OrganizationAddonsConfig) []OrganizationAddonsConfig { @@ -805,23 +808,26 @@ func canonicalizeNewOrganizationAddonsConfigAdvancedApiOpsConfigSet(c *Client, d if des == nil { return nw } - var reorderedNew []OrganizationAddonsConfigAdvancedApiOpsConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OrganizationAddonsConfigAdvancedApiOpsConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOrganizationAddonsConfigAdvancedApiOpsConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOrganizationAddonsConfigAdvancedApiOpsConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOrganizationAddonsConfigAdvancedApiOpsConfigSlice(c *Client, des, nw []OrganizationAddonsConfigAdvancedApiOpsConfig) []OrganizationAddonsConfigAdvancedApiOpsConfig { @@ -920,23 +926,26 @@ func canonicalizeNewOrganizationAddonsConfigMonetizationConfigSet(c *Client, des if des == nil { return nw } - var reorderedNew []OrganizationAddonsConfigMonetizationConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OrganizationAddonsConfigMonetizationConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOrganizationAddonsConfigMonetizationConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOrganizationAddonsConfigMonetizationConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOrganizationAddonsConfigMonetizationConfigSlice(c *Client, des, nw []OrganizationAddonsConfigMonetizationConfig) []OrganizationAddonsConfigMonetizationConfig { diff --git a/services/google/apikeys/alpha/key_internal.go b/services/google/apikeys/alpha/key_internal.go index 484bb0599e..e26c4d37f9 100755 --- a/services/google/apikeys/alpha/key_internal.go +++ b/services/google/apikeys/alpha/key_internal.go @@ -644,23 +644,26 @@ func canonicalizeNewKeyRestrictionsSet(c *Client, des, nw []KeyRestrictions) []K if des == nil { return nw } - var reorderedNew []KeyRestrictions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []KeyRestrictions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareKeyRestrictionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewKeyRestrictions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewKeyRestrictionsSlice(c *Client, des, nw []KeyRestrictions) []KeyRestrictions { @@ -759,23 +762,26 @@ func canonicalizeNewKeyRestrictionsBrowserKeyRestrictionsSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []KeyRestrictionsBrowserKeyRestrictions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []KeyRestrictionsBrowserKeyRestrictions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareKeyRestrictionsBrowserKeyRestrictionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewKeyRestrictionsBrowserKeyRestrictions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewKeyRestrictionsBrowserKeyRestrictionsSlice(c *Client, des, nw []KeyRestrictionsBrowserKeyRestrictions) []KeyRestrictionsBrowserKeyRestrictions { @@ -874,23 +880,26 @@ func canonicalizeNewKeyRestrictionsServerKeyRestrictionsSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []KeyRestrictionsServerKeyRestrictions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []KeyRestrictionsServerKeyRestrictions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareKeyRestrictionsServerKeyRestrictionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewKeyRestrictionsServerKeyRestrictions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewKeyRestrictionsServerKeyRestrictionsSlice(c *Client, des, nw []KeyRestrictionsServerKeyRestrictions) []KeyRestrictionsServerKeyRestrictions { @@ -983,23 +992,26 @@ func canonicalizeNewKeyRestrictionsAndroidKeyRestrictionsSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []KeyRestrictionsAndroidKeyRestrictions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []KeyRestrictionsAndroidKeyRestrictions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareKeyRestrictionsAndroidKeyRestrictionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewKeyRestrictionsAndroidKeyRestrictions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewKeyRestrictionsAndroidKeyRestrictionsSlice(c *Client, des, nw []KeyRestrictionsAndroidKeyRestrictions) []KeyRestrictionsAndroidKeyRestrictions { @@ -1106,23 +1118,26 @@ func canonicalizeNewKeyRestrictionsAndroidKeyRestrictionsAllowedApplicationsSet( if des == nil { return nw } - var reorderedNew []KeyRestrictionsAndroidKeyRestrictionsAllowedApplications + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []KeyRestrictionsAndroidKeyRestrictionsAllowedApplications for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareKeyRestrictionsAndroidKeyRestrictionsAllowedApplicationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewKeyRestrictionsAndroidKeyRestrictionsAllowedApplications(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewKeyRestrictionsAndroidKeyRestrictionsAllowedApplicationsSlice(c *Client, des, nw []KeyRestrictionsAndroidKeyRestrictionsAllowedApplications) []KeyRestrictionsAndroidKeyRestrictionsAllowedApplications { @@ -1221,23 +1236,26 @@ func canonicalizeNewKeyRestrictionsIosKeyRestrictionsSet(c *Client, des, nw []Ke if des == nil { return nw } - var reorderedNew []KeyRestrictionsIosKeyRestrictions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []KeyRestrictionsIosKeyRestrictions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareKeyRestrictionsIosKeyRestrictionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewKeyRestrictionsIosKeyRestrictions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewKeyRestrictionsIosKeyRestrictionsSlice(c *Client, des, nw []KeyRestrictionsIosKeyRestrictions) []KeyRestrictionsIosKeyRestrictions { @@ -1344,23 +1362,26 @@ func canonicalizeNewKeyRestrictionsApiTargetsSet(c *Client, des, nw []KeyRestric if des == nil { return nw } - var reorderedNew []KeyRestrictionsApiTargets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []KeyRestrictionsApiTargets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareKeyRestrictionsApiTargetsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewKeyRestrictionsApiTargets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewKeyRestrictionsApiTargetsSlice(c *Client, des, nw []KeyRestrictionsApiTargets) []KeyRestrictionsApiTargets { diff --git a/services/google/apikeys/beta/key_internal.go b/services/google/apikeys/beta/key_internal.go index 15c3971702..7bc80eba58 100755 --- a/services/google/apikeys/beta/key_internal.go +++ b/services/google/apikeys/beta/key_internal.go @@ -644,23 +644,26 @@ func canonicalizeNewKeyRestrictionsSet(c *Client, des, nw []KeyRestrictions) []K if des == nil { return nw } - var reorderedNew []KeyRestrictions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []KeyRestrictions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareKeyRestrictionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewKeyRestrictions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewKeyRestrictionsSlice(c *Client, des, nw []KeyRestrictions) []KeyRestrictions { @@ -759,23 +762,26 @@ func canonicalizeNewKeyRestrictionsBrowserKeyRestrictionsSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []KeyRestrictionsBrowserKeyRestrictions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []KeyRestrictionsBrowserKeyRestrictions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareKeyRestrictionsBrowserKeyRestrictionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewKeyRestrictionsBrowserKeyRestrictions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewKeyRestrictionsBrowserKeyRestrictionsSlice(c *Client, des, nw []KeyRestrictionsBrowserKeyRestrictions) []KeyRestrictionsBrowserKeyRestrictions { @@ -874,23 +880,26 @@ func canonicalizeNewKeyRestrictionsServerKeyRestrictionsSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []KeyRestrictionsServerKeyRestrictions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []KeyRestrictionsServerKeyRestrictions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareKeyRestrictionsServerKeyRestrictionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewKeyRestrictionsServerKeyRestrictions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewKeyRestrictionsServerKeyRestrictionsSlice(c *Client, des, nw []KeyRestrictionsServerKeyRestrictions) []KeyRestrictionsServerKeyRestrictions { @@ -983,23 +992,26 @@ func canonicalizeNewKeyRestrictionsAndroidKeyRestrictionsSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []KeyRestrictionsAndroidKeyRestrictions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []KeyRestrictionsAndroidKeyRestrictions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareKeyRestrictionsAndroidKeyRestrictionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewKeyRestrictionsAndroidKeyRestrictions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewKeyRestrictionsAndroidKeyRestrictionsSlice(c *Client, des, nw []KeyRestrictionsAndroidKeyRestrictions) []KeyRestrictionsAndroidKeyRestrictions { @@ -1106,23 +1118,26 @@ func canonicalizeNewKeyRestrictionsAndroidKeyRestrictionsAllowedApplicationsSet( if des == nil { return nw } - var reorderedNew []KeyRestrictionsAndroidKeyRestrictionsAllowedApplications + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []KeyRestrictionsAndroidKeyRestrictionsAllowedApplications for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareKeyRestrictionsAndroidKeyRestrictionsAllowedApplicationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewKeyRestrictionsAndroidKeyRestrictionsAllowedApplications(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewKeyRestrictionsAndroidKeyRestrictionsAllowedApplicationsSlice(c *Client, des, nw []KeyRestrictionsAndroidKeyRestrictionsAllowedApplications) []KeyRestrictionsAndroidKeyRestrictionsAllowedApplications { @@ -1221,23 +1236,26 @@ func canonicalizeNewKeyRestrictionsIosKeyRestrictionsSet(c *Client, des, nw []Ke if des == nil { return nw } - var reorderedNew []KeyRestrictionsIosKeyRestrictions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []KeyRestrictionsIosKeyRestrictions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareKeyRestrictionsIosKeyRestrictionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewKeyRestrictionsIosKeyRestrictions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewKeyRestrictionsIosKeyRestrictionsSlice(c *Client, des, nw []KeyRestrictionsIosKeyRestrictions) []KeyRestrictionsIosKeyRestrictions { @@ -1344,23 +1362,26 @@ func canonicalizeNewKeyRestrictionsApiTargetsSet(c *Client, des, nw []KeyRestric if des == nil { return nw } - var reorderedNew []KeyRestrictionsApiTargets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []KeyRestrictionsApiTargets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareKeyRestrictionsApiTargetsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewKeyRestrictionsApiTargets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewKeyRestrictionsApiTargetsSlice(c *Client, des, nw []KeyRestrictionsApiTargets) []KeyRestrictionsApiTargets { diff --git a/services/google/apikeys/key_internal.go b/services/google/apikeys/key_internal.go index a821513645..e5d6f343d9 100755 --- a/services/google/apikeys/key_internal.go +++ b/services/google/apikeys/key_internal.go @@ -644,23 +644,26 @@ func canonicalizeNewKeyRestrictionsSet(c *Client, des, nw []KeyRestrictions) []K if des == nil { return nw } - var reorderedNew []KeyRestrictions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []KeyRestrictions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareKeyRestrictionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewKeyRestrictions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewKeyRestrictionsSlice(c *Client, des, nw []KeyRestrictions) []KeyRestrictions { @@ -759,23 +762,26 @@ func canonicalizeNewKeyRestrictionsBrowserKeyRestrictionsSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []KeyRestrictionsBrowserKeyRestrictions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []KeyRestrictionsBrowserKeyRestrictions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareKeyRestrictionsBrowserKeyRestrictionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewKeyRestrictionsBrowserKeyRestrictions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewKeyRestrictionsBrowserKeyRestrictionsSlice(c *Client, des, nw []KeyRestrictionsBrowserKeyRestrictions) []KeyRestrictionsBrowserKeyRestrictions { @@ -874,23 +880,26 @@ func canonicalizeNewKeyRestrictionsServerKeyRestrictionsSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []KeyRestrictionsServerKeyRestrictions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []KeyRestrictionsServerKeyRestrictions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareKeyRestrictionsServerKeyRestrictionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewKeyRestrictionsServerKeyRestrictions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewKeyRestrictionsServerKeyRestrictionsSlice(c *Client, des, nw []KeyRestrictionsServerKeyRestrictions) []KeyRestrictionsServerKeyRestrictions { @@ -983,23 +992,26 @@ func canonicalizeNewKeyRestrictionsAndroidKeyRestrictionsSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []KeyRestrictionsAndroidKeyRestrictions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []KeyRestrictionsAndroidKeyRestrictions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareKeyRestrictionsAndroidKeyRestrictionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewKeyRestrictionsAndroidKeyRestrictions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewKeyRestrictionsAndroidKeyRestrictionsSlice(c *Client, des, nw []KeyRestrictionsAndroidKeyRestrictions) []KeyRestrictionsAndroidKeyRestrictions { @@ -1106,23 +1118,26 @@ func canonicalizeNewKeyRestrictionsAndroidKeyRestrictionsAllowedApplicationsSet( if des == nil { return nw } - var reorderedNew []KeyRestrictionsAndroidKeyRestrictionsAllowedApplications + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []KeyRestrictionsAndroidKeyRestrictionsAllowedApplications for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareKeyRestrictionsAndroidKeyRestrictionsAllowedApplicationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewKeyRestrictionsAndroidKeyRestrictionsAllowedApplications(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewKeyRestrictionsAndroidKeyRestrictionsAllowedApplicationsSlice(c *Client, des, nw []KeyRestrictionsAndroidKeyRestrictionsAllowedApplications) []KeyRestrictionsAndroidKeyRestrictionsAllowedApplications { @@ -1221,23 +1236,26 @@ func canonicalizeNewKeyRestrictionsIosKeyRestrictionsSet(c *Client, des, nw []Ke if des == nil { return nw } - var reorderedNew []KeyRestrictionsIosKeyRestrictions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []KeyRestrictionsIosKeyRestrictions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareKeyRestrictionsIosKeyRestrictionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewKeyRestrictionsIosKeyRestrictions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewKeyRestrictionsIosKeyRestrictionsSlice(c *Client, des, nw []KeyRestrictionsIosKeyRestrictions) []KeyRestrictionsIosKeyRestrictions { @@ -1344,23 +1362,26 @@ func canonicalizeNewKeyRestrictionsApiTargetsSet(c *Client, des, nw []KeyRestric if des == nil { return nw } - var reorderedNew []KeyRestrictionsApiTargets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []KeyRestrictionsApiTargets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareKeyRestrictionsApiTargetsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewKeyRestrictionsApiTargets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewKeyRestrictionsApiTargetsSlice(c *Client, des, nw []KeyRestrictionsApiTargets) []KeyRestrictionsApiTargets { diff --git a/services/google/assuredworkloads/alpha/workload_internal.go b/services/google/assuredworkloads/alpha/workload_internal.go index 36c48c957f..1b4f46efda 100755 --- a/services/google/assuredworkloads/alpha/workload_internal.go +++ b/services/google/assuredworkloads/alpha/workload_internal.go @@ -663,23 +663,26 @@ func canonicalizeNewWorkloadResourcesSet(c *Client, des, nw []WorkloadResources) if des == nil { return nw } - var reorderedNew []WorkloadResources + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkloadResources for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkloadResourcesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkloadResources(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkloadResourcesSlice(c *Client, des, nw []WorkloadResources) []WorkloadResources { @@ -784,23 +787,26 @@ func canonicalizeNewWorkloadKmsSettingsSet(c *Client, des, nw []WorkloadKmsSetti if des == nil { return nw } - var reorderedNew []WorkloadKmsSettings + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkloadKmsSettings for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkloadKmsSettingsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkloadKmsSettings(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkloadKmsSettingsSlice(c *Client, des, nw []WorkloadKmsSettings) []WorkloadKmsSettings { @@ -905,23 +911,26 @@ func canonicalizeNewWorkloadResourceSettingsSet(c *Client, des, nw []WorkloadRes if des == nil { return nw } - var reorderedNew []WorkloadResourceSettings + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkloadResourceSettings for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkloadResourceSettingsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkloadResourceSettings(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkloadResourceSettingsSlice(c *Client, des, nw []WorkloadResourceSettings) []WorkloadResourceSettings { diff --git a/services/google/assuredworkloads/beta/workload_internal.go b/services/google/assuredworkloads/beta/workload_internal.go index 5c30c8b017..04a0085771 100755 --- a/services/google/assuredworkloads/beta/workload_internal.go +++ b/services/google/assuredworkloads/beta/workload_internal.go @@ -663,23 +663,26 @@ func canonicalizeNewWorkloadResourcesSet(c *Client, des, nw []WorkloadResources) if des == nil { return nw } - var reorderedNew []WorkloadResources + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkloadResources for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkloadResourcesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkloadResources(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkloadResourcesSlice(c *Client, des, nw []WorkloadResources) []WorkloadResources { @@ -784,23 +787,26 @@ func canonicalizeNewWorkloadKmsSettingsSet(c *Client, des, nw []WorkloadKmsSetti if des == nil { return nw } - var reorderedNew []WorkloadKmsSettings + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkloadKmsSettings for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkloadKmsSettingsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkloadKmsSettings(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkloadKmsSettingsSlice(c *Client, des, nw []WorkloadKmsSettings) []WorkloadKmsSettings { @@ -905,23 +911,26 @@ func canonicalizeNewWorkloadResourceSettingsSet(c *Client, des, nw []WorkloadRes if des == nil { return nw } - var reorderedNew []WorkloadResourceSettings + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkloadResourceSettings for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkloadResourceSettingsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkloadResourceSettings(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkloadResourceSettingsSlice(c *Client, des, nw []WorkloadResourceSettings) []WorkloadResourceSettings { diff --git a/services/google/assuredworkloads/workload_internal.go b/services/google/assuredworkloads/workload_internal.go index 6aacf5bc88..1cae68cc82 100755 --- a/services/google/assuredworkloads/workload_internal.go +++ b/services/google/assuredworkloads/workload_internal.go @@ -663,23 +663,26 @@ func canonicalizeNewWorkloadResourcesSet(c *Client, des, nw []WorkloadResources) if des == nil { return nw } - var reorderedNew []WorkloadResources + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkloadResources for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkloadResourcesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkloadResources(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkloadResourcesSlice(c *Client, des, nw []WorkloadResources) []WorkloadResources { @@ -784,23 +787,26 @@ func canonicalizeNewWorkloadKmsSettingsSet(c *Client, des, nw []WorkloadKmsSetti if des == nil { return nw } - var reorderedNew []WorkloadKmsSettings + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkloadKmsSettings for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkloadKmsSettingsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkloadKmsSettings(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkloadKmsSettingsSlice(c *Client, des, nw []WorkloadKmsSettings) []WorkloadKmsSettings { @@ -905,23 +911,26 @@ func canonicalizeNewWorkloadResourceSettingsSet(c *Client, des, nw []WorkloadRes if des == nil { return nw } - var reorderedNew []WorkloadResourceSettings + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkloadResourceSettings for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkloadResourceSettingsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkloadResourceSettings(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkloadResourceSettingsSlice(c *Client, des, nw []WorkloadResourceSettings) []WorkloadResourceSettings { diff --git a/services/google/bigquery/alpha/dataset_internal.go b/services/google/bigquery/alpha/dataset_internal.go index 1296d92da7..4d54e8f601 100755 --- a/services/google/bigquery/alpha/dataset_internal.go +++ b/services/google/bigquery/alpha/dataset_internal.go @@ -850,23 +850,26 @@ func canonicalizeNewDatasetAccessSet(c *Client, des, nw []DatasetAccess) []Datas if des == nil { return nw } - var reorderedNew []DatasetAccess + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DatasetAccess for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDatasetAccessNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDatasetAccess(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDatasetAccessSlice(c *Client, des, nw []DatasetAccess) []DatasetAccess { @@ -974,23 +977,26 @@ func canonicalizeNewDatasetAccessViewSet(c *Client, des, nw []DatasetAccessView) if des == nil { return nw } - var reorderedNew []DatasetAccessView + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DatasetAccessView for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDatasetAccessViewNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDatasetAccessView(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDatasetAccessViewSlice(c *Client, des, nw []DatasetAccessView) []DatasetAccessView { @@ -1098,23 +1104,26 @@ func canonicalizeNewDatasetAccessRoutineSet(c *Client, des, nw []DatasetAccessRo if des == nil { return nw } - var reorderedNew []DatasetAccessRoutine + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DatasetAccessRoutine for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDatasetAccessRoutineNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDatasetAccessRoutine(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDatasetAccessRoutineSlice(c *Client, des, nw []DatasetAccessRoutine) []DatasetAccessRoutine { @@ -1210,23 +1219,26 @@ func canonicalizeNewDatasetDefaultEncryptionConfigurationSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []DatasetDefaultEncryptionConfiguration + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DatasetDefaultEncryptionConfiguration for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDatasetDefaultEncryptionConfigurationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDatasetDefaultEncryptionConfiguration(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDatasetDefaultEncryptionConfigurationSlice(c *Client, des, nw []DatasetDefaultEncryptionConfiguration) []DatasetDefaultEncryptionConfiguration { diff --git a/services/google/bigquery/beta/dataset_internal.go b/services/google/bigquery/beta/dataset_internal.go index e1fca754c7..708c83ddef 100755 --- a/services/google/bigquery/beta/dataset_internal.go +++ b/services/google/bigquery/beta/dataset_internal.go @@ -850,23 +850,26 @@ func canonicalizeNewDatasetAccessSet(c *Client, des, nw []DatasetAccess) []Datas if des == nil { return nw } - var reorderedNew []DatasetAccess + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DatasetAccess for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDatasetAccessNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDatasetAccess(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDatasetAccessSlice(c *Client, des, nw []DatasetAccess) []DatasetAccess { @@ -974,23 +977,26 @@ func canonicalizeNewDatasetAccessViewSet(c *Client, des, nw []DatasetAccessView) if des == nil { return nw } - var reorderedNew []DatasetAccessView + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DatasetAccessView for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDatasetAccessViewNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDatasetAccessView(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDatasetAccessViewSlice(c *Client, des, nw []DatasetAccessView) []DatasetAccessView { @@ -1098,23 +1104,26 @@ func canonicalizeNewDatasetAccessRoutineSet(c *Client, des, nw []DatasetAccessRo if des == nil { return nw } - var reorderedNew []DatasetAccessRoutine + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DatasetAccessRoutine for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDatasetAccessRoutineNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDatasetAccessRoutine(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDatasetAccessRoutineSlice(c *Client, des, nw []DatasetAccessRoutine) []DatasetAccessRoutine { @@ -1210,23 +1219,26 @@ func canonicalizeNewDatasetDefaultEncryptionConfigurationSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []DatasetDefaultEncryptionConfiguration + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DatasetDefaultEncryptionConfiguration for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDatasetDefaultEncryptionConfigurationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDatasetDefaultEncryptionConfiguration(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDatasetDefaultEncryptionConfigurationSlice(c *Client, des, nw []DatasetDefaultEncryptionConfiguration) []DatasetDefaultEncryptionConfiguration { diff --git a/services/google/bigquery/dataset_internal.go b/services/google/bigquery/dataset_internal.go index 86cbbffb8f..994d479c8c 100755 --- a/services/google/bigquery/dataset_internal.go +++ b/services/google/bigquery/dataset_internal.go @@ -850,23 +850,26 @@ func canonicalizeNewDatasetAccessSet(c *Client, des, nw []DatasetAccess) []Datas if des == nil { return nw } - var reorderedNew []DatasetAccess + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DatasetAccess for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDatasetAccessNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDatasetAccess(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDatasetAccessSlice(c *Client, des, nw []DatasetAccess) []DatasetAccess { @@ -974,23 +977,26 @@ func canonicalizeNewDatasetAccessViewSet(c *Client, des, nw []DatasetAccessView) if des == nil { return nw } - var reorderedNew []DatasetAccessView + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DatasetAccessView for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDatasetAccessViewNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDatasetAccessView(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDatasetAccessViewSlice(c *Client, des, nw []DatasetAccessView) []DatasetAccessView { @@ -1098,23 +1104,26 @@ func canonicalizeNewDatasetAccessRoutineSet(c *Client, des, nw []DatasetAccessRo if des == nil { return nw } - var reorderedNew []DatasetAccessRoutine + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DatasetAccessRoutine for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDatasetAccessRoutineNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDatasetAccessRoutine(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDatasetAccessRoutineSlice(c *Client, des, nw []DatasetAccessRoutine) []DatasetAccessRoutine { @@ -1210,23 +1219,26 @@ func canonicalizeNewDatasetDefaultEncryptionConfigurationSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []DatasetDefaultEncryptionConfiguration + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DatasetDefaultEncryptionConfiguration for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDatasetDefaultEncryptionConfigurationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDatasetDefaultEncryptionConfiguration(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDatasetDefaultEncryptionConfigurationSlice(c *Client, des, nw []DatasetDefaultEncryptionConfiguration) []DatasetDefaultEncryptionConfiguration { diff --git a/services/google/billingbudgets/alpha/budget_internal.go b/services/google/billingbudgets/alpha/budget_internal.go index a319df838a..959993f74e 100755 --- a/services/google/billingbudgets/alpha/budget_internal.go +++ b/services/google/billingbudgets/alpha/budget_internal.go @@ -679,23 +679,26 @@ func canonicalizeNewBudgetBudgetFilterSet(c *Client, des, nw []BudgetBudgetFilte if des == nil { return nw } - var reorderedNew []BudgetBudgetFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BudgetBudgetFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBudgetBudgetFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBudgetBudgetFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBudgetBudgetFilterSlice(c *Client, des, nw []BudgetBudgetFilter) []BudgetBudgetFilter { @@ -794,23 +797,26 @@ func canonicalizeNewBudgetBudgetFilterLabelsSet(c *Client, des, nw []BudgetBudge if des == nil { return nw } - var reorderedNew []BudgetBudgetFilterLabels + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BudgetBudgetFilterLabels for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBudgetBudgetFilterLabelsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBudgetBudgetFilterLabels(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBudgetBudgetFilterLabelsSlice(c *Client, des, nw []BudgetBudgetFilterLabels) []BudgetBudgetFilterLabels { @@ -905,23 +911,26 @@ func canonicalizeNewBudgetBudgetFilterCustomPeriodSet(c *Client, des, nw []Budge if des == nil { return nw } - var reorderedNew []BudgetBudgetFilterCustomPeriod + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BudgetBudgetFilterCustomPeriod for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBudgetBudgetFilterCustomPeriodNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBudgetBudgetFilterCustomPeriod(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBudgetBudgetFilterCustomPeriodSlice(c *Client, des, nw []BudgetBudgetFilterCustomPeriod) []BudgetBudgetFilterCustomPeriod { @@ -1029,23 +1038,26 @@ func canonicalizeNewBudgetBudgetFilterCustomPeriodStartDateSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []BudgetBudgetFilterCustomPeriodStartDate + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BudgetBudgetFilterCustomPeriodStartDate for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBudgetBudgetFilterCustomPeriodStartDateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBudgetBudgetFilterCustomPeriodStartDate(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBudgetBudgetFilterCustomPeriodStartDateSlice(c *Client, des, nw []BudgetBudgetFilterCustomPeriodStartDate) []BudgetBudgetFilterCustomPeriodStartDate { @@ -1153,23 +1165,26 @@ func canonicalizeNewBudgetBudgetFilterCustomPeriodEndDateSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []BudgetBudgetFilterCustomPeriodEndDate + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BudgetBudgetFilterCustomPeriodEndDate for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBudgetBudgetFilterCustomPeriodEndDateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBudgetBudgetFilterCustomPeriodEndDate(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBudgetBudgetFilterCustomPeriodEndDateSlice(c *Client, des, nw []BudgetBudgetFilterCustomPeriodEndDate) []BudgetBudgetFilterCustomPeriodEndDate { @@ -1284,23 +1299,26 @@ func canonicalizeNewBudgetAmountSet(c *Client, des, nw []BudgetAmount) []BudgetA if des == nil { return nw } - var reorderedNew []BudgetAmount + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BudgetAmount for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBudgetAmountNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBudgetAmount(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBudgetAmountSlice(c *Client, des, nw []BudgetAmount) []BudgetAmount { @@ -1411,23 +1429,26 @@ func canonicalizeNewBudgetAmountSpecifiedAmountSet(c *Client, des, nw []BudgetAm if des == nil { return nw } - var reorderedNew []BudgetAmountSpecifiedAmount + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BudgetAmountSpecifiedAmount for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBudgetAmountSpecifiedAmountNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBudgetAmountSpecifiedAmount(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBudgetAmountSpecifiedAmountSlice(c *Client, des, nw []BudgetAmountSpecifiedAmount) []BudgetAmountSpecifiedAmount { @@ -1515,23 +1536,26 @@ func canonicalizeNewBudgetAmountLastPeriodAmountSet(c *Client, des, nw []BudgetA if des == nil { return nw } - var reorderedNew []BudgetAmountLastPeriodAmount + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BudgetAmountLastPeriodAmount for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBudgetAmountLastPeriodAmountNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBudgetAmountLastPeriodAmount(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBudgetAmountLastPeriodAmountSlice(c *Client, des, nw []BudgetAmountLastPeriodAmount) []BudgetAmountLastPeriodAmount { @@ -1633,23 +1657,26 @@ func canonicalizeNewBudgetThresholdRulesSet(c *Client, des, nw []BudgetThreshold if des == nil { return nw } - var reorderedNew []BudgetThresholdRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BudgetThresholdRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBudgetThresholdRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBudgetThresholdRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBudgetThresholdRulesSlice(c *Client, des, nw []BudgetThresholdRules) []BudgetThresholdRules { @@ -1770,23 +1797,26 @@ func canonicalizeNewBudgetAllUpdatesRuleSet(c *Client, des, nw []BudgetAllUpdate if des == nil { return nw } - var reorderedNew []BudgetAllUpdatesRule + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BudgetAllUpdatesRule for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBudgetAllUpdatesRuleNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBudgetAllUpdatesRule(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBudgetAllUpdatesRuleSlice(c *Client, des, nw []BudgetAllUpdatesRule) []BudgetAllUpdatesRule { diff --git a/services/google/billingbudgets/beta/budget_internal.go b/services/google/billingbudgets/beta/budget_internal.go index ac29fce5b3..45fadc70a9 100755 --- a/services/google/billingbudgets/beta/budget_internal.go +++ b/services/google/billingbudgets/beta/budget_internal.go @@ -679,23 +679,26 @@ func canonicalizeNewBudgetBudgetFilterSet(c *Client, des, nw []BudgetBudgetFilte if des == nil { return nw } - var reorderedNew []BudgetBudgetFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BudgetBudgetFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBudgetBudgetFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBudgetBudgetFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBudgetBudgetFilterSlice(c *Client, des, nw []BudgetBudgetFilter) []BudgetBudgetFilter { @@ -794,23 +797,26 @@ func canonicalizeNewBudgetBudgetFilterLabelsSet(c *Client, des, nw []BudgetBudge if des == nil { return nw } - var reorderedNew []BudgetBudgetFilterLabels + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BudgetBudgetFilterLabels for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBudgetBudgetFilterLabelsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBudgetBudgetFilterLabels(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBudgetBudgetFilterLabelsSlice(c *Client, des, nw []BudgetBudgetFilterLabels) []BudgetBudgetFilterLabels { @@ -905,23 +911,26 @@ func canonicalizeNewBudgetBudgetFilterCustomPeriodSet(c *Client, des, nw []Budge if des == nil { return nw } - var reorderedNew []BudgetBudgetFilterCustomPeriod + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BudgetBudgetFilterCustomPeriod for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBudgetBudgetFilterCustomPeriodNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBudgetBudgetFilterCustomPeriod(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBudgetBudgetFilterCustomPeriodSlice(c *Client, des, nw []BudgetBudgetFilterCustomPeriod) []BudgetBudgetFilterCustomPeriod { @@ -1029,23 +1038,26 @@ func canonicalizeNewBudgetBudgetFilterCustomPeriodStartDateSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []BudgetBudgetFilterCustomPeriodStartDate + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BudgetBudgetFilterCustomPeriodStartDate for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBudgetBudgetFilterCustomPeriodStartDateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBudgetBudgetFilterCustomPeriodStartDate(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBudgetBudgetFilterCustomPeriodStartDateSlice(c *Client, des, nw []BudgetBudgetFilterCustomPeriodStartDate) []BudgetBudgetFilterCustomPeriodStartDate { @@ -1153,23 +1165,26 @@ func canonicalizeNewBudgetBudgetFilterCustomPeriodEndDateSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []BudgetBudgetFilterCustomPeriodEndDate + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BudgetBudgetFilterCustomPeriodEndDate for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBudgetBudgetFilterCustomPeriodEndDateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBudgetBudgetFilterCustomPeriodEndDate(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBudgetBudgetFilterCustomPeriodEndDateSlice(c *Client, des, nw []BudgetBudgetFilterCustomPeriodEndDate) []BudgetBudgetFilterCustomPeriodEndDate { @@ -1284,23 +1299,26 @@ func canonicalizeNewBudgetAmountSet(c *Client, des, nw []BudgetAmount) []BudgetA if des == nil { return nw } - var reorderedNew []BudgetAmount + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BudgetAmount for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBudgetAmountNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBudgetAmount(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBudgetAmountSlice(c *Client, des, nw []BudgetAmount) []BudgetAmount { @@ -1411,23 +1429,26 @@ func canonicalizeNewBudgetAmountSpecifiedAmountSet(c *Client, des, nw []BudgetAm if des == nil { return nw } - var reorderedNew []BudgetAmountSpecifiedAmount + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BudgetAmountSpecifiedAmount for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBudgetAmountSpecifiedAmountNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBudgetAmountSpecifiedAmount(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBudgetAmountSpecifiedAmountSlice(c *Client, des, nw []BudgetAmountSpecifiedAmount) []BudgetAmountSpecifiedAmount { @@ -1515,23 +1536,26 @@ func canonicalizeNewBudgetAmountLastPeriodAmountSet(c *Client, des, nw []BudgetA if des == nil { return nw } - var reorderedNew []BudgetAmountLastPeriodAmount + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BudgetAmountLastPeriodAmount for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBudgetAmountLastPeriodAmountNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBudgetAmountLastPeriodAmount(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBudgetAmountLastPeriodAmountSlice(c *Client, des, nw []BudgetAmountLastPeriodAmount) []BudgetAmountLastPeriodAmount { @@ -1633,23 +1657,26 @@ func canonicalizeNewBudgetThresholdRulesSet(c *Client, des, nw []BudgetThreshold if des == nil { return nw } - var reorderedNew []BudgetThresholdRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BudgetThresholdRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBudgetThresholdRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBudgetThresholdRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBudgetThresholdRulesSlice(c *Client, des, nw []BudgetThresholdRules) []BudgetThresholdRules { @@ -1770,23 +1797,26 @@ func canonicalizeNewBudgetAllUpdatesRuleSet(c *Client, des, nw []BudgetAllUpdate if des == nil { return nw } - var reorderedNew []BudgetAllUpdatesRule + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BudgetAllUpdatesRule for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBudgetAllUpdatesRuleNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBudgetAllUpdatesRule(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBudgetAllUpdatesRuleSlice(c *Client, des, nw []BudgetAllUpdatesRule) []BudgetAllUpdatesRule { diff --git a/services/google/billingbudgets/budget_internal.go b/services/google/billingbudgets/budget_internal.go index 309c7dba03..d647429b98 100755 --- a/services/google/billingbudgets/budget_internal.go +++ b/services/google/billingbudgets/budget_internal.go @@ -679,23 +679,26 @@ func canonicalizeNewBudgetBudgetFilterSet(c *Client, des, nw []BudgetBudgetFilte if des == nil { return nw } - var reorderedNew []BudgetBudgetFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BudgetBudgetFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBudgetBudgetFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBudgetBudgetFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBudgetBudgetFilterSlice(c *Client, des, nw []BudgetBudgetFilter) []BudgetBudgetFilter { @@ -794,23 +797,26 @@ func canonicalizeNewBudgetBudgetFilterLabelsSet(c *Client, des, nw []BudgetBudge if des == nil { return nw } - var reorderedNew []BudgetBudgetFilterLabels + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BudgetBudgetFilterLabels for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBudgetBudgetFilterLabelsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBudgetBudgetFilterLabels(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBudgetBudgetFilterLabelsSlice(c *Client, des, nw []BudgetBudgetFilterLabels) []BudgetBudgetFilterLabels { @@ -905,23 +911,26 @@ func canonicalizeNewBudgetBudgetFilterCustomPeriodSet(c *Client, des, nw []Budge if des == nil { return nw } - var reorderedNew []BudgetBudgetFilterCustomPeriod + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BudgetBudgetFilterCustomPeriod for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBudgetBudgetFilterCustomPeriodNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBudgetBudgetFilterCustomPeriod(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBudgetBudgetFilterCustomPeriodSlice(c *Client, des, nw []BudgetBudgetFilterCustomPeriod) []BudgetBudgetFilterCustomPeriod { @@ -1029,23 +1038,26 @@ func canonicalizeNewBudgetBudgetFilterCustomPeriodStartDateSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []BudgetBudgetFilterCustomPeriodStartDate + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BudgetBudgetFilterCustomPeriodStartDate for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBudgetBudgetFilterCustomPeriodStartDateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBudgetBudgetFilterCustomPeriodStartDate(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBudgetBudgetFilterCustomPeriodStartDateSlice(c *Client, des, nw []BudgetBudgetFilterCustomPeriodStartDate) []BudgetBudgetFilterCustomPeriodStartDate { @@ -1153,23 +1165,26 @@ func canonicalizeNewBudgetBudgetFilterCustomPeriodEndDateSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []BudgetBudgetFilterCustomPeriodEndDate + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BudgetBudgetFilterCustomPeriodEndDate for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBudgetBudgetFilterCustomPeriodEndDateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBudgetBudgetFilterCustomPeriodEndDate(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBudgetBudgetFilterCustomPeriodEndDateSlice(c *Client, des, nw []BudgetBudgetFilterCustomPeriodEndDate) []BudgetBudgetFilterCustomPeriodEndDate { @@ -1284,23 +1299,26 @@ func canonicalizeNewBudgetAmountSet(c *Client, des, nw []BudgetAmount) []BudgetA if des == nil { return nw } - var reorderedNew []BudgetAmount + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BudgetAmount for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBudgetAmountNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBudgetAmount(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBudgetAmountSlice(c *Client, des, nw []BudgetAmount) []BudgetAmount { @@ -1411,23 +1429,26 @@ func canonicalizeNewBudgetAmountSpecifiedAmountSet(c *Client, des, nw []BudgetAm if des == nil { return nw } - var reorderedNew []BudgetAmountSpecifiedAmount + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BudgetAmountSpecifiedAmount for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBudgetAmountSpecifiedAmountNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBudgetAmountSpecifiedAmount(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBudgetAmountSpecifiedAmountSlice(c *Client, des, nw []BudgetAmountSpecifiedAmount) []BudgetAmountSpecifiedAmount { @@ -1515,23 +1536,26 @@ func canonicalizeNewBudgetAmountLastPeriodAmountSet(c *Client, des, nw []BudgetA if des == nil { return nw } - var reorderedNew []BudgetAmountLastPeriodAmount + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BudgetAmountLastPeriodAmount for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBudgetAmountLastPeriodAmountNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBudgetAmountLastPeriodAmount(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBudgetAmountLastPeriodAmountSlice(c *Client, des, nw []BudgetAmountLastPeriodAmount) []BudgetAmountLastPeriodAmount { @@ -1633,23 +1657,26 @@ func canonicalizeNewBudgetThresholdRulesSet(c *Client, des, nw []BudgetThreshold if des == nil { return nw } - var reorderedNew []BudgetThresholdRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BudgetThresholdRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBudgetThresholdRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBudgetThresholdRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBudgetThresholdRulesSlice(c *Client, des, nw []BudgetThresholdRules) []BudgetThresholdRules { @@ -1770,23 +1797,26 @@ func canonicalizeNewBudgetAllUpdatesRuleSet(c *Client, des, nw []BudgetAllUpdate if des == nil { return nw } - var reorderedNew []BudgetAllUpdatesRule + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BudgetAllUpdatesRule for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBudgetAllUpdatesRuleNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBudgetAllUpdatesRule(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBudgetAllUpdatesRuleSlice(c *Client, des, nw []BudgetAllUpdatesRule) []BudgetAllUpdatesRule { diff --git a/services/google/binaryauthorization/alpha/attestor_internal.go b/services/google/binaryauthorization/alpha/attestor_internal.go index f2eb499df8..47fcfa3d02 100755 --- a/services/google/binaryauthorization/alpha/attestor_internal.go +++ b/services/google/binaryauthorization/alpha/attestor_internal.go @@ -556,23 +556,26 @@ func canonicalizeNewAttestorUserOwnedDrydockNoteSet(c *Client, des, nw []Attesto if des == nil { return nw } - var reorderedNew []AttestorUserOwnedDrydockNote + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AttestorUserOwnedDrydockNote for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAttestorUserOwnedDrydockNoteNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAttestorUserOwnedDrydockNote(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAttestorUserOwnedDrydockNoteSlice(c *Client, des, nw []AttestorUserOwnedDrydockNote) []AttestorUserOwnedDrydockNote { @@ -689,23 +692,26 @@ func canonicalizeNewAttestorUserOwnedDrydockNotePublicKeysSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []AttestorUserOwnedDrydockNotePublicKeys + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AttestorUserOwnedDrydockNotePublicKeys for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAttestorUserOwnedDrydockNotePublicKeysNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAttestorUserOwnedDrydockNotePublicKeys(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAttestorUserOwnedDrydockNotePublicKeysSlice(c *Client, des, nw []AttestorUserOwnedDrydockNotePublicKeys) []AttestorUserOwnedDrydockNotePublicKeys { @@ -810,23 +816,26 @@ func canonicalizeNewAttestorUserOwnedDrydockNotePublicKeysPkixPublicKeySet(c *Cl if des == nil { return nw } - var reorderedNew []AttestorUserOwnedDrydockNotePublicKeysPkixPublicKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AttestorUserOwnedDrydockNotePublicKeysPkixPublicKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAttestorUserOwnedDrydockNotePublicKeysPkixPublicKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAttestorUserOwnedDrydockNotePublicKeysPkixPublicKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAttestorUserOwnedDrydockNotePublicKeysPkixPublicKeySlice(c *Client, des, nw []AttestorUserOwnedDrydockNotePublicKeysPkixPublicKey) []AttestorUserOwnedDrydockNotePublicKeysPkixPublicKey { diff --git a/services/google/binaryauthorization/alpha/policy_internal.go b/services/google/binaryauthorization/alpha/policy_internal.go index 9998d736d1..b31ef83c5a 100755 --- a/services/google/binaryauthorization/alpha/policy_internal.go +++ b/services/google/binaryauthorization/alpha/policy_internal.go @@ -581,23 +581,26 @@ func canonicalizeNewPolicyAdmissionWhitelistPatternsSet(c *Client, des, nw []Pol if des == nil { return nw } - var reorderedNew []PolicyAdmissionWhitelistPatterns + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PolicyAdmissionWhitelistPatterns for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePolicyAdmissionWhitelistPatternsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPolicyAdmissionWhitelistPatterns(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPolicyAdmissionWhitelistPatternsSlice(c *Client, des, nw []PolicyAdmissionWhitelistPatterns) []PolicyAdmissionWhitelistPatterns { @@ -708,23 +711,26 @@ func canonicalizeNewPolicyClusterAdmissionRulesSet(c *Client, des, nw []PolicyCl if des == nil { return nw } - var reorderedNew []PolicyClusterAdmissionRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PolicyClusterAdmissionRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePolicyClusterAdmissionRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPolicyClusterAdmissionRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPolicyClusterAdmissionRulesSlice(c *Client, des, nw []PolicyClusterAdmissionRules) []PolicyClusterAdmissionRules { @@ -835,23 +841,26 @@ func canonicalizeNewPolicyKubernetesNamespaceAdmissionRulesSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []PolicyKubernetesNamespaceAdmissionRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PolicyKubernetesNamespaceAdmissionRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePolicyKubernetesNamespaceAdmissionRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPolicyKubernetesNamespaceAdmissionRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPolicyKubernetesNamespaceAdmissionRulesSlice(c *Client, des, nw []PolicyKubernetesNamespaceAdmissionRules) []PolicyKubernetesNamespaceAdmissionRules { @@ -962,23 +971,26 @@ func canonicalizeNewPolicyKubernetesServiceAccountAdmissionRulesSet(c *Client, d if des == nil { return nw } - var reorderedNew []PolicyKubernetesServiceAccountAdmissionRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PolicyKubernetesServiceAccountAdmissionRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePolicyKubernetesServiceAccountAdmissionRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPolicyKubernetesServiceAccountAdmissionRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPolicyKubernetesServiceAccountAdmissionRulesSlice(c *Client, des, nw []PolicyKubernetesServiceAccountAdmissionRules) []PolicyKubernetesServiceAccountAdmissionRules { @@ -1089,23 +1101,26 @@ func canonicalizeNewPolicyIstioServiceIdentityAdmissionRulesSet(c *Client, des, if des == nil { return nw } - var reorderedNew []PolicyIstioServiceIdentityAdmissionRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PolicyIstioServiceIdentityAdmissionRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePolicyIstioServiceIdentityAdmissionRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPolicyIstioServiceIdentityAdmissionRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPolicyIstioServiceIdentityAdmissionRulesSlice(c *Client, des, nw []PolicyIstioServiceIdentityAdmissionRules) []PolicyIstioServiceIdentityAdmissionRules { @@ -1216,23 +1231,26 @@ func canonicalizeNewPolicyDefaultAdmissionRuleSet(c *Client, des, nw []PolicyDef if des == nil { return nw } - var reorderedNew []PolicyDefaultAdmissionRule + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PolicyDefaultAdmissionRule for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePolicyDefaultAdmissionRuleNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPolicyDefaultAdmissionRule(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPolicyDefaultAdmissionRuleSlice(c *Client, des, nw []PolicyDefaultAdmissionRule) []PolicyDefaultAdmissionRule { diff --git a/services/google/binaryauthorization/attestor_internal.go b/services/google/binaryauthorization/attestor_internal.go index 51a982960a..b0325279a5 100755 --- a/services/google/binaryauthorization/attestor_internal.go +++ b/services/google/binaryauthorization/attestor_internal.go @@ -556,23 +556,26 @@ func canonicalizeNewAttestorUserOwnedDrydockNoteSet(c *Client, des, nw []Attesto if des == nil { return nw } - var reorderedNew []AttestorUserOwnedDrydockNote + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AttestorUserOwnedDrydockNote for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAttestorUserOwnedDrydockNoteNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAttestorUserOwnedDrydockNote(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAttestorUserOwnedDrydockNoteSlice(c *Client, des, nw []AttestorUserOwnedDrydockNote) []AttestorUserOwnedDrydockNote { @@ -689,23 +692,26 @@ func canonicalizeNewAttestorUserOwnedDrydockNotePublicKeysSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []AttestorUserOwnedDrydockNotePublicKeys + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AttestorUserOwnedDrydockNotePublicKeys for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAttestorUserOwnedDrydockNotePublicKeysNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAttestorUserOwnedDrydockNotePublicKeys(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAttestorUserOwnedDrydockNotePublicKeysSlice(c *Client, des, nw []AttestorUserOwnedDrydockNotePublicKeys) []AttestorUserOwnedDrydockNotePublicKeys { @@ -810,23 +816,26 @@ func canonicalizeNewAttestorUserOwnedDrydockNotePublicKeysPkixPublicKeySet(c *Cl if des == nil { return nw } - var reorderedNew []AttestorUserOwnedDrydockNotePublicKeysPkixPublicKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AttestorUserOwnedDrydockNotePublicKeysPkixPublicKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAttestorUserOwnedDrydockNotePublicKeysPkixPublicKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAttestorUserOwnedDrydockNotePublicKeysPkixPublicKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAttestorUserOwnedDrydockNotePublicKeysPkixPublicKeySlice(c *Client, des, nw []AttestorUserOwnedDrydockNotePublicKeysPkixPublicKey) []AttestorUserOwnedDrydockNotePublicKeysPkixPublicKey { diff --git a/services/google/binaryauthorization/beta/attestor_internal.go b/services/google/binaryauthorization/beta/attestor_internal.go index 860fff71c2..5437a09f0a 100755 --- a/services/google/binaryauthorization/beta/attestor_internal.go +++ b/services/google/binaryauthorization/beta/attestor_internal.go @@ -556,23 +556,26 @@ func canonicalizeNewAttestorUserOwnedDrydockNoteSet(c *Client, des, nw []Attesto if des == nil { return nw } - var reorderedNew []AttestorUserOwnedDrydockNote + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AttestorUserOwnedDrydockNote for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAttestorUserOwnedDrydockNoteNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAttestorUserOwnedDrydockNote(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAttestorUserOwnedDrydockNoteSlice(c *Client, des, nw []AttestorUserOwnedDrydockNote) []AttestorUserOwnedDrydockNote { @@ -689,23 +692,26 @@ func canonicalizeNewAttestorUserOwnedDrydockNotePublicKeysSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []AttestorUserOwnedDrydockNotePublicKeys + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AttestorUserOwnedDrydockNotePublicKeys for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAttestorUserOwnedDrydockNotePublicKeysNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAttestorUserOwnedDrydockNotePublicKeys(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAttestorUserOwnedDrydockNotePublicKeysSlice(c *Client, des, nw []AttestorUserOwnedDrydockNotePublicKeys) []AttestorUserOwnedDrydockNotePublicKeys { @@ -810,23 +816,26 @@ func canonicalizeNewAttestorUserOwnedDrydockNotePublicKeysPkixPublicKeySet(c *Cl if des == nil { return nw } - var reorderedNew []AttestorUserOwnedDrydockNotePublicKeysPkixPublicKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AttestorUserOwnedDrydockNotePublicKeysPkixPublicKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAttestorUserOwnedDrydockNotePublicKeysPkixPublicKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAttestorUserOwnedDrydockNotePublicKeysPkixPublicKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAttestorUserOwnedDrydockNotePublicKeysPkixPublicKeySlice(c *Client, des, nw []AttestorUserOwnedDrydockNotePublicKeysPkixPublicKey) []AttestorUserOwnedDrydockNotePublicKeysPkixPublicKey { diff --git a/services/google/binaryauthorization/beta/policy_internal.go b/services/google/binaryauthorization/beta/policy_internal.go index 077e097bf9..32ffd3a35b 100755 --- a/services/google/binaryauthorization/beta/policy_internal.go +++ b/services/google/binaryauthorization/beta/policy_internal.go @@ -581,23 +581,26 @@ func canonicalizeNewPolicyAdmissionWhitelistPatternsSet(c *Client, des, nw []Pol if des == nil { return nw } - var reorderedNew []PolicyAdmissionWhitelistPatterns + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PolicyAdmissionWhitelistPatterns for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePolicyAdmissionWhitelistPatternsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPolicyAdmissionWhitelistPatterns(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPolicyAdmissionWhitelistPatternsSlice(c *Client, des, nw []PolicyAdmissionWhitelistPatterns) []PolicyAdmissionWhitelistPatterns { @@ -708,23 +711,26 @@ func canonicalizeNewPolicyClusterAdmissionRulesSet(c *Client, des, nw []PolicyCl if des == nil { return nw } - var reorderedNew []PolicyClusterAdmissionRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PolicyClusterAdmissionRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePolicyClusterAdmissionRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPolicyClusterAdmissionRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPolicyClusterAdmissionRulesSlice(c *Client, des, nw []PolicyClusterAdmissionRules) []PolicyClusterAdmissionRules { @@ -835,23 +841,26 @@ func canonicalizeNewPolicyKubernetesNamespaceAdmissionRulesSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []PolicyKubernetesNamespaceAdmissionRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PolicyKubernetesNamespaceAdmissionRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePolicyKubernetesNamespaceAdmissionRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPolicyKubernetesNamespaceAdmissionRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPolicyKubernetesNamespaceAdmissionRulesSlice(c *Client, des, nw []PolicyKubernetesNamespaceAdmissionRules) []PolicyKubernetesNamespaceAdmissionRules { @@ -962,23 +971,26 @@ func canonicalizeNewPolicyKubernetesServiceAccountAdmissionRulesSet(c *Client, d if des == nil { return nw } - var reorderedNew []PolicyKubernetesServiceAccountAdmissionRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PolicyKubernetesServiceAccountAdmissionRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePolicyKubernetesServiceAccountAdmissionRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPolicyKubernetesServiceAccountAdmissionRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPolicyKubernetesServiceAccountAdmissionRulesSlice(c *Client, des, nw []PolicyKubernetesServiceAccountAdmissionRules) []PolicyKubernetesServiceAccountAdmissionRules { @@ -1089,23 +1101,26 @@ func canonicalizeNewPolicyIstioServiceIdentityAdmissionRulesSet(c *Client, des, if des == nil { return nw } - var reorderedNew []PolicyIstioServiceIdentityAdmissionRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PolicyIstioServiceIdentityAdmissionRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePolicyIstioServiceIdentityAdmissionRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPolicyIstioServiceIdentityAdmissionRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPolicyIstioServiceIdentityAdmissionRulesSlice(c *Client, des, nw []PolicyIstioServiceIdentityAdmissionRules) []PolicyIstioServiceIdentityAdmissionRules { @@ -1216,23 +1231,26 @@ func canonicalizeNewPolicyDefaultAdmissionRuleSet(c *Client, des, nw []PolicyDef if des == nil { return nw } - var reorderedNew []PolicyDefaultAdmissionRule + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PolicyDefaultAdmissionRule for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePolicyDefaultAdmissionRuleNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPolicyDefaultAdmissionRule(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPolicyDefaultAdmissionRuleSlice(c *Client, des, nw []PolicyDefaultAdmissionRule) []PolicyDefaultAdmissionRule { diff --git a/services/google/binaryauthorization/policy_internal.go b/services/google/binaryauthorization/policy_internal.go index 7abeeae3a2..86de3234dd 100755 --- a/services/google/binaryauthorization/policy_internal.go +++ b/services/google/binaryauthorization/policy_internal.go @@ -581,23 +581,26 @@ func canonicalizeNewPolicyAdmissionWhitelistPatternsSet(c *Client, des, nw []Pol if des == nil { return nw } - var reorderedNew []PolicyAdmissionWhitelistPatterns + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PolicyAdmissionWhitelistPatterns for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePolicyAdmissionWhitelistPatternsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPolicyAdmissionWhitelistPatterns(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPolicyAdmissionWhitelistPatternsSlice(c *Client, des, nw []PolicyAdmissionWhitelistPatterns) []PolicyAdmissionWhitelistPatterns { @@ -708,23 +711,26 @@ func canonicalizeNewPolicyClusterAdmissionRulesSet(c *Client, des, nw []PolicyCl if des == nil { return nw } - var reorderedNew []PolicyClusterAdmissionRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PolicyClusterAdmissionRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePolicyClusterAdmissionRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPolicyClusterAdmissionRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPolicyClusterAdmissionRulesSlice(c *Client, des, nw []PolicyClusterAdmissionRules) []PolicyClusterAdmissionRules { @@ -835,23 +841,26 @@ func canonicalizeNewPolicyKubernetesNamespaceAdmissionRulesSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []PolicyKubernetesNamespaceAdmissionRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PolicyKubernetesNamespaceAdmissionRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePolicyKubernetesNamespaceAdmissionRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPolicyKubernetesNamespaceAdmissionRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPolicyKubernetesNamespaceAdmissionRulesSlice(c *Client, des, nw []PolicyKubernetesNamespaceAdmissionRules) []PolicyKubernetesNamespaceAdmissionRules { @@ -962,23 +971,26 @@ func canonicalizeNewPolicyKubernetesServiceAccountAdmissionRulesSet(c *Client, d if des == nil { return nw } - var reorderedNew []PolicyKubernetesServiceAccountAdmissionRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PolicyKubernetesServiceAccountAdmissionRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePolicyKubernetesServiceAccountAdmissionRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPolicyKubernetesServiceAccountAdmissionRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPolicyKubernetesServiceAccountAdmissionRulesSlice(c *Client, des, nw []PolicyKubernetesServiceAccountAdmissionRules) []PolicyKubernetesServiceAccountAdmissionRules { @@ -1089,23 +1101,26 @@ func canonicalizeNewPolicyIstioServiceIdentityAdmissionRulesSet(c *Client, des, if des == nil { return nw } - var reorderedNew []PolicyIstioServiceIdentityAdmissionRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PolicyIstioServiceIdentityAdmissionRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePolicyIstioServiceIdentityAdmissionRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPolicyIstioServiceIdentityAdmissionRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPolicyIstioServiceIdentityAdmissionRulesSlice(c *Client, des, nw []PolicyIstioServiceIdentityAdmissionRules) []PolicyIstioServiceIdentityAdmissionRules { @@ -1216,23 +1231,26 @@ func canonicalizeNewPolicyDefaultAdmissionRuleSet(c *Client, des, nw []PolicyDef if des == nil { return nw } - var reorderedNew []PolicyDefaultAdmissionRule + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PolicyDefaultAdmissionRule for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePolicyDefaultAdmissionRuleNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPolicyDefaultAdmissionRule(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPolicyDefaultAdmissionRuleSlice(c *Client, des, nw []PolicyDefaultAdmissionRule) []PolicyDefaultAdmissionRule { diff --git a/services/google/cloudbuild/alpha/worker_pool_internal.go b/services/google/cloudbuild/alpha/worker_pool_internal.go index 8c1585db77..0f426cc496 100755 --- a/services/google/cloudbuild/alpha/worker_pool_internal.go +++ b/services/google/cloudbuild/alpha/worker_pool_internal.go @@ -766,23 +766,26 @@ func canonicalizeNewWorkerPoolPrivatePoolV1ConfigSet(c *Client, des, nw []Worker if des == nil { return nw } - var reorderedNew []WorkerPoolPrivatePoolV1Config + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkerPoolPrivatePoolV1Config for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkerPoolPrivatePoolV1ConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkerPoolPrivatePoolV1Config(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkerPoolPrivatePoolV1ConfigSlice(c *Client, des, nw []WorkerPoolPrivatePoolV1Config) []WorkerPoolPrivatePoolV1Config { @@ -887,23 +890,26 @@ func canonicalizeNewWorkerPoolPrivatePoolV1ConfigWorkerConfigSet(c *Client, des, if des == nil { return nw } - var reorderedNew []WorkerPoolPrivatePoolV1ConfigWorkerConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkerPoolPrivatePoolV1ConfigWorkerConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkerPoolPrivatePoolV1ConfigWorkerConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkerPoolPrivatePoolV1ConfigWorkerConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkerPoolPrivatePoolV1ConfigWorkerConfigSlice(c *Client, des, nw []WorkerPoolPrivatePoolV1ConfigWorkerConfig) []WorkerPoolPrivatePoolV1ConfigWorkerConfig { @@ -1014,23 +1020,26 @@ func canonicalizeNewWorkerPoolPrivatePoolV1ConfigNetworkConfigSet(c *Client, des if des == nil { return nw } - var reorderedNew []WorkerPoolPrivatePoolV1ConfigNetworkConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkerPoolPrivatePoolV1ConfigNetworkConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkerPoolPrivatePoolV1ConfigNetworkConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkerPoolPrivatePoolV1ConfigNetworkConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkerPoolPrivatePoolV1ConfigNetworkConfigSlice(c *Client, des, nw []WorkerPoolPrivatePoolV1ConfigNetworkConfig) []WorkerPoolPrivatePoolV1ConfigNetworkConfig { @@ -1143,23 +1152,26 @@ func canonicalizeNewWorkerPoolWorkerConfigSet(c *Client, des, nw []WorkerPoolWor if des == nil { return nw } - var reorderedNew []WorkerPoolWorkerConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkerPoolWorkerConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkerPoolWorkerConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkerPoolWorkerConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkerPoolWorkerConfigSlice(c *Client, des, nw []WorkerPoolWorkerConfig) []WorkerPoolWorkerConfig { @@ -1264,23 +1276,26 @@ func canonicalizeNewWorkerPoolNetworkConfigSet(c *Client, des, nw []WorkerPoolNe if des == nil { return nw } - var reorderedNew []WorkerPoolNetworkConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkerPoolNetworkConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkerPoolNetworkConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkerPoolNetworkConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkerPoolNetworkConfigSlice(c *Client, des, nw []WorkerPoolNetworkConfig) []WorkerPoolNetworkConfig { diff --git a/services/google/cloudbuild/beta/worker_pool_internal.go b/services/google/cloudbuild/beta/worker_pool_internal.go index fe5cc4c0db..d728303b03 100755 --- a/services/google/cloudbuild/beta/worker_pool_internal.go +++ b/services/google/cloudbuild/beta/worker_pool_internal.go @@ -766,23 +766,26 @@ func canonicalizeNewWorkerPoolPrivatePoolV1ConfigSet(c *Client, des, nw []Worker if des == nil { return nw } - var reorderedNew []WorkerPoolPrivatePoolV1Config + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkerPoolPrivatePoolV1Config for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkerPoolPrivatePoolV1ConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkerPoolPrivatePoolV1Config(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkerPoolPrivatePoolV1ConfigSlice(c *Client, des, nw []WorkerPoolPrivatePoolV1Config) []WorkerPoolPrivatePoolV1Config { @@ -887,23 +890,26 @@ func canonicalizeNewWorkerPoolPrivatePoolV1ConfigWorkerConfigSet(c *Client, des, if des == nil { return nw } - var reorderedNew []WorkerPoolPrivatePoolV1ConfigWorkerConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkerPoolPrivatePoolV1ConfigWorkerConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkerPoolPrivatePoolV1ConfigWorkerConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkerPoolPrivatePoolV1ConfigWorkerConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkerPoolPrivatePoolV1ConfigWorkerConfigSlice(c *Client, des, nw []WorkerPoolPrivatePoolV1ConfigWorkerConfig) []WorkerPoolPrivatePoolV1ConfigWorkerConfig { @@ -1014,23 +1020,26 @@ func canonicalizeNewWorkerPoolPrivatePoolV1ConfigNetworkConfigSet(c *Client, des if des == nil { return nw } - var reorderedNew []WorkerPoolPrivatePoolV1ConfigNetworkConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkerPoolPrivatePoolV1ConfigNetworkConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkerPoolPrivatePoolV1ConfigNetworkConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkerPoolPrivatePoolV1ConfigNetworkConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkerPoolPrivatePoolV1ConfigNetworkConfigSlice(c *Client, des, nw []WorkerPoolPrivatePoolV1ConfigNetworkConfig) []WorkerPoolPrivatePoolV1ConfigNetworkConfig { @@ -1143,23 +1152,26 @@ func canonicalizeNewWorkerPoolWorkerConfigSet(c *Client, des, nw []WorkerPoolWor if des == nil { return nw } - var reorderedNew []WorkerPoolWorkerConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkerPoolWorkerConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkerPoolWorkerConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkerPoolWorkerConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkerPoolWorkerConfigSlice(c *Client, des, nw []WorkerPoolWorkerConfig) []WorkerPoolWorkerConfig { @@ -1264,23 +1276,26 @@ func canonicalizeNewWorkerPoolNetworkConfigSet(c *Client, des, nw []WorkerPoolNe if des == nil { return nw } - var reorderedNew []WorkerPoolNetworkConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkerPoolNetworkConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkerPoolNetworkConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkerPoolNetworkConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkerPoolNetworkConfigSlice(c *Client, des, nw []WorkerPoolNetworkConfig) []WorkerPoolNetworkConfig { diff --git a/services/google/cloudbuild/worker_pool_internal.go b/services/google/cloudbuild/worker_pool_internal.go index 870624ba5b..216d884d73 100755 --- a/services/google/cloudbuild/worker_pool_internal.go +++ b/services/google/cloudbuild/worker_pool_internal.go @@ -766,23 +766,26 @@ func canonicalizeNewWorkerPoolPrivatePoolV1ConfigSet(c *Client, des, nw []Worker if des == nil { return nw } - var reorderedNew []WorkerPoolPrivatePoolV1Config + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkerPoolPrivatePoolV1Config for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkerPoolPrivatePoolV1ConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkerPoolPrivatePoolV1Config(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkerPoolPrivatePoolV1ConfigSlice(c *Client, des, nw []WorkerPoolPrivatePoolV1Config) []WorkerPoolPrivatePoolV1Config { @@ -887,23 +890,26 @@ func canonicalizeNewWorkerPoolPrivatePoolV1ConfigWorkerConfigSet(c *Client, des, if des == nil { return nw } - var reorderedNew []WorkerPoolPrivatePoolV1ConfigWorkerConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkerPoolPrivatePoolV1ConfigWorkerConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkerPoolPrivatePoolV1ConfigWorkerConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkerPoolPrivatePoolV1ConfigWorkerConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkerPoolPrivatePoolV1ConfigWorkerConfigSlice(c *Client, des, nw []WorkerPoolPrivatePoolV1ConfigWorkerConfig) []WorkerPoolPrivatePoolV1ConfigWorkerConfig { @@ -1014,23 +1020,26 @@ func canonicalizeNewWorkerPoolPrivatePoolV1ConfigNetworkConfigSet(c *Client, des if des == nil { return nw } - var reorderedNew []WorkerPoolPrivatePoolV1ConfigNetworkConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkerPoolPrivatePoolV1ConfigNetworkConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkerPoolPrivatePoolV1ConfigNetworkConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkerPoolPrivatePoolV1ConfigNetworkConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkerPoolPrivatePoolV1ConfigNetworkConfigSlice(c *Client, des, nw []WorkerPoolPrivatePoolV1ConfigNetworkConfig) []WorkerPoolPrivatePoolV1ConfigNetworkConfig { @@ -1143,23 +1152,26 @@ func canonicalizeNewWorkerPoolWorkerConfigSet(c *Client, des, nw []WorkerPoolWor if des == nil { return nw } - var reorderedNew []WorkerPoolWorkerConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkerPoolWorkerConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkerPoolWorkerConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkerPoolWorkerConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkerPoolWorkerConfigSlice(c *Client, des, nw []WorkerPoolWorkerConfig) []WorkerPoolWorkerConfig { @@ -1264,23 +1276,26 @@ func canonicalizeNewWorkerPoolNetworkConfigSet(c *Client, des, nw []WorkerPoolNe if des == nil { return nw } - var reorderedNew []WorkerPoolNetworkConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkerPoolNetworkConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkerPoolNetworkConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkerPoolNetworkConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkerPoolNetworkConfigSlice(c *Client, des, nw []WorkerPoolNetworkConfig) []WorkerPoolNetworkConfig { diff --git a/services/google/cloudbuildv2/alpha/connection_internal.go b/services/google/cloudbuildv2/alpha/connection_internal.go index 1225347538..f5c3e0616e 100755 --- a/services/google/cloudbuildv2/alpha/connection_internal.go +++ b/services/google/cloudbuildv2/alpha/connection_internal.go @@ -731,23 +731,26 @@ func canonicalizeNewConnectionGithubConfigSet(c *Client, des, nw []ConnectionGit if des == nil { return nw } - var reorderedNew []ConnectionGithubConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConnectionGithubConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConnectionGithubConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConnectionGithubConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConnectionGithubConfigSlice(c *Client, des, nw []ConnectionGithubConfig) []ConnectionGithubConfig { @@ -847,23 +850,26 @@ func canonicalizeNewConnectionGithubConfigAuthorizerCredentialSet(c *Client, des if des == nil { return nw } - var reorderedNew []ConnectionGithubConfigAuthorizerCredential + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConnectionGithubConfigAuthorizerCredential for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConnectionGithubConfigAuthorizerCredentialNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConnectionGithubConfigAuthorizerCredential(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConnectionGithubConfigAuthorizerCredentialSlice(c *Client, des, nw []ConnectionGithubConfigAuthorizerCredential) []ConnectionGithubConfigAuthorizerCredential { @@ -1004,23 +1010,26 @@ func canonicalizeNewConnectionGithubEnterpriseConfigSet(c *Client, des, nw []Con if des == nil { return nw } - var reorderedNew []ConnectionGithubEnterpriseConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConnectionGithubEnterpriseConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConnectionGithubEnterpriseConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConnectionGithubEnterpriseConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConnectionGithubEnterpriseConfigSlice(c *Client, des, nw []ConnectionGithubEnterpriseConfig) []ConnectionGithubEnterpriseConfig { @@ -1116,23 +1125,26 @@ func canonicalizeNewConnectionGithubEnterpriseConfigServiceDirectoryConfigSet(c if des == nil { return nw } - var reorderedNew []ConnectionGithubEnterpriseConfigServiceDirectoryConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConnectionGithubEnterpriseConfigServiceDirectoryConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConnectionGithubEnterpriseConfigServiceDirectoryConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConnectionGithubEnterpriseConfigServiceDirectoryConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConnectionGithubEnterpriseConfigServiceDirectoryConfigSlice(c *Client, des, nw []ConnectionGithubEnterpriseConfigServiceDirectoryConfig) []ConnectionGithubEnterpriseConfigServiceDirectoryConfig { @@ -1228,23 +1240,26 @@ func canonicalizeNewConnectionInstallationStateSet(c *Client, des, nw []Connecti if des == nil { return nw } - var reorderedNew []ConnectionInstallationState + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConnectionInstallationState for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConnectionInstallationStateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConnectionInstallationState(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConnectionInstallationStateSlice(c *Client, des, nw []ConnectionInstallationState) []ConnectionInstallationState { diff --git a/services/google/cloudbuildv2/beta/connection_internal.go b/services/google/cloudbuildv2/beta/connection_internal.go index f239604491..a618ae6ba5 100755 --- a/services/google/cloudbuildv2/beta/connection_internal.go +++ b/services/google/cloudbuildv2/beta/connection_internal.go @@ -731,23 +731,26 @@ func canonicalizeNewConnectionGithubConfigSet(c *Client, des, nw []ConnectionGit if des == nil { return nw } - var reorderedNew []ConnectionGithubConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConnectionGithubConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConnectionGithubConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConnectionGithubConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConnectionGithubConfigSlice(c *Client, des, nw []ConnectionGithubConfig) []ConnectionGithubConfig { @@ -847,23 +850,26 @@ func canonicalizeNewConnectionGithubConfigAuthorizerCredentialSet(c *Client, des if des == nil { return nw } - var reorderedNew []ConnectionGithubConfigAuthorizerCredential + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConnectionGithubConfigAuthorizerCredential for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConnectionGithubConfigAuthorizerCredentialNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConnectionGithubConfigAuthorizerCredential(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConnectionGithubConfigAuthorizerCredentialSlice(c *Client, des, nw []ConnectionGithubConfigAuthorizerCredential) []ConnectionGithubConfigAuthorizerCredential { @@ -1004,23 +1010,26 @@ func canonicalizeNewConnectionGithubEnterpriseConfigSet(c *Client, des, nw []Con if des == nil { return nw } - var reorderedNew []ConnectionGithubEnterpriseConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConnectionGithubEnterpriseConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConnectionGithubEnterpriseConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConnectionGithubEnterpriseConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConnectionGithubEnterpriseConfigSlice(c *Client, des, nw []ConnectionGithubEnterpriseConfig) []ConnectionGithubEnterpriseConfig { @@ -1116,23 +1125,26 @@ func canonicalizeNewConnectionGithubEnterpriseConfigServiceDirectoryConfigSet(c if des == nil { return nw } - var reorderedNew []ConnectionGithubEnterpriseConfigServiceDirectoryConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConnectionGithubEnterpriseConfigServiceDirectoryConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConnectionGithubEnterpriseConfigServiceDirectoryConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConnectionGithubEnterpriseConfigServiceDirectoryConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConnectionGithubEnterpriseConfigServiceDirectoryConfigSlice(c *Client, des, nw []ConnectionGithubEnterpriseConfigServiceDirectoryConfig) []ConnectionGithubEnterpriseConfigServiceDirectoryConfig { @@ -1228,23 +1240,26 @@ func canonicalizeNewConnectionInstallationStateSet(c *Client, des, nw []Connecti if des == nil { return nw } - var reorderedNew []ConnectionInstallationState + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConnectionInstallationState for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConnectionInstallationStateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConnectionInstallationState(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConnectionInstallationStateSlice(c *Client, des, nw []ConnectionInstallationState) []ConnectionInstallationState { diff --git a/services/google/clouddeploy/alpha/delivery_pipeline_internal.go b/services/google/clouddeploy/alpha/delivery_pipeline_internal.go index e063ba0e8d..b50f932bd6 100755 --- a/services/google/clouddeploy/alpha/delivery_pipeline_internal.go +++ b/services/google/clouddeploy/alpha/delivery_pipeline_internal.go @@ -736,23 +736,26 @@ func canonicalizeNewDeliveryPipelineSerialPipelineSet(c *Client, des, nw []Deliv if des == nil { return nw } - var reorderedNew []DeliveryPipelineSerialPipeline + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeliveryPipelineSerialPipeline for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeliveryPipelineSerialPipelineNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeliveryPipelineSerialPipeline(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeliveryPipelineSerialPipelineSlice(c *Client, des, nw []DeliveryPipelineSerialPipeline) []DeliveryPipelineSerialPipeline { @@ -861,23 +864,26 @@ func canonicalizeNewDeliveryPipelineSerialPipelineStagesSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []DeliveryPipelineSerialPipelineStages + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeliveryPipelineSerialPipelineStages for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeliveryPipelineSerialPipelineStagesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeliveryPipelineSerialPipelineStages(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeliveryPipelineSerialPipelineStagesSlice(c *Client, des, nw []DeliveryPipelineSerialPipelineStages) []DeliveryPipelineSerialPipelineStages { @@ -970,23 +976,26 @@ func canonicalizeNewDeliveryPipelineSerialPipelineStagesStrategySet(c *Client, d if des == nil { return nw } - var reorderedNew []DeliveryPipelineSerialPipelineStagesStrategy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeliveryPipelineSerialPipelineStagesStrategy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeliveryPipelineSerialPipelineStagesStrategyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeliveryPipelineSerialPipelineStagesStrategy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeliveryPipelineSerialPipelineStagesStrategySlice(c *Client, des, nw []DeliveryPipelineSerialPipelineStagesStrategy) []DeliveryPipelineSerialPipelineStagesStrategy { @@ -1085,23 +1094,26 @@ func canonicalizeNewDeliveryPipelineSerialPipelineStagesStrategyStandardSet(c *C if des == nil { return nw } - var reorderedNew []DeliveryPipelineSerialPipelineStagesStrategyStandard + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeliveryPipelineSerialPipelineStagesStrategyStandard for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeliveryPipelineSerialPipelineStagesStrategyStandardNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeliveryPipelineSerialPipelineStagesStrategyStandard(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeliveryPipelineSerialPipelineStagesStrategyStandardSlice(c *Client, des, nw []DeliveryPipelineSerialPipelineStagesStrategyStandard) []DeliveryPipelineSerialPipelineStagesStrategyStandard { @@ -1196,23 +1208,26 @@ func canonicalizeNewDeliveryPipelineConditionSet(c *Client, des, nw []DeliveryPi if des == nil { return nw } - var reorderedNew []DeliveryPipelineCondition + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeliveryPipelineCondition for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeliveryPipelineConditionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeliveryPipelineCondition(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeliveryPipelineConditionSlice(c *Client, des, nw []DeliveryPipelineCondition) []DeliveryPipelineCondition { @@ -1317,23 +1332,26 @@ func canonicalizeNewDeliveryPipelineConditionPipelineReadyConditionSet(c *Client if des == nil { return nw } - var reorderedNew []DeliveryPipelineConditionPipelineReadyCondition + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeliveryPipelineConditionPipelineReadyCondition for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeliveryPipelineConditionPipelineReadyConditionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeliveryPipelineConditionPipelineReadyCondition(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeliveryPipelineConditionPipelineReadyConditionSlice(c *Client, des, nw []DeliveryPipelineConditionPipelineReadyCondition) []DeliveryPipelineConditionPipelineReadyCondition { @@ -1446,23 +1464,26 @@ func canonicalizeNewDeliveryPipelineConditionTargetsPresentConditionSet(c *Clien if des == nil { return nw } - var reorderedNew []DeliveryPipelineConditionTargetsPresentCondition + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeliveryPipelineConditionTargetsPresentCondition for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeliveryPipelineConditionTargetsPresentConditionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeliveryPipelineConditionTargetsPresentCondition(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeliveryPipelineConditionTargetsPresentConditionSlice(c *Client, des, nw []DeliveryPipelineConditionTargetsPresentCondition) []DeliveryPipelineConditionTargetsPresentCondition { diff --git a/services/google/clouddeploy/alpha/target_internal.go b/services/google/clouddeploy/alpha/target_internal.go index fd9c0a746c..b27709fbae 100755 --- a/services/google/clouddeploy/alpha/target_internal.go +++ b/services/google/clouddeploy/alpha/target_internal.go @@ -812,23 +812,26 @@ func canonicalizeNewTargetGkeSet(c *Client, des, nw []TargetGke) []TargetGke { if des == nil { return nw } - var reorderedNew []TargetGke + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TargetGke for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTargetGkeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTargetGke(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTargetGkeSlice(c *Client, des, nw []TargetGke) []TargetGke { @@ -924,23 +927,26 @@ func canonicalizeNewTargetAnthosClusterSet(c *Client, des, nw []TargetAnthosClus if des == nil { return nw } - var reorderedNew []TargetAnthosCluster + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TargetAnthosCluster for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTargetAnthosClusterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTargetAnthosCluster(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTargetAnthosClusterSlice(c *Client, des, nw []TargetAnthosCluster) []TargetAnthosCluster { @@ -1067,23 +1073,26 @@ func canonicalizeNewTargetExecutionConfigsSet(c *Client, des, nw []TargetExecuti if des == nil { return nw } - var reorderedNew []TargetExecutionConfigs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TargetExecutionConfigs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTargetExecutionConfigsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTargetExecutionConfigs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTargetExecutionConfigsSlice(c *Client, des, nw []TargetExecutionConfigs) []TargetExecutionConfigs { @@ -1182,23 +1191,26 @@ func canonicalizeNewTargetRunSet(c *Client, des, nw []TargetRun) []TargetRun { if des == nil { return nw } - var reorderedNew []TargetRun + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TargetRun for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTargetRunNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTargetRun(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTargetRunSlice(c *Client, des, nw []TargetRun) []TargetRun { diff --git a/services/google/clouddeploy/beta/delivery_pipeline_internal.go b/services/google/clouddeploy/beta/delivery_pipeline_internal.go index e452a93212..0a26505090 100755 --- a/services/google/clouddeploy/beta/delivery_pipeline_internal.go +++ b/services/google/clouddeploy/beta/delivery_pipeline_internal.go @@ -736,23 +736,26 @@ func canonicalizeNewDeliveryPipelineSerialPipelineSet(c *Client, des, nw []Deliv if des == nil { return nw } - var reorderedNew []DeliveryPipelineSerialPipeline + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeliveryPipelineSerialPipeline for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeliveryPipelineSerialPipelineNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeliveryPipelineSerialPipeline(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeliveryPipelineSerialPipelineSlice(c *Client, des, nw []DeliveryPipelineSerialPipeline) []DeliveryPipelineSerialPipeline { @@ -861,23 +864,26 @@ func canonicalizeNewDeliveryPipelineSerialPipelineStagesSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []DeliveryPipelineSerialPipelineStages + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeliveryPipelineSerialPipelineStages for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeliveryPipelineSerialPipelineStagesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeliveryPipelineSerialPipelineStages(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeliveryPipelineSerialPipelineStagesSlice(c *Client, des, nw []DeliveryPipelineSerialPipelineStages) []DeliveryPipelineSerialPipelineStages { @@ -970,23 +976,26 @@ func canonicalizeNewDeliveryPipelineSerialPipelineStagesStrategySet(c *Client, d if des == nil { return nw } - var reorderedNew []DeliveryPipelineSerialPipelineStagesStrategy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeliveryPipelineSerialPipelineStagesStrategy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeliveryPipelineSerialPipelineStagesStrategyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeliveryPipelineSerialPipelineStagesStrategy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeliveryPipelineSerialPipelineStagesStrategySlice(c *Client, des, nw []DeliveryPipelineSerialPipelineStagesStrategy) []DeliveryPipelineSerialPipelineStagesStrategy { @@ -1085,23 +1094,26 @@ func canonicalizeNewDeliveryPipelineSerialPipelineStagesStrategyStandardSet(c *C if des == nil { return nw } - var reorderedNew []DeliveryPipelineSerialPipelineStagesStrategyStandard + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeliveryPipelineSerialPipelineStagesStrategyStandard for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeliveryPipelineSerialPipelineStagesStrategyStandardNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeliveryPipelineSerialPipelineStagesStrategyStandard(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeliveryPipelineSerialPipelineStagesStrategyStandardSlice(c *Client, des, nw []DeliveryPipelineSerialPipelineStagesStrategyStandard) []DeliveryPipelineSerialPipelineStagesStrategyStandard { @@ -1196,23 +1208,26 @@ func canonicalizeNewDeliveryPipelineConditionSet(c *Client, des, nw []DeliveryPi if des == nil { return nw } - var reorderedNew []DeliveryPipelineCondition + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeliveryPipelineCondition for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeliveryPipelineConditionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeliveryPipelineCondition(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeliveryPipelineConditionSlice(c *Client, des, nw []DeliveryPipelineCondition) []DeliveryPipelineCondition { @@ -1317,23 +1332,26 @@ func canonicalizeNewDeliveryPipelineConditionPipelineReadyConditionSet(c *Client if des == nil { return nw } - var reorderedNew []DeliveryPipelineConditionPipelineReadyCondition + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeliveryPipelineConditionPipelineReadyCondition for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeliveryPipelineConditionPipelineReadyConditionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeliveryPipelineConditionPipelineReadyCondition(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeliveryPipelineConditionPipelineReadyConditionSlice(c *Client, des, nw []DeliveryPipelineConditionPipelineReadyCondition) []DeliveryPipelineConditionPipelineReadyCondition { @@ -1446,23 +1464,26 @@ func canonicalizeNewDeliveryPipelineConditionTargetsPresentConditionSet(c *Clien if des == nil { return nw } - var reorderedNew []DeliveryPipelineConditionTargetsPresentCondition + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeliveryPipelineConditionTargetsPresentCondition for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeliveryPipelineConditionTargetsPresentConditionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeliveryPipelineConditionTargetsPresentCondition(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeliveryPipelineConditionTargetsPresentConditionSlice(c *Client, des, nw []DeliveryPipelineConditionTargetsPresentCondition) []DeliveryPipelineConditionTargetsPresentCondition { diff --git a/services/google/clouddeploy/beta/target_internal.go b/services/google/clouddeploy/beta/target_internal.go index 941507e08b..b58de5986c 100755 --- a/services/google/clouddeploy/beta/target_internal.go +++ b/services/google/clouddeploy/beta/target_internal.go @@ -812,23 +812,26 @@ func canonicalizeNewTargetGkeSet(c *Client, des, nw []TargetGke) []TargetGke { if des == nil { return nw } - var reorderedNew []TargetGke + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TargetGke for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTargetGkeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTargetGke(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTargetGkeSlice(c *Client, des, nw []TargetGke) []TargetGke { @@ -924,23 +927,26 @@ func canonicalizeNewTargetAnthosClusterSet(c *Client, des, nw []TargetAnthosClus if des == nil { return nw } - var reorderedNew []TargetAnthosCluster + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TargetAnthosCluster for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTargetAnthosClusterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTargetAnthosCluster(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTargetAnthosClusterSlice(c *Client, des, nw []TargetAnthosCluster) []TargetAnthosCluster { @@ -1067,23 +1073,26 @@ func canonicalizeNewTargetExecutionConfigsSet(c *Client, des, nw []TargetExecuti if des == nil { return nw } - var reorderedNew []TargetExecutionConfigs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TargetExecutionConfigs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTargetExecutionConfigsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTargetExecutionConfigs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTargetExecutionConfigsSlice(c *Client, des, nw []TargetExecutionConfigs) []TargetExecutionConfigs { @@ -1182,23 +1191,26 @@ func canonicalizeNewTargetRunSet(c *Client, des, nw []TargetRun) []TargetRun { if des == nil { return nw } - var reorderedNew []TargetRun + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TargetRun for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTargetRunNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTargetRun(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTargetRunSlice(c *Client, des, nw []TargetRun) []TargetRun { diff --git a/services/google/clouddeploy/delivery_pipeline_internal.go b/services/google/clouddeploy/delivery_pipeline_internal.go index 0595ee2961..f746de588c 100755 --- a/services/google/clouddeploy/delivery_pipeline_internal.go +++ b/services/google/clouddeploy/delivery_pipeline_internal.go @@ -720,23 +720,26 @@ func canonicalizeNewDeliveryPipelineSerialPipelineSet(c *Client, des, nw []Deliv if des == nil { return nw } - var reorderedNew []DeliveryPipelineSerialPipeline + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeliveryPipelineSerialPipeline for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeliveryPipelineSerialPipelineNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeliveryPipelineSerialPipeline(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeliveryPipelineSerialPipelineSlice(c *Client, des, nw []DeliveryPipelineSerialPipeline) []DeliveryPipelineSerialPipeline { @@ -843,23 +846,26 @@ func canonicalizeNewDeliveryPipelineSerialPipelineStagesSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []DeliveryPipelineSerialPipelineStages + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeliveryPipelineSerialPipelineStages for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeliveryPipelineSerialPipelineStagesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeliveryPipelineSerialPipelineStages(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeliveryPipelineSerialPipelineStagesSlice(c *Client, des, nw []DeliveryPipelineSerialPipelineStages) []DeliveryPipelineSerialPipelineStages { @@ -954,23 +960,26 @@ func canonicalizeNewDeliveryPipelineConditionSet(c *Client, des, nw []DeliveryPi if des == nil { return nw } - var reorderedNew []DeliveryPipelineCondition + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeliveryPipelineCondition for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeliveryPipelineConditionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeliveryPipelineCondition(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeliveryPipelineConditionSlice(c *Client, des, nw []DeliveryPipelineCondition) []DeliveryPipelineCondition { @@ -1075,23 +1084,26 @@ func canonicalizeNewDeliveryPipelineConditionPipelineReadyConditionSet(c *Client if des == nil { return nw } - var reorderedNew []DeliveryPipelineConditionPipelineReadyCondition + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeliveryPipelineConditionPipelineReadyCondition for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeliveryPipelineConditionPipelineReadyConditionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeliveryPipelineConditionPipelineReadyCondition(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeliveryPipelineConditionPipelineReadyConditionSlice(c *Client, des, nw []DeliveryPipelineConditionPipelineReadyCondition) []DeliveryPipelineConditionPipelineReadyCondition { @@ -1204,23 +1216,26 @@ func canonicalizeNewDeliveryPipelineConditionTargetsPresentConditionSet(c *Clien if des == nil { return nw } - var reorderedNew []DeliveryPipelineConditionTargetsPresentCondition + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeliveryPipelineConditionTargetsPresentCondition for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeliveryPipelineConditionTargetsPresentConditionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeliveryPipelineConditionTargetsPresentCondition(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeliveryPipelineConditionTargetsPresentConditionSlice(c *Client, des, nw []DeliveryPipelineConditionTargetsPresentCondition) []DeliveryPipelineConditionTargetsPresentCondition { diff --git a/services/google/clouddeploy/target_internal.go b/services/google/clouddeploy/target_internal.go index 454b95b22e..e9bcf2cc61 100755 --- a/services/google/clouddeploy/target_internal.go +++ b/services/google/clouddeploy/target_internal.go @@ -773,23 +773,26 @@ func canonicalizeNewTargetGkeSet(c *Client, des, nw []TargetGke) []TargetGke { if des == nil { return nw } - var reorderedNew []TargetGke + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TargetGke for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTargetGkeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTargetGke(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTargetGkeSlice(c *Client, des, nw []TargetGke) []TargetGke { @@ -885,23 +888,26 @@ func canonicalizeNewTargetAnthosClusterSet(c *Client, des, nw []TargetAnthosClus if des == nil { return nw } - var reorderedNew []TargetAnthosCluster + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TargetAnthosCluster for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTargetAnthosClusterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTargetAnthosCluster(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTargetAnthosClusterSlice(c *Client, des, nw []TargetAnthosCluster) []TargetAnthosCluster { @@ -1028,23 +1034,26 @@ func canonicalizeNewTargetExecutionConfigsSet(c *Client, des, nw []TargetExecuti if des == nil { return nw } - var reorderedNew []TargetExecutionConfigs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TargetExecutionConfigs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTargetExecutionConfigsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTargetExecutionConfigs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTargetExecutionConfigsSlice(c *Client, des, nw []TargetExecutionConfigs) []TargetExecutionConfigs { diff --git a/services/google/cloudfunctions/alpha/function_internal.go b/services/google/cloudfunctions/alpha/function_internal.go index dcc1e8da75..ecfc2fff17 100755 --- a/services/google/cloudfunctions/alpha/function_internal.go +++ b/services/google/cloudfunctions/alpha/function_internal.go @@ -901,23 +901,26 @@ func canonicalizeNewFunctionSourceRepositorySet(c *Client, des, nw []FunctionSou if des == nil { return nw } - var reorderedNew []FunctionSourceRepository + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FunctionSourceRepository for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFunctionSourceRepositoryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFunctionSourceRepository(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFunctionSourceRepositorySlice(c *Client, des, nw []FunctionSourceRepository) []FunctionSourceRepository { @@ -1017,23 +1020,26 @@ func canonicalizeNewFunctionHttpsTriggerSet(c *Client, des, nw []FunctionHttpsTr if des == nil { return nw } - var reorderedNew []FunctionHttpsTrigger + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FunctionHttpsTrigger for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFunctionHttpsTriggerNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFunctionHttpsTrigger(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFunctionHttpsTriggerSlice(c *Client, des, nw []FunctionHttpsTrigger) []FunctionHttpsTrigger { @@ -1154,23 +1160,26 @@ func canonicalizeNewFunctionEventTriggerSet(c *Client, des, nw []FunctionEventTr if des == nil { return nw } - var reorderedNew []FunctionEventTrigger + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FunctionEventTrigger for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFunctionEventTriggerNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFunctionEventTrigger(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFunctionEventTriggerSlice(c *Client, des, nw []FunctionEventTrigger) []FunctionEventTrigger { diff --git a/services/google/cloudfunctions/beta/function_internal.go b/services/google/cloudfunctions/beta/function_internal.go index 3a365e65bd..54e4545956 100755 --- a/services/google/cloudfunctions/beta/function_internal.go +++ b/services/google/cloudfunctions/beta/function_internal.go @@ -901,23 +901,26 @@ func canonicalizeNewFunctionSourceRepositorySet(c *Client, des, nw []FunctionSou if des == nil { return nw } - var reorderedNew []FunctionSourceRepository + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FunctionSourceRepository for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFunctionSourceRepositoryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFunctionSourceRepository(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFunctionSourceRepositorySlice(c *Client, des, nw []FunctionSourceRepository) []FunctionSourceRepository { @@ -1017,23 +1020,26 @@ func canonicalizeNewFunctionHttpsTriggerSet(c *Client, des, nw []FunctionHttpsTr if des == nil { return nw } - var reorderedNew []FunctionHttpsTrigger + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FunctionHttpsTrigger for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFunctionHttpsTriggerNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFunctionHttpsTrigger(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFunctionHttpsTriggerSlice(c *Client, des, nw []FunctionHttpsTrigger) []FunctionHttpsTrigger { @@ -1154,23 +1160,26 @@ func canonicalizeNewFunctionEventTriggerSet(c *Client, des, nw []FunctionEventTr if des == nil { return nw } - var reorderedNew []FunctionEventTrigger + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FunctionEventTrigger for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFunctionEventTriggerNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFunctionEventTrigger(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFunctionEventTriggerSlice(c *Client, des, nw []FunctionEventTrigger) []FunctionEventTrigger { diff --git a/services/google/cloudfunctions/function_internal.go b/services/google/cloudfunctions/function_internal.go index 74e3113ee9..b930b96e5a 100755 --- a/services/google/cloudfunctions/function_internal.go +++ b/services/google/cloudfunctions/function_internal.go @@ -901,23 +901,26 @@ func canonicalizeNewFunctionSourceRepositorySet(c *Client, des, nw []FunctionSou if des == nil { return nw } - var reorderedNew []FunctionSourceRepository + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FunctionSourceRepository for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFunctionSourceRepositoryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFunctionSourceRepository(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFunctionSourceRepositorySlice(c *Client, des, nw []FunctionSourceRepository) []FunctionSourceRepository { @@ -1017,23 +1020,26 @@ func canonicalizeNewFunctionHttpsTriggerSet(c *Client, des, nw []FunctionHttpsTr if des == nil { return nw } - var reorderedNew []FunctionHttpsTrigger + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FunctionHttpsTrigger for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFunctionHttpsTriggerNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFunctionHttpsTrigger(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFunctionHttpsTriggerSlice(c *Client, des, nw []FunctionHttpsTrigger) []FunctionHttpsTrigger { @@ -1154,23 +1160,26 @@ func canonicalizeNewFunctionEventTriggerSet(c *Client, des, nw []FunctionEventTr if des == nil { return nw } - var reorderedNew []FunctionEventTrigger + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FunctionEventTrigger for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFunctionEventTriggerNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFunctionEventTrigger(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFunctionEventTriggerSlice(c *Client, des, nw []FunctionEventTrigger) []FunctionEventTrigger { diff --git a/services/google/cloudidentity/alpha/group_internal.go b/services/google/cloudidentity/alpha/group_internal.go index 7b3f8240b6..9366090f13 100755 --- a/services/google/cloudidentity/alpha/group_internal.go +++ b/services/google/cloudidentity/alpha/group_internal.go @@ -733,23 +733,26 @@ func canonicalizeNewGroupGroupKeySet(c *Client, des, nw []GroupGroupKey) []Group if des == nil { return nw } - var reorderedNew []GroupGroupKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GroupGroupKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGroupGroupKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGroupGroupKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGroupGroupKeySlice(c *Client, des, nw []GroupGroupKey) []GroupGroupKey { @@ -856,23 +859,26 @@ func canonicalizeNewGroupAdditionalGroupKeysSet(c *Client, des, nw []GroupAdditi if des == nil { return nw } - var reorderedNew []GroupAdditionalGroupKeys + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GroupAdditionalGroupKeys for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGroupAdditionalGroupKeysNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGroupAdditionalGroupKeys(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGroupAdditionalGroupKeysSlice(c *Client, des, nw []GroupAdditionalGroupKeys) []GroupAdditionalGroupKeys { @@ -961,23 +967,26 @@ func canonicalizeNewGroupDirectMemberCountPerTypeSet(c *Client, des, nw []GroupD if des == nil { return nw } - var reorderedNew []GroupDirectMemberCountPerType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GroupDirectMemberCountPerType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGroupDirectMemberCountPerTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGroupDirectMemberCountPerType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGroupDirectMemberCountPerTypeSlice(c *Client, des, nw []GroupDirectMemberCountPerType) []GroupDirectMemberCountPerType { @@ -1084,23 +1093,26 @@ func canonicalizeNewGroupDerivedAliasesSet(c *Client, des, nw []GroupDerivedAlia if des == nil { return nw } - var reorderedNew []GroupDerivedAliases + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GroupDerivedAliases for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGroupDerivedAliasesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGroupDerivedAliases(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGroupDerivedAliasesSlice(c *Client, des, nw []GroupDerivedAliases) []GroupDerivedAliases { @@ -1194,23 +1206,26 @@ func canonicalizeNewGroupDynamicGroupMetadataSet(c *Client, des, nw []GroupDynam if des == nil { return nw } - var reorderedNew []GroupDynamicGroupMetadata + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GroupDynamicGroupMetadata for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGroupDynamicGroupMetadataNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGroupDynamicGroupMetadata(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGroupDynamicGroupMetadataSlice(c *Client, des, nw []GroupDynamicGroupMetadata) []GroupDynamicGroupMetadata { @@ -1315,23 +1330,26 @@ func canonicalizeNewGroupDynamicGroupMetadataQueriesSet(c *Client, des, nw []Gro if des == nil { return nw } - var reorderedNew []GroupDynamicGroupMetadataQueries + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GroupDynamicGroupMetadataQueries for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGroupDynamicGroupMetadataQueriesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGroupDynamicGroupMetadataQueries(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGroupDynamicGroupMetadataQueriesSlice(c *Client, des, nw []GroupDynamicGroupMetadataQueries) []GroupDynamicGroupMetadataQueries { @@ -1433,23 +1451,26 @@ func canonicalizeNewGroupDynamicGroupMetadataStatusSet(c *Client, des, nw []Grou if des == nil { return nw } - var reorderedNew []GroupDynamicGroupMetadataStatus + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GroupDynamicGroupMetadataStatus for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGroupDynamicGroupMetadataStatusNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGroupDynamicGroupMetadataStatus(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGroupDynamicGroupMetadataStatusSlice(c *Client, des, nw []GroupDynamicGroupMetadataStatus) []GroupDynamicGroupMetadataStatus { @@ -1564,23 +1585,26 @@ func canonicalizeNewGroupPosixGroupsSet(c *Client, des, nw []GroupPosixGroups) [ if des == nil { return nw } - var reorderedNew []GroupPosixGroups + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GroupPosixGroups for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGroupPosixGroupsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGroupPosixGroups(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGroupPosixGroupsSlice(c *Client, des, nw []GroupPosixGroups) []GroupPosixGroups { diff --git a/services/google/cloudidentity/alpha/membership_internal.go b/services/google/cloudidentity/alpha/membership_internal.go index b8a344705e..a0b271358c 100755 --- a/services/google/cloudidentity/alpha/membership_internal.go +++ b/services/google/cloudidentity/alpha/membership_internal.go @@ -656,23 +656,26 @@ func canonicalizeNewMembershipPreferredMemberKeySet(c *Client, des, nw []Members if des == nil { return nw } - var reorderedNew []MembershipPreferredMemberKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipPreferredMemberKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipPreferredMemberKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipPreferredMemberKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipPreferredMemberKeySlice(c *Client, des, nw []MembershipPreferredMemberKey) []MembershipPreferredMemberKey { @@ -775,23 +778,26 @@ func canonicalizeNewMembershipRolesSet(c *Client, des, nw []MembershipRoles) []M if des == nil { return nw } - var reorderedNew []MembershipRoles + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipRoles for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipRolesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipRoles(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipRolesSlice(c *Client, des, nw []MembershipRoles) []MembershipRoles { @@ -887,23 +893,26 @@ func canonicalizeNewMembershipRolesExpiryDetailSet(c *Client, des, nw []Membersh if des == nil { return nw } - var reorderedNew []MembershipRolesExpiryDetail + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipRolesExpiryDetail for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipRolesExpiryDetailNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipRolesExpiryDetail(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipRolesExpiryDetailSlice(c *Client, des, nw []MembershipRolesExpiryDetail) []MembershipRolesExpiryDetail { @@ -996,23 +1005,26 @@ func canonicalizeNewMembershipRolesRestrictionEvaluationsSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []MembershipRolesRestrictionEvaluations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipRolesRestrictionEvaluations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipRolesRestrictionEvaluationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipRolesRestrictionEvaluations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipRolesRestrictionEvaluationsSlice(c *Client, des, nw []MembershipRolesRestrictionEvaluations) []MembershipRolesRestrictionEvaluations { @@ -1101,23 +1113,26 @@ func canonicalizeNewMembershipRolesRestrictionEvaluationsMemberRestrictionEvalua if des == nil { return nw } - var reorderedNew []MembershipRolesRestrictionEvaluationsMemberRestrictionEvaluation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipRolesRestrictionEvaluationsMemberRestrictionEvaluation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipRolesRestrictionEvaluationsMemberRestrictionEvaluationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipRolesRestrictionEvaluationsMemberRestrictionEvaluation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipRolesRestrictionEvaluationsMemberRestrictionEvaluationSlice(c *Client, des, nw []MembershipRolesRestrictionEvaluationsMemberRestrictionEvaluation) []MembershipRolesRestrictionEvaluationsMemberRestrictionEvaluation { @@ -1246,23 +1261,26 @@ func canonicalizeNewMembershipDisplayNameSet(c *Client, des, nw []MembershipDisp if des == nil { return nw } - var reorderedNew []MembershipDisplayName + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipDisplayName for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipDisplayNameNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipDisplayName(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipDisplayNameSlice(c *Client, des, nw []MembershipDisplayName) []MembershipDisplayName { @@ -1369,23 +1387,26 @@ func canonicalizeNewMembershipMemberKeySet(c *Client, des, nw []MembershipMember if des == nil { return nw } - var reorderedNew []MembershipMemberKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipMemberKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipMemberKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipMemberKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipMemberKeySlice(c *Client, des, nw []MembershipMemberKey) []MembershipMemberKey { diff --git a/services/google/cloudidentity/beta/group_internal.go b/services/google/cloudidentity/beta/group_internal.go index 3d3a35a2a9..c1676f0bd8 100755 --- a/services/google/cloudidentity/beta/group_internal.go +++ b/services/google/cloudidentity/beta/group_internal.go @@ -733,23 +733,26 @@ func canonicalizeNewGroupGroupKeySet(c *Client, des, nw []GroupGroupKey) []Group if des == nil { return nw } - var reorderedNew []GroupGroupKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GroupGroupKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGroupGroupKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGroupGroupKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGroupGroupKeySlice(c *Client, des, nw []GroupGroupKey) []GroupGroupKey { @@ -856,23 +859,26 @@ func canonicalizeNewGroupAdditionalGroupKeysSet(c *Client, des, nw []GroupAdditi if des == nil { return nw } - var reorderedNew []GroupAdditionalGroupKeys + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GroupAdditionalGroupKeys for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGroupAdditionalGroupKeysNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGroupAdditionalGroupKeys(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGroupAdditionalGroupKeysSlice(c *Client, des, nw []GroupAdditionalGroupKeys) []GroupAdditionalGroupKeys { @@ -961,23 +967,26 @@ func canonicalizeNewGroupDirectMemberCountPerTypeSet(c *Client, des, nw []GroupD if des == nil { return nw } - var reorderedNew []GroupDirectMemberCountPerType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GroupDirectMemberCountPerType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGroupDirectMemberCountPerTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGroupDirectMemberCountPerType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGroupDirectMemberCountPerTypeSlice(c *Client, des, nw []GroupDirectMemberCountPerType) []GroupDirectMemberCountPerType { @@ -1084,23 +1093,26 @@ func canonicalizeNewGroupDerivedAliasesSet(c *Client, des, nw []GroupDerivedAlia if des == nil { return nw } - var reorderedNew []GroupDerivedAliases + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GroupDerivedAliases for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGroupDerivedAliasesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGroupDerivedAliases(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGroupDerivedAliasesSlice(c *Client, des, nw []GroupDerivedAliases) []GroupDerivedAliases { @@ -1194,23 +1206,26 @@ func canonicalizeNewGroupDynamicGroupMetadataSet(c *Client, des, nw []GroupDynam if des == nil { return nw } - var reorderedNew []GroupDynamicGroupMetadata + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GroupDynamicGroupMetadata for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGroupDynamicGroupMetadataNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGroupDynamicGroupMetadata(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGroupDynamicGroupMetadataSlice(c *Client, des, nw []GroupDynamicGroupMetadata) []GroupDynamicGroupMetadata { @@ -1315,23 +1330,26 @@ func canonicalizeNewGroupDynamicGroupMetadataQueriesSet(c *Client, des, nw []Gro if des == nil { return nw } - var reorderedNew []GroupDynamicGroupMetadataQueries + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GroupDynamicGroupMetadataQueries for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGroupDynamicGroupMetadataQueriesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGroupDynamicGroupMetadataQueries(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGroupDynamicGroupMetadataQueriesSlice(c *Client, des, nw []GroupDynamicGroupMetadataQueries) []GroupDynamicGroupMetadataQueries { @@ -1433,23 +1451,26 @@ func canonicalizeNewGroupDynamicGroupMetadataStatusSet(c *Client, des, nw []Grou if des == nil { return nw } - var reorderedNew []GroupDynamicGroupMetadataStatus + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GroupDynamicGroupMetadataStatus for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGroupDynamicGroupMetadataStatusNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGroupDynamicGroupMetadataStatus(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGroupDynamicGroupMetadataStatusSlice(c *Client, des, nw []GroupDynamicGroupMetadataStatus) []GroupDynamicGroupMetadataStatus { @@ -1564,23 +1585,26 @@ func canonicalizeNewGroupPosixGroupsSet(c *Client, des, nw []GroupPosixGroups) [ if des == nil { return nw } - var reorderedNew []GroupPosixGroups + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GroupPosixGroups for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGroupPosixGroupsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGroupPosixGroups(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGroupPosixGroupsSlice(c *Client, des, nw []GroupPosixGroups) []GroupPosixGroups { diff --git a/services/google/cloudidentity/beta/membership_internal.go b/services/google/cloudidentity/beta/membership_internal.go index ca78f54c8d..a514e78c88 100755 --- a/services/google/cloudidentity/beta/membership_internal.go +++ b/services/google/cloudidentity/beta/membership_internal.go @@ -656,23 +656,26 @@ func canonicalizeNewMembershipPreferredMemberKeySet(c *Client, des, nw []Members if des == nil { return nw } - var reorderedNew []MembershipPreferredMemberKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipPreferredMemberKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipPreferredMemberKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipPreferredMemberKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipPreferredMemberKeySlice(c *Client, des, nw []MembershipPreferredMemberKey) []MembershipPreferredMemberKey { @@ -775,23 +778,26 @@ func canonicalizeNewMembershipRolesSet(c *Client, des, nw []MembershipRoles) []M if des == nil { return nw } - var reorderedNew []MembershipRoles + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipRoles for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipRolesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipRoles(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipRolesSlice(c *Client, des, nw []MembershipRoles) []MembershipRoles { @@ -887,23 +893,26 @@ func canonicalizeNewMembershipRolesExpiryDetailSet(c *Client, des, nw []Membersh if des == nil { return nw } - var reorderedNew []MembershipRolesExpiryDetail + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipRolesExpiryDetail for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipRolesExpiryDetailNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipRolesExpiryDetail(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipRolesExpiryDetailSlice(c *Client, des, nw []MembershipRolesExpiryDetail) []MembershipRolesExpiryDetail { @@ -996,23 +1005,26 @@ func canonicalizeNewMembershipRolesRestrictionEvaluationsSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []MembershipRolesRestrictionEvaluations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipRolesRestrictionEvaluations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipRolesRestrictionEvaluationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipRolesRestrictionEvaluations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipRolesRestrictionEvaluationsSlice(c *Client, des, nw []MembershipRolesRestrictionEvaluations) []MembershipRolesRestrictionEvaluations { @@ -1101,23 +1113,26 @@ func canonicalizeNewMembershipRolesRestrictionEvaluationsMemberRestrictionEvalua if des == nil { return nw } - var reorderedNew []MembershipRolesRestrictionEvaluationsMemberRestrictionEvaluation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipRolesRestrictionEvaluationsMemberRestrictionEvaluation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipRolesRestrictionEvaluationsMemberRestrictionEvaluationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipRolesRestrictionEvaluationsMemberRestrictionEvaluation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipRolesRestrictionEvaluationsMemberRestrictionEvaluationSlice(c *Client, des, nw []MembershipRolesRestrictionEvaluationsMemberRestrictionEvaluation) []MembershipRolesRestrictionEvaluationsMemberRestrictionEvaluation { @@ -1246,23 +1261,26 @@ func canonicalizeNewMembershipDisplayNameSet(c *Client, des, nw []MembershipDisp if des == nil { return nw } - var reorderedNew []MembershipDisplayName + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipDisplayName for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipDisplayNameNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipDisplayName(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipDisplayNameSlice(c *Client, des, nw []MembershipDisplayName) []MembershipDisplayName { @@ -1369,23 +1387,26 @@ func canonicalizeNewMembershipMemberKeySet(c *Client, des, nw []MembershipMember if des == nil { return nw } - var reorderedNew []MembershipMemberKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipMemberKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipMemberKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipMemberKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipMemberKeySlice(c *Client, des, nw []MembershipMemberKey) []MembershipMemberKey { diff --git a/services/google/cloudidentity/group_internal.go b/services/google/cloudidentity/group_internal.go index 8acc724bc0..9f7f6cce0b 100755 --- a/services/google/cloudidentity/group_internal.go +++ b/services/google/cloudidentity/group_internal.go @@ -718,23 +718,26 @@ func canonicalizeNewGroupGroupKeySet(c *Client, des, nw []GroupGroupKey) []Group if des == nil { return nw } - var reorderedNew []GroupGroupKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GroupGroupKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGroupGroupKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGroupGroupKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGroupGroupKeySlice(c *Client, des, nw []GroupGroupKey) []GroupGroupKey { @@ -841,23 +844,26 @@ func canonicalizeNewGroupAdditionalGroupKeysSet(c *Client, des, nw []GroupAdditi if des == nil { return nw } - var reorderedNew []GroupAdditionalGroupKeys + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GroupAdditionalGroupKeys for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGroupAdditionalGroupKeysNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGroupAdditionalGroupKeys(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGroupAdditionalGroupKeysSlice(c *Client, des, nw []GroupAdditionalGroupKeys) []GroupAdditionalGroupKeys { @@ -946,23 +952,26 @@ func canonicalizeNewGroupDirectMemberCountPerTypeSet(c *Client, des, nw []GroupD if des == nil { return nw } - var reorderedNew []GroupDirectMemberCountPerType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GroupDirectMemberCountPerType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGroupDirectMemberCountPerTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGroupDirectMemberCountPerType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGroupDirectMemberCountPerTypeSlice(c *Client, des, nw []GroupDirectMemberCountPerType) []GroupDirectMemberCountPerType { @@ -1069,23 +1078,26 @@ func canonicalizeNewGroupDerivedAliasesSet(c *Client, des, nw []GroupDerivedAlia if des == nil { return nw } - var reorderedNew []GroupDerivedAliases + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GroupDerivedAliases for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGroupDerivedAliasesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGroupDerivedAliases(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGroupDerivedAliasesSlice(c *Client, des, nw []GroupDerivedAliases) []GroupDerivedAliases { @@ -1179,23 +1191,26 @@ func canonicalizeNewGroupDynamicGroupMetadataSet(c *Client, des, nw []GroupDynam if des == nil { return nw } - var reorderedNew []GroupDynamicGroupMetadata + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GroupDynamicGroupMetadata for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGroupDynamicGroupMetadataNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGroupDynamicGroupMetadata(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGroupDynamicGroupMetadataSlice(c *Client, des, nw []GroupDynamicGroupMetadata) []GroupDynamicGroupMetadata { @@ -1300,23 +1315,26 @@ func canonicalizeNewGroupDynamicGroupMetadataQueriesSet(c *Client, des, nw []Gro if des == nil { return nw } - var reorderedNew []GroupDynamicGroupMetadataQueries + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GroupDynamicGroupMetadataQueries for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGroupDynamicGroupMetadataQueriesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGroupDynamicGroupMetadataQueries(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGroupDynamicGroupMetadataQueriesSlice(c *Client, des, nw []GroupDynamicGroupMetadataQueries) []GroupDynamicGroupMetadataQueries { @@ -1418,23 +1436,26 @@ func canonicalizeNewGroupDynamicGroupMetadataStatusSet(c *Client, des, nw []Grou if des == nil { return nw } - var reorderedNew []GroupDynamicGroupMetadataStatus + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GroupDynamicGroupMetadataStatus for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGroupDynamicGroupMetadataStatusNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGroupDynamicGroupMetadataStatus(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGroupDynamicGroupMetadataStatusSlice(c *Client, des, nw []GroupDynamicGroupMetadataStatus) []GroupDynamicGroupMetadataStatus { diff --git a/services/google/cloudidentity/membership_internal.go b/services/google/cloudidentity/membership_internal.go index 95ec165754..ef1a9bd132 100755 --- a/services/google/cloudidentity/membership_internal.go +++ b/services/google/cloudidentity/membership_internal.go @@ -635,23 +635,26 @@ func canonicalizeNewMembershipPreferredMemberKeySet(c *Client, des, nw []Members if des == nil { return nw } - var reorderedNew []MembershipPreferredMemberKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipPreferredMemberKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipPreferredMemberKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipPreferredMemberKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipPreferredMemberKeySlice(c *Client, des, nw []MembershipPreferredMemberKey) []MembershipPreferredMemberKey { @@ -754,23 +757,26 @@ func canonicalizeNewMembershipRolesSet(c *Client, des, nw []MembershipRoles) []M if des == nil { return nw } - var reorderedNew []MembershipRoles + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipRoles for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipRolesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipRoles(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipRolesSlice(c *Client, des, nw []MembershipRoles) []MembershipRoles { @@ -866,23 +872,26 @@ func canonicalizeNewMembershipRolesExpiryDetailSet(c *Client, des, nw []Membersh if des == nil { return nw } - var reorderedNew []MembershipRolesExpiryDetail + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipRolesExpiryDetail for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipRolesExpiryDetailNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipRolesExpiryDetail(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipRolesExpiryDetailSlice(c *Client, des, nw []MembershipRolesExpiryDetail) []MembershipRolesExpiryDetail { @@ -975,23 +984,26 @@ func canonicalizeNewMembershipRolesRestrictionEvaluationsSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []MembershipRolesRestrictionEvaluations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipRolesRestrictionEvaluations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipRolesRestrictionEvaluationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipRolesRestrictionEvaluations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipRolesRestrictionEvaluationsSlice(c *Client, des, nw []MembershipRolesRestrictionEvaluations) []MembershipRolesRestrictionEvaluations { @@ -1080,23 +1092,26 @@ func canonicalizeNewMembershipRolesRestrictionEvaluationsMemberRestrictionEvalua if des == nil { return nw } - var reorderedNew []MembershipRolesRestrictionEvaluationsMemberRestrictionEvaluation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipRolesRestrictionEvaluationsMemberRestrictionEvaluation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipRolesRestrictionEvaluationsMemberRestrictionEvaluationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipRolesRestrictionEvaluationsMemberRestrictionEvaluation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipRolesRestrictionEvaluationsMemberRestrictionEvaluationSlice(c *Client, des, nw []MembershipRolesRestrictionEvaluationsMemberRestrictionEvaluation) []MembershipRolesRestrictionEvaluationsMemberRestrictionEvaluation { @@ -1225,23 +1240,26 @@ func canonicalizeNewMembershipDisplayNameSet(c *Client, des, nw []MembershipDisp if des == nil { return nw } - var reorderedNew []MembershipDisplayName + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipDisplayName for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipDisplayNameNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipDisplayName(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipDisplayNameSlice(c *Client, des, nw []MembershipDisplayName) []MembershipDisplayName { diff --git a/services/google/cloudkms/alpha/crypto_key_internal.go b/services/google/cloudkms/alpha/crypto_key_internal.go index 49c640a5c2..5ab76cd692 100755 --- a/services/google/cloudkms/alpha/crypto_key_internal.go +++ b/services/google/cloudkms/alpha/crypto_key_internal.go @@ -671,23 +671,26 @@ func canonicalizeNewCryptoKeyPrimarySet(c *Client, des, nw []CryptoKeyPrimary) [ if des == nil { return nw } - var reorderedNew []CryptoKeyPrimary + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CryptoKeyPrimary for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCryptoKeyPrimaryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCryptoKeyPrimary(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCryptoKeyPrimarySlice(c *Client, des, nw []CryptoKeyPrimary) []CryptoKeyPrimary { @@ -781,23 +784,26 @@ func canonicalizeNewCryptoKeyPrimaryAttestationSet(c *Client, des, nw []CryptoKe if des == nil { return nw } - var reorderedNew []CryptoKeyPrimaryAttestation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CryptoKeyPrimaryAttestation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCryptoKeyPrimaryAttestationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCryptoKeyPrimaryAttestation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCryptoKeyPrimaryAttestationSlice(c *Client, des, nw []CryptoKeyPrimaryAttestation) []CryptoKeyPrimaryAttestation { @@ -912,23 +918,26 @@ func canonicalizeNewCryptoKeyPrimaryAttestationCertChainsSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []CryptoKeyPrimaryAttestationCertChains + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CryptoKeyPrimaryAttestationCertChains for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCryptoKeyPrimaryAttestationCertChainsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCryptoKeyPrimaryAttestationCertChains(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCryptoKeyPrimaryAttestationCertChainsSlice(c *Client, des, nw []CryptoKeyPrimaryAttestationCertChains) []CryptoKeyPrimaryAttestationCertChains { @@ -1027,23 +1036,26 @@ func canonicalizeNewCryptoKeyPrimaryExternalProtectionLevelOptionsSet(c *Client, if des == nil { return nw } - var reorderedNew []CryptoKeyPrimaryExternalProtectionLevelOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CryptoKeyPrimaryExternalProtectionLevelOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCryptoKeyPrimaryExternalProtectionLevelOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCryptoKeyPrimaryExternalProtectionLevelOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCryptoKeyPrimaryExternalProtectionLevelOptionsSlice(c *Client, des, nw []CryptoKeyPrimaryExternalProtectionLevelOptions) []CryptoKeyPrimaryExternalProtectionLevelOptions { @@ -1145,23 +1157,26 @@ func canonicalizeNewCryptoKeyVersionTemplateSet(c *Client, des, nw []CryptoKeyVe if des == nil { return nw } - var reorderedNew []CryptoKeyVersionTemplate + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CryptoKeyVersionTemplate for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCryptoKeyVersionTemplateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCryptoKeyVersionTemplate(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCryptoKeyVersionTemplateSlice(c *Client, des, nw []CryptoKeyVersionTemplate) []CryptoKeyVersionTemplate { diff --git a/services/google/cloudkms/alpha/ekm_connection_internal.go b/services/google/cloudkms/alpha/ekm_connection_internal.go index 1f538b3aba..91eaaacef3 100755 --- a/services/google/cloudkms/alpha/ekm_connection_internal.go +++ b/services/google/cloudkms/alpha/ekm_connection_internal.go @@ -558,23 +558,26 @@ func canonicalizeNewEkmConnectionServiceResolversSet(c *Client, des, nw []EkmCon if des == nil { return nw } - var reorderedNew []EkmConnectionServiceResolvers + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []EkmConnectionServiceResolvers for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareEkmConnectionServiceResolversNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewEkmConnectionServiceResolvers(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewEkmConnectionServiceResolversSlice(c *Client, des, nw []EkmConnectionServiceResolvers) []EkmConnectionServiceResolvers { @@ -691,23 +694,26 @@ func canonicalizeNewEkmConnectionServiceResolversServerCertificatesSet(c *Client if des == nil { return nw } - var reorderedNew []EkmConnectionServiceResolversServerCertificates + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []EkmConnectionServiceResolversServerCertificates for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareEkmConnectionServiceResolversServerCertificatesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewEkmConnectionServiceResolversServerCertificates(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewEkmConnectionServiceResolversServerCertificatesSlice(c *Client, des, nw []EkmConnectionServiceResolversServerCertificates) []EkmConnectionServiceResolversServerCertificates { diff --git a/services/google/cloudkms/beta/crypto_key_internal.go b/services/google/cloudkms/beta/crypto_key_internal.go index a04c8ea53f..6f5ff01fcc 100755 --- a/services/google/cloudkms/beta/crypto_key_internal.go +++ b/services/google/cloudkms/beta/crypto_key_internal.go @@ -671,23 +671,26 @@ func canonicalizeNewCryptoKeyPrimarySet(c *Client, des, nw []CryptoKeyPrimary) [ if des == nil { return nw } - var reorderedNew []CryptoKeyPrimary + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CryptoKeyPrimary for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCryptoKeyPrimaryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCryptoKeyPrimary(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCryptoKeyPrimarySlice(c *Client, des, nw []CryptoKeyPrimary) []CryptoKeyPrimary { @@ -781,23 +784,26 @@ func canonicalizeNewCryptoKeyPrimaryAttestationSet(c *Client, des, nw []CryptoKe if des == nil { return nw } - var reorderedNew []CryptoKeyPrimaryAttestation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CryptoKeyPrimaryAttestation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCryptoKeyPrimaryAttestationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCryptoKeyPrimaryAttestation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCryptoKeyPrimaryAttestationSlice(c *Client, des, nw []CryptoKeyPrimaryAttestation) []CryptoKeyPrimaryAttestation { @@ -912,23 +918,26 @@ func canonicalizeNewCryptoKeyPrimaryAttestationCertChainsSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []CryptoKeyPrimaryAttestationCertChains + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CryptoKeyPrimaryAttestationCertChains for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCryptoKeyPrimaryAttestationCertChainsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCryptoKeyPrimaryAttestationCertChains(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCryptoKeyPrimaryAttestationCertChainsSlice(c *Client, des, nw []CryptoKeyPrimaryAttestationCertChains) []CryptoKeyPrimaryAttestationCertChains { @@ -1027,23 +1036,26 @@ func canonicalizeNewCryptoKeyPrimaryExternalProtectionLevelOptionsSet(c *Client, if des == nil { return nw } - var reorderedNew []CryptoKeyPrimaryExternalProtectionLevelOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CryptoKeyPrimaryExternalProtectionLevelOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCryptoKeyPrimaryExternalProtectionLevelOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCryptoKeyPrimaryExternalProtectionLevelOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCryptoKeyPrimaryExternalProtectionLevelOptionsSlice(c *Client, des, nw []CryptoKeyPrimaryExternalProtectionLevelOptions) []CryptoKeyPrimaryExternalProtectionLevelOptions { @@ -1145,23 +1157,26 @@ func canonicalizeNewCryptoKeyVersionTemplateSet(c *Client, des, nw []CryptoKeyVe if des == nil { return nw } - var reorderedNew []CryptoKeyVersionTemplate + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CryptoKeyVersionTemplate for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCryptoKeyVersionTemplateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCryptoKeyVersionTemplate(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCryptoKeyVersionTemplateSlice(c *Client, des, nw []CryptoKeyVersionTemplate) []CryptoKeyVersionTemplate { diff --git a/services/google/cloudkms/beta/ekm_connection_internal.go b/services/google/cloudkms/beta/ekm_connection_internal.go index a0572e892a..a7b3d08e46 100755 --- a/services/google/cloudkms/beta/ekm_connection_internal.go +++ b/services/google/cloudkms/beta/ekm_connection_internal.go @@ -558,23 +558,26 @@ func canonicalizeNewEkmConnectionServiceResolversSet(c *Client, des, nw []EkmCon if des == nil { return nw } - var reorderedNew []EkmConnectionServiceResolvers + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []EkmConnectionServiceResolvers for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareEkmConnectionServiceResolversNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewEkmConnectionServiceResolvers(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewEkmConnectionServiceResolversSlice(c *Client, des, nw []EkmConnectionServiceResolvers) []EkmConnectionServiceResolvers { @@ -691,23 +694,26 @@ func canonicalizeNewEkmConnectionServiceResolversServerCertificatesSet(c *Client if des == nil { return nw } - var reorderedNew []EkmConnectionServiceResolversServerCertificates + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []EkmConnectionServiceResolversServerCertificates for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareEkmConnectionServiceResolversServerCertificatesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewEkmConnectionServiceResolversServerCertificates(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewEkmConnectionServiceResolversServerCertificatesSlice(c *Client, des, nw []EkmConnectionServiceResolversServerCertificates) []EkmConnectionServiceResolversServerCertificates { diff --git a/services/google/cloudkms/crypto_key_internal.go b/services/google/cloudkms/crypto_key_internal.go index ef92f453ab..76eda134a3 100755 --- a/services/google/cloudkms/crypto_key_internal.go +++ b/services/google/cloudkms/crypto_key_internal.go @@ -671,23 +671,26 @@ func canonicalizeNewCryptoKeyPrimarySet(c *Client, des, nw []CryptoKeyPrimary) [ if des == nil { return nw } - var reorderedNew []CryptoKeyPrimary + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CryptoKeyPrimary for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCryptoKeyPrimaryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCryptoKeyPrimary(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCryptoKeyPrimarySlice(c *Client, des, nw []CryptoKeyPrimary) []CryptoKeyPrimary { @@ -781,23 +784,26 @@ func canonicalizeNewCryptoKeyPrimaryAttestationSet(c *Client, des, nw []CryptoKe if des == nil { return nw } - var reorderedNew []CryptoKeyPrimaryAttestation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CryptoKeyPrimaryAttestation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCryptoKeyPrimaryAttestationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCryptoKeyPrimaryAttestation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCryptoKeyPrimaryAttestationSlice(c *Client, des, nw []CryptoKeyPrimaryAttestation) []CryptoKeyPrimaryAttestation { @@ -912,23 +918,26 @@ func canonicalizeNewCryptoKeyPrimaryAttestationCertChainsSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []CryptoKeyPrimaryAttestationCertChains + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CryptoKeyPrimaryAttestationCertChains for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCryptoKeyPrimaryAttestationCertChainsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCryptoKeyPrimaryAttestationCertChains(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCryptoKeyPrimaryAttestationCertChainsSlice(c *Client, des, nw []CryptoKeyPrimaryAttestationCertChains) []CryptoKeyPrimaryAttestationCertChains { @@ -1027,23 +1036,26 @@ func canonicalizeNewCryptoKeyPrimaryExternalProtectionLevelOptionsSet(c *Client, if des == nil { return nw } - var reorderedNew []CryptoKeyPrimaryExternalProtectionLevelOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CryptoKeyPrimaryExternalProtectionLevelOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCryptoKeyPrimaryExternalProtectionLevelOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCryptoKeyPrimaryExternalProtectionLevelOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCryptoKeyPrimaryExternalProtectionLevelOptionsSlice(c *Client, des, nw []CryptoKeyPrimaryExternalProtectionLevelOptions) []CryptoKeyPrimaryExternalProtectionLevelOptions { @@ -1145,23 +1157,26 @@ func canonicalizeNewCryptoKeyVersionTemplateSet(c *Client, des, nw []CryptoKeyVe if des == nil { return nw } - var reorderedNew []CryptoKeyVersionTemplate + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CryptoKeyVersionTemplate for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCryptoKeyVersionTemplateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCryptoKeyVersionTemplate(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCryptoKeyVersionTemplateSlice(c *Client, des, nw []CryptoKeyVersionTemplate) []CryptoKeyVersionTemplate { diff --git a/services/google/cloudkms/ekm_connection_internal.go b/services/google/cloudkms/ekm_connection_internal.go index 455302f1c5..b4dd1beb2b 100755 --- a/services/google/cloudkms/ekm_connection_internal.go +++ b/services/google/cloudkms/ekm_connection_internal.go @@ -558,23 +558,26 @@ func canonicalizeNewEkmConnectionServiceResolversSet(c *Client, des, nw []EkmCon if des == nil { return nw } - var reorderedNew []EkmConnectionServiceResolvers + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []EkmConnectionServiceResolvers for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareEkmConnectionServiceResolversNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewEkmConnectionServiceResolvers(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewEkmConnectionServiceResolversSlice(c *Client, des, nw []EkmConnectionServiceResolvers) []EkmConnectionServiceResolvers { @@ -691,23 +694,26 @@ func canonicalizeNewEkmConnectionServiceResolversServerCertificatesSet(c *Client if des == nil { return nw } - var reorderedNew []EkmConnectionServiceResolversServerCertificates + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []EkmConnectionServiceResolversServerCertificates for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareEkmConnectionServiceResolversServerCertificatesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewEkmConnectionServiceResolversServerCertificates(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewEkmConnectionServiceResolversServerCertificatesSlice(c *Client, des, nw []EkmConnectionServiceResolversServerCertificates) []EkmConnectionServiceResolversServerCertificates { diff --git a/services/google/cloudscheduler/alpha/job_internal.go b/services/google/cloudscheduler/alpha/job_internal.go index 7f180b8f9e..a962419c6d 100755 --- a/services/google/cloudscheduler/alpha/job_internal.go +++ b/services/google/cloudscheduler/alpha/job_internal.go @@ -794,23 +794,26 @@ func canonicalizeNewJobPubsubTargetSet(c *Client, des, nw []JobPubsubTarget) []J if des == nil { return nw } - var reorderedNew []JobPubsubTarget + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobPubsubTarget for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobPubsubTargetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobPubsubTarget(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobPubsubTargetSlice(c *Client, des, nw []JobPubsubTarget) []JobPubsubTarget { @@ -931,23 +934,26 @@ func canonicalizeNewJobAppEngineHttpTargetSet(c *Client, des, nw []JobAppEngineH if des == nil { return nw } - var reorderedNew []JobAppEngineHttpTarget + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobAppEngineHttpTarget for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobAppEngineHttpTargetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobAppEngineHttpTarget(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobAppEngineHttpTargetSlice(c *Client, des, nw []JobAppEngineHttpTarget) []JobAppEngineHttpTarget { @@ -1065,23 +1071,26 @@ func canonicalizeNewJobAppEngineHttpTargetAppEngineRoutingSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []JobAppEngineHttpTargetAppEngineRouting + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobAppEngineHttpTargetAppEngineRouting for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobAppEngineHttpTargetAppEngineRoutingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobAppEngineHttpTargetAppEngineRouting(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobAppEngineHttpTargetAppEngineRoutingSlice(c *Client, des, nw []JobAppEngineHttpTargetAppEngineRouting) []JobAppEngineHttpTargetAppEngineRouting { @@ -1204,23 +1213,26 @@ func canonicalizeNewJobHttpTargetSet(c *Client, des, nw []JobHttpTarget) []JobHt if des == nil { return nw } - var reorderedNew []JobHttpTarget + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobHttpTarget for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobHttpTargetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobHttpTarget(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobHttpTargetSlice(c *Client, des, nw []JobHttpTarget) []JobHttpTarget { @@ -1325,23 +1337,26 @@ func canonicalizeNewJobHttpTargetOAuthTokenSet(c *Client, des, nw []JobHttpTarge if des == nil { return nw } - var reorderedNew []JobHttpTargetOAuthToken + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobHttpTargetOAuthToken for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobHttpTargetOAuthTokenNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobHttpTargetOAuthToken(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobHttpTargetOAuthTokenSlice(c *Client, des, nw []JobHttpTargetOAuthToken) []JobHttpTargetOAuthToken { @@ -1446,23 +1461,26 @@ func canonicalizeNewJobHttpTargetOidcTokenSet(c *Client, des, nw []JobHttpTarget if des == nil { return nw } - var reorderedNew []JobHttpTargetOidcToken + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobHttpTargetOidcToken for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobHttpTargetOidcTokenNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobHttpTargetOidcToken(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobHttpTargetOidcTokenSlice(c *Client, des, nw []JobHttpTargetOidcToken) []JobHttpTargetOidcToken { @@ -1569,23 +1587,26 @@ func canonicalizeNewJobStatusSet(c *Client, des, nw []JobStatus) []JobStatus { if des == nil { return nw } - var reorderedNew []JobStatus + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobStatus for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobStatusNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobStatus(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobStatusSlice(c *Client, des, nw []JobStatus) []JobStatus { @@ -1692,23 +1713,26 @@ func canonicalizeNewJobStatusDetailsSet(c *Client, des, nw []JobStatusDetails) [ if des == nil { return nw } - var reorderedNew []JobStatusDetails + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobStatusDetails for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobStatusDetailsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobStatusDetails(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobStatusDetailsSlice(c *Client, des, nw []JobStatusDetails) []JobStatusDetails { @@ -1835,23 +1859,26 @@ func canonicalizeNewJobRetryConfigSet(c *Client, des, nw []JobRetryConfig) []Job if des == nil { return nw } - var reorderedNew []JobRetryConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobRetryConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobRetryConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobRetryConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobRetryConfigSlice(c *Client, des, nw []JobRetryConfig) []JobRetryConfig { diff --git a/services/google/cloudscheduler/beta/job_internal.go b/services/google/cloudscheduler/beta/job_internal.go index 36be2b2349..d2e433e192 100755 --- a/services/google/cloudscheduler/beta/job_internal.go +++ b/services/google/cloudscheduler/beta/job_internal.go @@ -794,23 +794,26 @@ func canonicalizeNewJobPubsubTargetSet(c *Client, des, nw []JobPubsubTarget) []J if des == nil { return nw } - var reorderedNew []JobPubsubTarget + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobPubsubTarget for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobPubsubTargetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobPubsubTarget(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobPubsubTargetSlice(c *Client, des, nw []JobPubsubTarget) []JobPubsubTarget { @@ -931,23 +934,26 @@ func canonicalizeNewJobAppEngineHttpTargetSet(c *Client, des, nw []JobAppEngineH if des == nil { return nw } - var reorderedNew []JobAppEngineHttpTarget + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobAppEngineHttpTarget for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobAppEngineHttpTargetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobAppEngineHttpTarget(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobAppEngineHttpTargetSlice(c *Client, des, nw []JobAppEngineHttpTarget) []JobAppEngineHttpTarget { @@ -1065,23 +1071,26 @@ func canonicalizeNewJobAppEngineHttpTargetAppEngineRoutingSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []JobAppEngineHttpTargetAppEngineRouting + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobAppEngineHttpTargetAppEngineRouting for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobAppEngineHttpTargetAppEngineRoutingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobAppEngineHttpTargetAppEngineRouting(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobAppEngineHttpTargetAppEngineRoutingSlice(c *Client, des, nw []JobAppEngineHttpTargetAppEngineRouting) []JobAppEngineHttpTargetAppEngineRouting { @@ -1204,23 +1213,26 @@ func canonicalizeNewJobHttpTargetSet(c *Client, des, nw []JobHttpTarget) []JobHt if des == nil { return nw } - var reorderedNew []JobHttpTarget + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobHttpTarget for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobHttpTargetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobHttpTarget(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobHttpTargetSlice(c *Client, des, nw []JobHttpTarget) []JobHttpTarget { @@ -1325,23 +1337,26 @@ func canonicalizeNewJobHttpTargetOAuthTokenSet(c *Client, des, nw []JobHttpTarge if des == nil { return nw } - var reorderedNew []JobHttpTargetOAuthToken + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobHttpTargetOAuthToken for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobHttpTargetOAuthTokenNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobHttpTargetOAuthToken(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobHttpTargetOAuthTokenSlice(c *Client, des, nw []JobHttpTargetOAuthToken) []JobHttpTargetOAuthToken { @@ -1446,23 +1461,26 @@ func canonicalizeNewJobHttpTargetOidcTokenSet(c *Client, des, nw []JobHttpTarget if des == nil { return nw } - var reorderedNew []JobHttpTargetOidcToken + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobHttpTargetOidcToken for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobHttpTargetOidcTokenNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobHttpTargetOidcToken(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobHttpTargetOidcTokenSlice(c *Client, des, nw []JobHttpTargetOidcToken) []JobHttpTargetOidcToken { @@ -1569,23 +1587,26 @@ func canonicalizeNewJobStatusSet(c *Client, des, nw []JobStatus) []JobStatus { if des == nil { return nw } - var reorderedNew []JobStatus + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobStatus for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobStatusNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobStatus(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobStatusSlice(c *Client, des, nw []JobStatus) []JobStatus { @@ -1692,23 +1713,26 @@ func canonicalizeNewJobStatusDetailsSet(c *Client, des, nw []JobStatusDetails) [ if des == nil { return nw } - var reorderedNew []JobStatusDetails + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobStatusDetails for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobStatusDetailsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobStatusDetails(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobStatusDetailsSlice(c *Client, des, nw []JobStatusDetails) []JobStatusDetails { @@ -1835,23 +1859,26 @@ func canonicalizeNewJobRetryConfigSet(c *Client, des, nw []JobRetryConfig) []Job if des == nil { return nw } - var reorderedNew []JobRetryConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobRetryConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobRetryConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobRetryConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobRetryConfigSlice(c *Client, des, nw []JobRetryConfig) []JobRetryConfig { diff --git a/services/google/cloudscheduler/job_internal.go b/services/google/cloudscheduler/job_internal.go index 3a6128483b..d1c760c219 100755 --- a/services/google/cloudscheduler/job_internal.go +++ b/services/google/cloudscheduler/job_internal.go @@ -794,23 +794,26 @@ func canonicalizeNewJobPubsubTargetSet(c *Client, des, nw []JobPubsubTarget) []J if des == nil { return nw } - var reorderedNew []JobPubsubTarget + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobPubsubTarget for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobPubsubTargetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobPubsubTarget(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobPubsubTargetSlice(c *Client, des, nw []JobPubsubTarget) []JobPubsubTarget { @@ -931,23 +934,26 @@ func canonicalizeNewJobAppEngineHttpTargetSet(c *Client, des, nw []JobAppEngineH if des == nil { return nw } - var reorderedNew []JobAppEngineHttpTarget + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobAppEngineHttpTarget for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobAppEngineHttpTargetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobAppEngineHttpTarget(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobAppEngineHttpTargetSlice(c *Client, des, nw []JobAppEngineHttpTarget) []JobAppEngineHttpTarget { @@ -1065,23 +1071,26 @@ func canonicalizeNewJobAppEngineHttpTargetAppEngineRoutingSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []JobAppEngineHttpTargetAppEngineRouting + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobAppEngineHttpTargetAppEngineRouting for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobAppEngineHttpTargetAppEngineRoutingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobAppEngineHttpTargetAppEngineRouting(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobAppEngineHttpTargetAppEngineRoutingSlice(c *Client, des, nw []JobAppEngineHttpTargetAppEngineRouting) []JobAppEngineHttpTargetAppEngineRouting { @@ -1204,23 +1213,26 @@ func canonicalizeNewJobHttpTargetSet(c *Client, des, nw []JobHttpTarget) []JobHt if des == nil { return nw } - var reorderedNew []JobHttpTarget + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobHttpTarget for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobHttpTargetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobHttpTarget(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobHttpTargetSlice(c *Client, des, nw []JobHttpTarget) []JobHttpTarget { @@ -1325,23 +1337,26 @@ func canonicalizeNewJobHttpTargetOAuthTokenSet(c *Client, des, nw []JobHttpTarge if des == nil { return nw } - var reorderedNew []JobHttpTargetOAuthToken + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobHttpTargetOAuthToken for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobHttpTargetOAuthTokenNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobHttpTargetOAuthToken(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobHttpTargetOAuthTokenSlice(c *Client, des, nw []JobHttpTargetOAuthToken) []JobHttpTargetOAuthToken { @@ -1446,23 +1461,26 @@ func canonicalizeNewJobHttpTargetOidcTokenSet(c *Client, des, nw []JobHttpTarget if des == nil { return nw } - var reorderedNew []JobHttpTargetOidcToken + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobHttpTargetOidcToken for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobHttpTargetOidcTokenNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobHttpTargetOidcToken(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobHttpTargetOidcTokenSlice(c *Client, des, nw []JobHttpTargetOidcToken) []JobHttpTargetOidcToken { @@ -1569,23 +1587,26 @@ func canonicalizeNewJobStatusSet(c *Client, des, nw []JobStatus) []JobStatus { if des == nil { return nw } - var reorderedNew []JobStatus + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobStatus for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobStatusNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobStatus(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobStatusSlice(c *Client, des, nw []JobStatus) []JobStatus { @@ -1692,23 +1713,26 @@ func canonicalizeNewJobStatusDetailsSet(c *Client, des, nw []JobStatusDetails) [ if des == nil { return nw } - var reorderedNew []JobStatusDetails + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobStatusDetails for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobStatusDetailsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobStatusDetails(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobStatusDetailsSlice(c *Client, des, nw []JobStatusDetails) []JobStatusDetails { @@ -1835,23 +1859,26 @@ func canonicalizeNewJobRetryConfigSet(c *Client, des, nw []JobRetryConfig) []Job if des == nil { return nw } - var reorderedNew []JobRetryConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobRetryConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobRetryConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobRetryConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobRetryConfigSlice(c *Client, des, nw []JobRetryConfig) []JobRetryConfig { diff --git a/services/google/compute/alpha/firewall_policy_rule_internal.go b/services/google/compute/alpha/firewall_policy_rule_internal.go index 0ec3cbb4ad..afac54888e 100755 --- a/services/google/compute/alpha/firewall_policy_rule_internal.go +++ b/services/google/compute/alpha/firewall_policy_rule_internal.go @@ -700,23 +700,26 @@ func canonicalizeNewFirewallPolicyRuleMatchSet(c *Client, des, nw []FirewallPoli if des == nil { return nw } - var reorderedNew []FirewallPolicyRuleMatch + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FirewallPolicyRuleMatch for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFirewallPolicyRuleMatchNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFirewallPolicyRuleMatch(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFirewallPolicyRuleMatchSlice(c *Client, des, nw []FirewallPolicyRuleMatch) []FirewallPolicyRuleMatch { @@ -823,23 +826,26 @@ func canonicalizeNewFirewallPolicyRuleMatchLayer4ConfigsSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []FirewallPolicyRuleMatchLayer4Configs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FirewallPolicyRuleMatchLayer4Configs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFirewallPolicyRuleMatchLayer4ConfigsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFirewallPolicyRuleMatchLayer4Configs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFirewallPolicyRuleMatchLayer4ConfigsSlice(c *Client, des, nw []FirewallPolicyRuleMatchLayer4Configs) []FirewallPolicyRuleMatchLayer4Configs { diff --git a/services/google/compute/alpha/forwarding_rule_internal.go b/services/google/compute/alpha/forwarding_rule_internal.go index bfa2aaf977..a23b5843e6 100755 --- a/services/google/compute/alpha/forwarding_rule_internal.go +++ b/services/google/compute/alpha/forwarding_rule_internal.go @@ -1014,23 +1014,26 @@ func canonicalizeNewForwardingRuleMetadataFilterSet(c *Client, des, nw []Forward if des == nil { return nw } - var reorderedNew []ForwardingRuleMetadataFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ForwardingRuleMetadataFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareForwardingRuleMetadataFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewForwardingRuleMetadataFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewForwardingRuleMetadataFilterSlice(c *Client, des, nw []ForwardingRuleMetadataFilter) []ForwardingRuleMetadataFilter { @@ -1137,23 +1140,26 @@ func canonicalizeNewForwardingRuleMetadataFilterFilterLabelSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []ForwardingRuleMetadataFilterFilterLabel + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ForwardingRuleMetadataFilterFilterLabel for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareForwardingRuleMetadataFilterFilterLabelNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewForwardingRuleMetadataFilterFilterLabel(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewForwardingRuleMetadataFilterFilterLabelSlice(c *Client, des, nw []ForwardingRuleMetadataFilterFilterLabel) []ForwardingRuleMetadataFilterFilterLabel { @@ -1260,23 +1266,26 @@ func canonicalizeNewForwardingRuleServiceDirectoryRegistrationsSet(c *Client, de if des == nil { return nw } - var reorderedNew []ForwardingRuleServiceDirectoryRegistrations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ForwardingRuleServiceDirectoryRegistrations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareForwardingRuleServiceDirectoryRegistrationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewForwardingRuleServiceDirectoryRegistrations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewForwardingRuleServiceDirectoryRegistrationsSlice(c *Client, des, nw []ForwardingRuleServiceDirectoryRegistrations) []ForwardingRuleServiceDirectoryRegistrations { diff --git a/services/google/compute/alpha/instance_group_manager_internal.go b/services/google/compute/alpha/instance_group_manager_internal.go index d7dca2618d..617bc50035 100755 --- a/services/google/compute/alpha/instance_group_manager_internal.go +++ b/services/google/compute/alpha/instance_group_manager_internal.go @@ -1117,23 +1117,26 @@ func canonicalizeNewInstanceGroupManagerDistributionPolicySet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []InstanceGroupManagerDistributionPolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerDistributionPolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerDistributionPolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerDistributionPolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerDistributionPolicySlice(c *Client, des, nw []InstanceGroupManagerDistributionPolicy) []InstanceGroupManagerDistributionPolicy { @@ -1232,23 +1235,26 @@ func canonicalizeNewInstanceGroupManagerDistributionPolicyZonesSet(c *Client, de if des == nil { return nw } - var reorderedNew []InstanceGroupManagerDistributionPolicyZones + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerDistributionPolicyZones for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerDistributionPolicyZonesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerDistributionPolicyZones(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerDistributionPolicyZonesSlice(c *Client, des, nw []InstanceGroupManagerDistributionPolicyZones) []InstanceGroupManagerDistributionPolicyZones { @@ -1355,23 +1361,26 @@ func canonicalizeNewInstanceGroupManagerVersionsSet(c *Client, des, nw []Instanc if des == nil { return nw } - var reorderedNew []InstanceGroupManagerVersions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerVersions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerVersionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerVersions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerVersionsSlice(c *Client, des, nw []InstanceGroupManagerVersions) []InstanceGroupManagerVersions { @@ -1473,23 +1482,26 @@ func canonicalizeNewInstanceGroupManagerVersionsTargetSizeSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []InstanceGroupManagerVersionsTargetSize + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerVersionsTargetSize for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerVersionsTargetSizeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerVersionsTargetSize(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerVersionsTargetSizeSlice(c *Client, des, nw []InstanceGroupManagerVersionsTargetSize) []InstanceGroupManagerVersionsTargetSize { @@ -1578,23 +1590,26 @@ func canonicalizeNewInstanceGroupManagerCurrentActionsSet(c *Client, des, nw []I if des == nil { return nw } - var reorderedNew []InstanceGroupManagerCurrentActions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerCurrentActions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerCurrentActionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerCurrentActions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerCurrentActionsSlice(c *Client, des, nw []InstanceGroupManagerCurrentActions) []InstanceGroupManagerCurrentActions { @@ -1692,23 +1707,26 @@ func canonicalizeNewInstanceGroupManagerStatusSet(c *Client, des, nw []InstanceG if des == nil { return nw } - var reorderedNew []InstanceGroupManagerStatus + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerStatus for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerStatusNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerStatus(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerStatusSlice(c *Client, des, nw []InstanceGroupManagerStatus) []InstanceGroupManagerStatus { @@ -1801,23 +1819,26 @@ func canonicalizeNewInstanceGroupManagerStatusVersionTargetSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []InstanceGroupManagerStatusVersionTarget + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerStatusVersionTarget for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerStatusVersionTargetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerStatusVersionTarget(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerStatusVersionTargetSlice(c *Client, des, nw []InstanceGroupManagerStatusVersionTarget) []InstanceGroupManagerStatusVersionTarget { @@ -1914,23 +1935,26 @@ func canonicalizeNewInstanceGroupManagerStatusStatefulSet(c *Client, des, nw []I if des == nil { return nw } - var reorderedNew []InstanceGroupManagerStatusStateful + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerStatusStateful for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerStatusStatefulNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerStatusStateful(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerStatusStatefulSlice(c *Client, des, nw []InstanceGroupManagerStatusStateful) []InstanceGroupManagerStatusStateful { @@ -2029,23 +2053,26 @@ func canonicalizeNewInstanceGroupManagerStatusStatefulPerInstanceConfigsSet(c *C if des == nil { return nw } - var reorderedNew []InstanceGroupManagerStatusStatefulPerInstanceConfigs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerStatusStatefulPerInstanceConfigs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerStatusStatefulPerInstanceConfigsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerStatusStatefulPerInstanceConfigs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerStatusStatefulPerInstanceConfigsSlice(c *Client, des, nw []InstanceGroupManagerStatusStatefulPerInstanceConfigs) []InstanceGroupManagerStatusStatefulPerInstanceConfigs { @@ -2147,23 +2174,26 @@ func canonicalizeNewInstanceGroupManagerAutoHealingPoliciesSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []InstanceGroupManagerAutoHealingPolicies + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerAutoHealingPolicies for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerAutoHealingPoliciesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerAutoHealingPolicies(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerAutoHealingPoliciesSlice(c *Client, des, nw []InstanceGroupManagerAutoHealingPolicies) []InstanceGroupManagerAutoHealingPolicies { @@ -2294,23 +2324,26 @@ func canonicalizeNewInstanceGroupManagerUpdatePolicySet(c *Client, des, nw []Ins if des == nil { return nw } - var reorderedNew []InstanceGroupManagerUpdatePolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerUpdatePolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerUpdatePolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerUpdatePolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerUpdatePolicySlice(c *Client, des, nw []InstanceGroupManagerUpdatePolicy) []InstanceGroupManagerUpdatePolicy { @@ -2412,23 +2445,26 @@ func canonicalizeNewInstanceGroupManagerUpdatePolicyMaxSurgeSet(c *Client, des, if des == nil { return nw } - var reorderedNew []InstanceGroupManagerUpdatePolicyMaxSurge + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerUpdatePolicyMaxSurge for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerUpdatePolicyMaxSurgeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerUpdatePolicyMaxSurge(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerUpdatePolicyMaxSurgeSlice(c *Client, des, nw []InstanceGroupManagerUpdatePolicyMaxSurge) []InstanceGroupManagerUpdatePolicyMaxSurge { @@ -2530,23 +2566,26 @@ func canonicalizeNewInstanceGroupManagerUpdatePolicyMaxUnavailableSet(c *Client, if des == nil { return nw } - var reorderedNew []InstanceGroupManagerUpdatePolicyMaxUnavailable + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerUpdatePolicyMaxUnavailable for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerUpdatePolicyMaxUnavailableNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerUpdatePolicyMaxUnavailable(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerUpdatePolicyMaxUnavailableSlice(c *Client, des, nw []InstanceGroupManagerUpdatePolicyMaxUnavailable) []InstanceGroupManagerUpdatePolicyMaxUnavailable { @@ -2651,23 +2690,26 @@ func canonicalizeNewInstanceGroupManagerNamedPortsSet(c *Client, des, nw []Insta if des == nil { return nw } - var reorderedNew []InstanceGroupManagerNamedPorts + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerNamedPorts for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerNamedPortsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerNamedPorts(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerNamedPortsSlice(c *Client, des, nw []InstanceGroupManagerNamedPorts) []InstanceGroupManagerNamedPorts { @@ -2760,23 +2802,26 @@ func canonicalizeNewInstanceGroupManagerStatefulPolicySet(c *Client, des, nw []I if des == nil { return nw } - var reorderedNew []InstanceGroupManagerStatefulPolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerStatefulPolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerStatefulPolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerStatefulPolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerStatefulPolicySlice(c *Client, des, nw []InstanceGroupManagerStatefulPolicy) []InstanceGroupManagerStatefulPolicy { @@ -2884,23 +2929,26 @@ func canonicalizeNewInstanceGroupManagerStatefulPolicyPreservedStateSet(c *Clien if des == nil { return nw } - var reorderedNew []InstanceGroupManagerStatefulPolicyPreservedState + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerStatefulPolicyPreservedState for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerStatefulPolicyPreservedStateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerStatefulPolicyPreservedState(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerStatefulPolicyPreservedStateSlice(c *Client, des, nw []InstanceGroupManagerStatefulPolicyPreservedState) []InstanceGroupManagerStatefulPolicyPreservedState { @@ -2996,23 +3044,26 @@ func canonicalizeNewInstanceGroupManagerStatefulPolicyPreservedStateDisksSet(c * if des == nil { return nw } - var reorderedNew []InstanceGroupManagerStatefulPolicyPreservedStateDisks + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerStatefulPolicyPreservedStateDisks for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerStatefulPolicyPreservedStateDisksNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerStatefulPolicyPreservedStateDisks(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerStatefulPolicyPreservedStateDisksSlice(c *Client, des, nw []InstanceGroupManagerStatefulPolicyPreservedStateDisks) []InstanceGroupManagerStatefulPolicyPreservedStateDisks { @@ -3108,23 +3159,26 @@ func canonicalizeNewInstanceGroupManagerStatefulPolicyPreservedStateInternalIpsS if des == nil { return nw } - var reorderedNew []InstanceGroupManagerStatefulPolicyPreservedStateInternalIps + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerStatefulPolicyPreservedStateInternalIps for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerStatefulPolicyPreservedStateInternalIpsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerStatefulPolicyPreservedStateInternalIps(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerStatefulPolicyPreservedStateInternalIpsSlice(c *Client, des, nw []InstanceGroupManagerStatefulPolicyPreservedStateInternalIps) []InstanceGroupManagerStatefulPolicyPreservedStateInternalIps { @@ -3220,23 +3274,26 @@ func canonicalizeNewInstanceGroupManagerStatefulPolicyPreservedStateExternalIpsS if des == nil { return nw } - var reorderedNew []InstanceGroupManagerStatefulPolicyPreservedStateExternalIps + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerStatefulPolicyPreservedStateExternalIps for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerStatefulPolicyPreservedStateExternalIpsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerStatefulPolicyPreservedStateExternalIps(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerStatefulPolicyPreservedStateExternalIpsSlice(c *Client, des, nw []InstanceGroupManagerStatefulPolicyPreservedStateExternalIps) []InstanceGroupManagerStatefulPolicyPreservedStateExternalIps { diff --git a/services/google/compute/alpha/instance_internal.go b/services/google/compute/alpha/instance_internal.go index e8b67b47e1..2d74ce01f7 100755 --- a/services/google/compute/alpha/instance_internal.go +++ b/services/google/compute/alpha/instance_internal.go @@ -1564,23 +1564,26 @@ func canonicalizeNewInstanceDisksSet(c *Client, des, nw []InstanceDisks) []Insta if des == nil { return nw } - var reorderedNew []InstanceDisks + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceDisks for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceDisksNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceDisks(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceDisksSlice(c *Client, des, nw []InstanceDisks) []InstanceDisks { @@ -1690,23 +1693,26 @@ func canonicalizeNewInstanceDisksDiskEncryptionKeySet(c *Client, des, nw []Insta if des == nil { return nw } - var reorderedNew []InstanceDisksDiskEncryptionKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceDisksDiskEncryptionKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceDisksDiskEncryptionKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceDisksDiskEncryptionKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceDisksDiskEncryptionKeySlice(c *Client, des, nw []InstanceDisksDiskEncryptionKey) []InstanceDisksDiskEncryptionKey { @@ -1827,23 +1833,26 @@ func canonicalizeNewInstanceDisksInitializeParamsSet(c *Client, des, nw []Instan if des == nil { return nw } - var reorderedNew []InstanceDisksInitializeParams + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceDisksInitializeParams for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceDisksInitializeParamsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceDisksInitializeParams(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceDisksInitializeParamsSlice(c *Client, des, nw []InstanceDisksInitializeParams) []InstanceDisksInitializeParams { @@ -1945,23 +1954,26 @@ func canonicalizeNewInstanceDisksInitializeParamsSourceImageEncryptionKeySet(c * if des == nil { return nw } - var reorderedNew []InstanceDisksInitializeParamsSourceImageEncryptionKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceDisksInitializeParamsSourceImageEncryptionKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceDisksInitializeParamsSourceImageEncryptionKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceDisksInitializeParamsSourceImageEncryptionKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceDisksInitializeParamsSourceImageEncryptionKeySlice(c *Client, des, nw []InstanceDisksInitializeParamsSourceImageEncryptionKey) []InstanceDisksInitializeParamsSourceImageEncryptionKey { @@ -2066,23 +2078,26 @@ func canonicalizeNewInstanceGuestAcceleratorsSet(c *Client, des, nw []InstanceGu if des == nil { return nw } - var reorderedNew []InstanceGuestAccelerators + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGuestAccelerators for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGuestAcceleratorsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGuestAccelerators(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGuestAcceleratorsSlice(c *Client, des, nw []InstanceGuestAccelerators) []InstanceGuestAccelerators { @@ -2202,23 +2217,26 @@ func canonicalizeNewInstanceNetworkInterfacesSet(c *Client, des, nw []InstanceNe if des == nil { return nw } - var reorderedNew []InstanceNetworkInterfaces + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceNetworkInterfaces for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceNetworkInterfacesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceNetworkInterfaces(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceNetworkInterfacesSlice(c *Client, des, nw []InstanceNetworkInterfaces) []InstanceNetworkInterfaces { @@ -2357,23 +2375,26 @@ func canonicalizeNewInstanceNetworkInterfacesAccessConfigsSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []InstanceNetworkInterfacesAccessConfigs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceNetworkInterfacesAccessConfigs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceNetworkInterfacesAccessConfigsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceNetworkInterfacesAccessConfigs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceNetworkInterfacesAccessConfigsSlice(c *Client, des, nw []InstanceNetworkInterfacesAccessConfigs) []InstanceNetworkInterfacesAccessConfigs { @@ -2512,23 +2533,26 @@ func canonicalizeNewInstanceNetworkInterfacesIPv6AccessConfigsSet(c *Client, des if des == nil { return nw } - var reorderedNew []InstanceNetworkInterfacesIPv6AccessConfigs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceNetworkInterfacesIPv6AccessConfigs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceNetworkInterfacesIPv6AccessConfigsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceNetworkInterfacesIPv6AccessConfigs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceNetworkInterfacesIPv6AccessConfigsSlice(c *Client, des, nw []InstanceNetworkInterfacesIPv6AccessConfigs) []InstanceNetworkInterfacesIPv6AccessConfigs { @@ -2635,23 +2659,26 @@ func canonicalizeNewInstanceNetworkInterfacesAliasIPRangesSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []InstanceNetworkInterfacesAliasIPRanges + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceNetworkInterfacesAliasIPRanges for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceNetworkInterfacesAliasIPRangesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceNetworkInterfacesAliasIPRanges(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceNetworkInterfacesAliasIPRangesSlice(c *Client, des, nw []InstanceNetworkInterfacesAliasIPRanges) []InstanceNetworkInterfacesAliasIPRanges { @@ -2766,23 +2793,26 @@ func canonicalizeNewInstanceSchedulingSet(c *Client, des, nw []InstanceSchedulin if des == nil { return nw } - var reorderedNew []InstanceScheduling + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceScheduling for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceSchedulingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceScheduling(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceSchedulingSlice(c *Client, des, nw []InstanceScheduling) []InstanceScheduling { @@ -2889,23 +2919,26 @@ func canonicalizeNewInstanceServiceAccountsSet(c *Client, des, nw []InstanceServ if des == nil { return nw } - var reorderedNew []InstanceServiceAccounts + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceServiceAccounts for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceServiceAccountsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceServiceAccounts(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceServiceAccountsSlice(c *Client, des, nw []InstanceServiceAccounts) []InstanceServiceAccounts { @@ -3020,23 +3053,26 @@ func canonicalizeNewInstanceShieldedInstanceConfigSet(c *Client, des, nw []Insta if des == nil { return nw } - var reorderedNew []InstanceShieldedInstanceConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceShieldedInstanceConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceShieldedInstanceConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceShieldedInstanceConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceShieldedInstanceConfigSlice(c *Client, des, nw []InstanceShieldedInstanceConfig) []InstanceShieldedInstanceConfig { diff --git a/services/google/compute/alpha/interconnect_attachment_internal.go b/services/google/compute/alpha/interconnect_attachment_internal.go index c209f5a882..28478e56e1 100755 --- a/services/google/compute/alpha/interconnect_attachment_internal.go +++ b/services/google/compute/alpha/interconnect_attachment_internal.go @@ -847,23 +847,26 @@ func canonicalizeNewInterconnectAttachmentPrivateInterconnectInfoSet(c *Client, if des == nil { return nw } - var reorderedNew []InterconnectAttachmentPrivateInterconnectInfo + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InterconnectAttachmentPrivateInterconnectInfo for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInterconnectAttachmentPrivateInterconnectInfoNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInterconnectAttachmentPrivateInterconnectInfo(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInterconnectAttachmentPrivateInterconnectInfoSlice(c *Client, des, nw []InterconnectAttachmentPrivateInterconnectInfo) []InterconnectAttachmentPrivateInterconnectInfo { @@ -978,23 +981,26 @@ func canonicalizeNewInterconnectAttachmentPartnerMetadataSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []InterconnectAttachmentPartnerMetadata + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InterconnectAttachmentPartnerMetadata for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInterconnectAttachmentPartnerMetadataNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInterconnectAttachmentPartnerMetadata(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInterconnectAttachmentPartnerMetadataSlice(c *Client, des, nw []InterconnectAttachmentPartnerMetadata) []InterconnectAttachmentPartnerMetadata { diff --git a/services/google/compute/alpha/network_firewall_policy_rule_internal.go b/services/google/compute/alpha/network_firewall_policy_rule_internal.go index 4468557f0a..711a3307c5 100755 --- a/services/google/compute/alpha/network_firewall_policy_rule_internal.go +++ b/services/google/compute/alpha/network_firewall_policy_rule_internal.go @@ -764,23 +764,26 @@ func canonicalizeNewNetworkFirewallPolicyRuleMatchSet(c *Client, des, nw []Netwo if des == nil { return nw } - var reorderedNew []NetworkFirewallPolicyRuleMatch + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NetworkFirewallPolicyRuleMatch for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNetworkFirewallPolicyRuleMatchNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNetworkFirewallPolicyRuleMatch(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNetworkFirewallPolicyRuleMatchSlice(c *Client, des, nw []NetworkFirewallPolicyRuleMatch) []NetworkFirewallPolicyRuleMatch { @@ -887,23 +890,26 @@ func canonicalizeNewNetworkFirewallPolicyRuleMatchLayer4ConfigsSet(c *Client, de if des == nil { return nw } - var reorderedNew []NetworkFirewallPolicyRuleMatchLayer4Configs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NetworkFirewallPolicyRuleMatchLayer4Configs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNetworkFirewallPolicyRuleMatchLayer4ConfigsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNetworkFirewallPolicyRuleMatchLayer4Configs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNetworkFirewallPolicyRuleMatchLayer4ConfigsSlice(c *Client, des, nw []NetworkFirewallPolicyRuleMatchLayer4Configs) []NetworkFirewallPolicyRuleMatchLayer4Configs { @@ -999,23 +1005,26 @@ func canonicalizeNewNetworkFirewallPolicyRuleMatchSrcSecureTagsSet(c *Client, de if des == nil { return nw } - var reorderedNew []NetworkFirewallPolicyRuleMatchSrcSecureTags + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NetworkFirewallPolicyRuleMatchSrcSecureTags for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNetworkFirewallPolicyRuleMatchSrcSecureTagsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNetworkFirewallPolicyRuleMatchSrcSecureTags(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNetworkFirewallPolicyRuleMatchSrcSecureTagsSlice(c *Client, des, nw []NetworkFirewallPolicyRuleMatchSrcSecureTags) []NetworkFirewallPolicyRuleMatchSrcSecureTags { @@ -1111,23 +1120,26 @@ func canonicalizeNewNetworkFirewallPolicyRuleTargetSecureTagsSet(c *Client, des, if des == nil { return nw } - var reorderedNew []NetworkFirewallPolicyRuleTargetSecureTags + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NetworkFirewallPolicyRuleTargetSecureTags for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNetworkFirewallPolicyRuleTargetSecureTagsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNetworkFirewallPolicyRuleTargetSecureTags(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNetworkFirewallPolicyRuleTargetSecureTagsSlice(c *Client, des, nw []NetworkFirewallPolicyRuleTargetSecureTags) []NetworkFirewallPolicyRuleTargetSecureTags { diff --git a/services/google/compute/alpha/network_internal.go b/services/google/compute/alpha/network_internal.go index e7f4f933f7..efb72eed47 100755 --- a/services/google/compute/alpha/network_internal.go +++ b/services/google/compute/alpha/network_internal.go @@ -571,23 +571,26 @@ func canonicalizeNewNetworkRoutingConfigSet(c *Client, des, nw []NetworkRoutingC if des == nil { return nw } - var reorderedNew []NetworkRoutingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NetworkRoutingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNetworkRoutingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNetworkRoutingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNetworkRoutingConfigSlice(c *Client, des, nw []NetworkRoutingConfig) []NetworkRoutingConfig { diff --git a/services/google/compute/alpha/packet_mirroring_internal.go b/services/google/compute/alpha/packet_mirroring_internal.go index 0f40fdcd5a..f10ae47d70 100755 --- a/services/google/compute/alpha/packet_mirroring_internal.go +++ b/services/google/compute/alpha/packet_mirroring_internal.go @@ -702,23 +702,26 @@ func canonicalizeNewPacketMirroringNetworkSet(c *Client, des, nw []PacketMirrori if des == nil { return nw } - var reorderedNew []PacketMirroringNetwork + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PacketMirroringNetwork for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePacketMirroringNetworkNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPacketMirroringNetwork(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPacketMirroringNetworkSlice(c *Client, des, nw []PacketMirroringNetwork) []PacketMirroringNetwork { @@ -818,23 +821,26 @@ func canonicalizeNewPacketMirroringCollectorIlbSet(c *Client, des, nw []PacketMi if des == nil { return nw } - var reorderedNew []PacketMirroringCollectorIlb + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PacketMirroringCollectorIlb for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePacketMirroringCollectorIlbNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPacketMirroringCollectorIlb(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPacketMirroringCollectorIlbSlice(c *Client, des, nw []PacketMirroringCollectorIlb) []PacketMirroringCollectorIlb { @@ -937,23 +943,26 @@ func canonicalizeNewPacketMirroringMirroredResourcesSet(c *Client, des, nw []Pac if des == nil { return nw } - var reorderedNew []PacketMirroringMirroredResources + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PacketMirroringMirroredResources for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePacketMirroringMirroredResourcesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPacketMirroringMirroredResources(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPacketMirroringMirroredResourcesSlice(c *Client, des, nw []PacketMirroringMirroredResources) []PacketMirroringMirroredResources { @@ -1053,23 +1062,26 @@ func canonicalizeNewPacketMirroringMirroredResourcesSubnetworksSet(c *Client, de if des == nil { return nw } - var reorderedNew []PacketMirroringMirroredResourcesSubnetworks + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PacketMirroringMirroredResourcesSubnetworks for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePacketMirroringMirroredResourcesSubnetworksNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPacketMirroringMirroredResourcesSubnetworks(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPacketMirroringMirroredResourcesSubnetworksSlice(c *Client, des, nw []PacketMirroringMirroredResourcesSubnetworks) []PacketMirroringMirroredResourcesSubnetworks { @@ -1169,23 +1181,26 @@ func canonicalizeNewPacketMirroringMirroredResourcesInstancesSet(c *Client, des, if des == nil { return nw } - var reorderedNew []PacketMirroringMirroredResourcesInstances + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PacketMirroringMirroredResourcesInstances for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePacketMirroringMirroredResourcesInstancesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPacketMirroringMirroredResourcesInstances(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPacketMirroringMirroredResourcesInstancesSlice(c *Client, des, nw []PacketMirroringMirroredResourcesInstances) []PacketMirroringMirroredResourcesInstances { @@ -1298,23 +1313,26 @@ func canonicalizeNewPacketMirroringFilterSet(c *Client, des, nw []PacketMirrorin if des == nil { return nw } - var reorderedNew []PacketMirroringFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PacketMirroringFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePacketMirroringFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPacketMirroringFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPacketMirroringFilterSlice(c *Client, des, nw []PacketMirroringFilter) []PacketMirroringFilter { diff --git a/services/google/compute/alpha/route_internal.go b/services/google/compute/alpha/route_internal.go index 07009212cf..ce37ac2ee4 100755 --- a/services/google/compute/alpha/route_internal.go +++ b/services/google/compute/alpha/route_internal.go @@ -705,23 +705,26 @@ func canonicalizeNewRouteWarningSet(c *Client, des, nw []RouteWarning) []RouteWa if des == nil { return nw } - var reorderedNew []RouteWarning + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []RouteWarning for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareRouteWarningNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewRouteWarning(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewRouteWarningSlice(c *Client, des, nw []RouteWarning) []RouteWarning { diff --git a/services/google/compute/alpha/service_attachment_internal.go b/services/google/compute/alpha/service_attachment_internal.go index fb1d03e6d6..3283f3ad46 100755 --- a/services/google/compute/alpha/service_attachment_internal.go +++ b/services/google/compute/alpha/service_attachment_internal.go @@ -735,23 +735,26 @@ func canonicalizeNewServiceAttachmentConnectedEndpointsSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []ServiceAttachmentConnectedEndpoints + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceAttachmentConnectedEndpoints for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceAttachmentConnectedEndpointsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceAttachmentConnectedEndpoints(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceAttachmentConnectedEndpointsSlice(c *Client, des, nw []ServiceAttachmentConnectedEndpoints) []ServiceAttachmentConnectedEndpoints { @@ -853,23 +856,26 @@ func canonicalizeNewServiceAttachmentConsumerAcceptListsSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []ServiceAttachmentConsumerAcceptLists + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceAttachmentConsumerAcceptLists for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceAttachmentConsumerAcceptListsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceAttachmentConsumerAcceptLists(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceAttachmentConsumerAcceptListsSlice(c *Client, des, nw []ServiceAttachmentConsumerAcceptLists) []ServiceAttachmentConsumerAcceptLists { @@ -958,23 +964,26 @@ func canonicalizeNewServiceAttachmentPscServiceAttachmentIdSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []ServiceAttachmentPscServiceAttachmentId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceAttachmentPscServiceAttachmentId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceAttachmentPscServiceAttachmentIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceAttachmentPscServiceAttachmentId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceAttachmentPscServiceAttachmentIdSlice(c *Client, des, nw []ServiceAttachmentPscServiceAttachmentId) []ServiceAttachmentPscServiceAttachmentId { diff --git a/services/google/compute/alpha/subnetwork_internal.go b/services/google/compute/alpha/subnetwork_internal.go index 3b56df97e2..642500bcfc 100755 --- a/services/google/compute/alpha/subnetwork_internal.go +++ b/services/google/compute/alpha/subnetwork_internal.go @@ -831,23 +831,26 @@ func canonicalizeNewSubnetworkSecondaryIPRangesSet(c *Client, des, nw []Subnetwo if des == nil { return nw } - var reorderedNew []SubnetworkSecondaryIPRanges + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []SubnetworkSecondaryIPRanges for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareSubnetworkSecondaryIPRangesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewSubnetworkSecondaryIPRanges(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewSubnetworkSecondaryIPRangesSlice(c *Client, des, nw []SubnetworkSecondaryIPRanges) []SubnetworkSecondaryIPRanges { @@ -979,23 +982,26 @@ func canonicalizeNewSubnetworkLogConfigSet(c *Client, des, nw []SubnetworkLogCon if des == nil { return nw } - var reorderedNew []SubnetworkLogConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []SubnetworkLogConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareSubnetworkLogConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewSubnetworkLogConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewSubnetworkLogConfigSlice(c *Client, des, nw []SubnetworkLogConfig) []SubnetworkLogConfig { diff --git a/services/google/compute/beta/firewall_policy_rule_internal.go b/services/google/compute/beta/firewall_policy_rule_internal.go index b7fee72f2f..8fe5e1b50a 100755 --- a/services/google/compute/beta/firewall_policy_rule_internal.go +++ b/services/google/compute/beta/firewall_policy_rule_internal.go @@ -700,23 +700,26 @@ func canonicalizeNewFirewallPolicyRuleMatchSet(c *Client, des, nw []FirewallPoli if des == nil { return nw } - var reorderedNew []FirewallPolicyRuleMatch + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FirewallPolicyRuleMatch for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFirewallPolicyRuleMatchNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFirewallPolicyRuleMatch(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFirewallPolicyRuleMatchSlice(c *Client, des, nw []FirewallPolicyRuleMatch) []FirewallPolicyRuleMatch { @@ -823,23 +826,26 @@ func canonicalizeNewFirewallPolicyRuleMatchLayer4ConfigsSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []FirewallPolicyRuleMatchLayer4Configs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FirewallPolicyRuleMatchLayer4Configs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFirewallPolicyRuleMatchLayer4ConfigsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFirewallPolicyRuleMatchLayer4Configs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFirewallPolicyRuleMatchLayer4ConfigsSlice(c *Client, des, nw []FirewallPolicyRuleMatchLayer4Configs) []FirewallPolicyRuleMatchLayer4Configs { diff --git a/services/google/compute/beta/forwarding_rule_internal.go b/services/google/compute/beta/forwarding_rule_internal.go index 179e7ac11f..e110576d29 100755 --- a/services/google/compute/beta/forwarding_rule_internal.go +++ b/services/google/compute/beta/forwarding_rule_internal.go @@ -1014,23 +1014,26 @@ func canonicalizeNewForwardingRuleMetadataFilterSet(c *Client, des, nw []Forward if des == nil { return nw } - var reorderedNew []ForwardingRuleMetadataFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ForwardingRuleMetadataFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareForwardingRuleMetadataFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewForwardingRuleMetadataFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewForwardingRuleMetadataFilterSlice(c *Client, des, nw []ForwardingRuleMetadataFilter) []ForwardingRuleMetadataFilter { @@ -1137,23 +1140,26 @@ func canonicalizeNewForwardingRuleMetadataFilterFilterLabelSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []ForwardingRuleMetadataFilterFilterLabel + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ForwardingRuleMetadataFilterFilterLabel for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareForwardingRuleMetadataFilterFilterLabelNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewForwardingRuleMetadataFilterFilterLabel(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewForwardingRuleMetadataFilterFilterLabelSlice(c *Client, des, nw []ForwardingRuleMetadataFilterFilterLabel) []ForwardingRuleMetadataFilterFilterLabel { @@ -1260,23 +1266,26 @@ func canonicalizeNewForwardingRuleServiceDirectoryRegistrationsSet(c *Client, de if des == nil { return nw } - var reorderedNew []ForwardingRuleServiceDirectoryRegistrations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ForwardingRuleServiceDirectoryRegistrations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareForwardingRuleServiceDirectoryRegistrationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewForwardingRuleServiceDirectoryRegistrations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewForwardingRuleServiceDirectoryRegistrationsSlice(c *Client, des, nw []ForwardingRuleServiceDirectoryRegistrations) []ForwardingRuleServiceDirectoryRegistrations { diff --git a/services/google/compute/beta/instance_group_manager_internal.go b/services/google/compute/beta/instance_group_manager_internal.go index a2fd9dae00..3e7253b3fc 100755 --- a/services/google/compute/beta/instance_group_manager_internal.go +++ b/services/google/compute/beta/instance_group_manager_internal.go @@ -1117,23 +1117,26 @@ func canonicalizeNewInstanceGroupManagerDistributionPolicySet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []InstanceGroupManagerDistributionPolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerDistributionPolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerDistributionPolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerDistributionPolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerDistributionPolicySlice(c *Client, des, nw []InstanceGroupManagerDistributionPolicy) []InstanceGroupManagerDistributionPolicy { @@ -1232,23 +1235,26 @@ func canonicalizeNewInstanceGroupManagerDistributionPolicyZonesSet(c *Client, de if des == nil { return nw } - var reorderedNew []InstanceGroupManagerDistributionPolicyZones + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerDistributionPolicyZones for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerDistributionPolicyZonesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerDistributionPolicyZones(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerDistributionPolicyZonesSlice(c *Client, des, nw []InstanceGroupManagerDistributionPolicyZones) []InstanceGroupManagerDistributionPolicyZones { @@ -1355,23 +1361,26 @@ func canonicalizeNewInstanceGroupManagerVersionsSet(c *Client, des, nw []Instanc if des == nil { return nw } - var reorderedNew []InstanceGroupManagerVersions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerVersions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerVersionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerVersions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerVersionsSlice(c *Client, des, nw []InstanceGroupManagerVersions) []InstanceGroupManagerVersions { @@ -1473,23 +1482,26 @@ func canonicalizeNewInstanceGroupManagerVersionsTargetSizeSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []InstanceGroupManagerVersionsTargetSize + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerVersionsTargetSize for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerVersionsTargetSizeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerVersionsTargetSize(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerVersionsTargetSizeSlice(c *Client, des, nw []InstanceGroupManagerVersionsTargetSize) []InstanceGroupManagerVersionsTargetSize { @@ -1578,23 +1590,26 @@ func canonicalizeNewInstanceGroupManagerCurrentActionsSet(c *Client, des, nw []I if des == nil { return nw } - var reorderedNew []InstanceGroupManagerCurrentActions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerCurrentActions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerCurrentActionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerCurrentActions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerCurrentActionsSlice(c *Client, des, nw []InstanceGroupManagerCurrentActions) []InstanceGroupManagerCurrentActions { @@ -1692,23 +1707,26 @@ func canonicalizeNewInstanceGroupManagerStatusSet(c *Client, des, nw []InstanceG if des == nil { return nw } - var reorderedNew []InstanceGroupManagerStatus + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerStatus for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerStatusNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerStatus(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerStatusSlice(c *Client, des, nw []InstanceGroupManagerStatus) []InstanceGroupManagerStatus { @@ -1801,23 +1819,26 @@ func canonicalizeNewInstanceGroupManagerStatusVersionTargetSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []InstanceGroupManagerStatusVersionTarget + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerStatusVersionTarget for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerStatusVersionTargetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerStatusVersionTarget(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerStatusVersionTargetSlice(c *Client, des, nw []InstanceGroupManagerStatusVersionTarget) []InstanceGroupManagerStatusVersionTarget { @@ -1914,23 +1935,26 @@ func canonicalizeNewInstanceGroupManagerStatusStatefulSet(c *Client, des, nw []I if des == nil { return nw } - var reorderedNew []InstanceGroupManagerStatusStateful + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerStatusStateful for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerStatusStatefulNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerStatusStateful(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerStatusStatefulSlice(c *Client, des, nw []InstanceGroupManagerStatusStateful) []InstanceGroupManagerStatusStateful { @@ -2029,23 +2053,26 @@ func canonicalizeNewInstanceGroupManagerStatusStatefulPerInstanceConfigsSet(c *C if des == nil { return nw } - var reorderedNew []InstanceGroupManagerStatusStatefulPerInstanceConfigs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerStatusStatefulPerInstanceConfigs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerStatusStatefulPerInstanceConfigsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerStatusStatefulPerInstanceConfigs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerStatusStatefulPerInstanceConfigsSlice(c *Client, des, nw []InstanceGroupManagerStatusStatefulPerInstanceConfigs) []InstanceGroupManagerStatusStatefulPerInstanceConfigs { @@ -2147,23 +2174,26 @@ func canonicalizeNewInstanceGroupManagerAutoHealingPoliciesSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []InstanceGroupManagerAutoHealingPolicies + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerAutoHealingPolicies for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerAutoHealingPoliciesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerAutoHealingPolicies(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerAutoHealingPoliciesSlice(c *Client, des, nw []InstanceGroupManagerAutoHealingPolicies) []InstanceGroupManagerAutoHealingPolicies { @@ -2294,23 +2324,26 @@ func canonicalizeNewInstanceGroupManagerUpdatePolicySet(c *Client, des, nw []Ins if des == nil { return nw } - var reorderedNew []InstanceGroupManagerUpdatePolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerUpdatePolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerUpdatePolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerUpdatePolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerUpdatePolicySlice(c *Client, des, nw []InstanceGroupManagerUpdatePolicy) []InstanceGroupManagerUpdatePolicy { @@ -2412,23 +2445,26 @@ func canonicalizeNewInstanceGroupManagerUpdatePolicyMaxSurgeSet(c *Client, des, if des == nil { return nw } - var reorderedNew []InstanceGroupManagerUpdatePolicyMaxSurge + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerUpdatePolicyMaxSurge for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerUpdatePolicyMaxSurgeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerUpdatePolicyMaxSurge(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerUpdatePolicyMaxSurgeSlice(c *Client, des, nw []InstanceGroupManagerUpdatePolicyMaxSurge) []InstanceGroupManagerUpdatePolicyMaxSurge { @@ -2530,23 +2566,26 @@ func canonicalizeNewInstanceGroupManagerUpdatePolicyMaxUnavailableSet(c *Client, if des == nil { return nw } - var reorderedNew []InstanceGroupManagerUpdatePolicyMaxUnavailable + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerUpdatePolicyMaxUnavailable for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerUpdatePolicyMaxUnavailableNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerUpdatePolicyMaxUnavailable(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerUpdatePolicyMaxUnavailableSlice(c *Client, des, nw []InstanceGroupManagerUpdatePolicyMaxUnavailable) []InstanceGroupManagerUpdatePolicyMaxUnavailable { @@ -2651,23 +2690,26 @@ func canonicalizeNewInstanceGroupManagerNamedPortsSet(c *Client, des, nw []Insta if des == nil { return nw } - var reorderedNew []InstanceGroupManagerNamedPorts + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerNamedPorts for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerNamedPortsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerNamedPorts(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerNamedPortsSlice(c *Client, des, nw []InstanceGroupManagerNamedPorts) []InstanceGroupManagerNamedPorts { @@ -2760,23 +2802,26 @@ func canonicalizeNewInstanceGroupManagerStatefulPolicySet(c *Client, des, nw []I if des == nil { return nw } - var reorderedNew []InstanceGroupManagerStatefulPolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerStatefulPolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerStatefulPolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerStatefulPolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerStatefulPolicySlice(c *Client, des, nw []InstanceGroupManagerStatefulPolicy) []InstanceGroupManagerStatefulPolicy { @@ -2884,23 +2929,26 @@ func canonicalizeNewInstanceGroupManagerStatefulPolicyPreservedStateSet(c *Clien if des == nil { return nw } - var reorderedNew []InstanceGroupManagerStatefulPolicyPreservedState + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerStatefulPolicyPreservedState for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerStatefulPolicyPreservedStateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerStatefulPolicyPreservedState(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerStatefulPolicyPreservedStateSlice(c *Client, des, nw []InstanceGroupManagerStatefulPolicyPreservedState) []InstanceGroupManagerStatefulPolicyPreservedState { @@ -2996,23 +3044,26 @@ func canonicalizeNewInstanceGroupManagerStatefulPolicyPreservedStateDisksSet(c * if des == nil { return nw } - var reorderedNew []InstanceGroupManagerStatefulPolicyPreservedStateDisks + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerStatefulPolicyPreservedStateDisks for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerStatefulPolicyPreservedStateDisksNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerStatefulPolicyPreservedStateDisks(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerStatefulPolicyPreservedStateDisksSlice(c *Client, des, nw []InstanceGroupManagerStatefulPolicyPreservedStateDisks) []InstanceGroupManagerStatefulPolicyPreservedStateDisks { @@ -3108,23 +3159,26 @@ func canonicalizeNewInstanceGroupManagerStatefulPolicyPreservedStateInternalIpsS if des == nil { return nw } - var reorderedNew []InstanceGroupManagerStatefulPolicyPreservedStateInternalIps + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerStatefulPolicyPreservedStateInternalIps for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerStatefulPolicyPreservedStateInternalIpsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerStatefulPolicyPreservedStateInternalIps(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerStatefulPolicyPreservedStateInternalIpsSlice(c *Client, des, nw []InstanceGroupManagerStatefulPolicyPreservedStateInternalIps) []InstanceGroupManagerStatefulPolicyPreservedStateInternalIps { @@ -3220,23 +3274,26 @@ func canonicalizeNewInstanceGroupManagerStatefulPolicyPreservedStateExternalIpsS if des == nil { return nw } - var reorderedNew []InstanceGroupManagerStatefulPolicyPreservedStateExternalIps + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerStatefulPolicyPreservedStateExternalIps for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerStatefulPolicyPreservedStateExternalIpsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerStatefulPolicyPreservedStateExternalIps(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerStatefulPolicyPreservedStateExternalIpsSlice(c *Client, des, nw []InstanceGroupManagerStatefulPolicyPreservedStateExternalIps) []InstanceGroupManagerStatefulPolicyPreservedStateExternalIps { diff --git a/services/google/compute/beta/instance_internal.go b/services/google/compute/beta/instance_internal.go index 93f07e850e..0a20dc3ed3 100755 --- a/services/google/compute/beta/instance_internal.go +++ b/services/google/compute/beta/instance_internal.go @@ -1564,23 +1564,26 @@ func canonicalizeNewInstanceDisksSet(c *Client, des, nw []InstanceDisks) []Insta if des == nil { return nw } - var reorderedNew []InstanceDisks + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceDisks for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceDisksNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceDisks(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceDisksSlice(c *Client, des, nw []InstanceDisks) []InstanceDisks { @@ -1690,23 +1693,26 @@ func canonicalizeNewInstanceDisksDiskEncryptionKeySet(c *Client, des, nw []Insta if des == nil { return nw } - var reorderedNew []InstanceDisksDiskEncryptionKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceDisksDiskEncryptionKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceDisksDiskEncryptionKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceDisksDiskEncryptionKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceDisksDiskEncryptionKeySlice(c *Client, des, nw []InstanceDisksDiskEncryptionKey) []InstanceDisksDiskEncryptionKey { @@ -1827,23 +1833,26 @@ func canonicalizeNewInstanceDisksInitializeParamsSet(c *Client, des, nw []Instan if des == nil { return nw } - var reorderedNew []InstanceDisksInitializeParams + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceDisksInitializeParams for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceDisksInitializeParamsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceDisksInitializeParams(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceDisksInitializeParamsSlice(c *Client, des, nw []InstanceDisksInitializeParams) []InstanceDisksInitializeParams { @@ -1945,23 +1954,26 @@ func canonicalizeNewInstanceDisksInitializeParamsSourceImageEncryptionKeySet(c * if des == nil { return nw } - var reorderedNew []InstanceDisksInitializeParamsSourceImageEncryptionKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceDisksInitializeParamsSourceImageEncryptionKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceDisksInitializeParamsSourceImageEncryptionKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceDisksInitializeParamsSourceImageEncryptionKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceDisksInitializeParamsSourceImageEncryptionKeySlice(c *Client, des, nw []InstanceDisksInitializeParamsSourceImageEncryptionKey) []InstanceDisksInitializeParamsSourceImageEncryptionKey { @@ -2066,23 +2078,26 @@ func canonicalizeNewInstanceGuestAcceleratorsSet(c *Client, des, nw []InstanceGu if des == nil { return nw } - var reorderedNew []InstanceGuestAccelerators + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGuestAccelerators for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGuestAcceleratorsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGuestAccelerators(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGuestAcceleratorsSlice(c *Client, des, nw []InstanceGuestAccelerators) []InstanceGuestAccelerators { @@ -2202,23 +2217,26 @@ func canonicalizeNewInstanceNetworkInterfacesSet(c *Client, des, nw []InstanceNe if des == nil { return nw } - var reorderedNew []InstanceNetworkInterfaces + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceNetworkInterfaces for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceNetworkInterfacesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceNetworkInterfaces(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceNetworkInterfacesSlice(c *Client, des, nw []InstanceNetworkInterfaces) []InstanceNetworkInterfaces { @@ -2357,23 +2375,26 @@ func canonicalizeNewInstanceNetworkInterfacesAccessConfigsSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []InstanceNetworkInterfacesAccessConfigs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceNetworkInterfacesAccessConfigs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceNetworkInterfacesAccessConfigsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceNetworkInterfacesAccessConfigs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceNetworkInterfacesAccessConfigsSlice(c *Client, des, nw []InstanceNetworkInterfacesAccessConfigs) []InstanceNetworkInterfacesAccessConfigs { @@ -2512,23 +2533,26 @@ func canonicalizeNewInstanceNetworkInterfacesIPv6AccessConfigsSet(c *Client, des if des == nil { return nw } - var reorderedNew []InstanceNetworkInterfacesIPv6AccessConfigs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceNetworkInterfacesIPv6AccessConfigs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceNetworkInterfacesIPv6AccessConfigsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceNetworkInterfacesIPv6AccessConfigs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceNetworkInterfacesIPv6AccessConfigsSlice(c *Client, des, nw []InstanceNetworkInterfacesIPv6AccessConfigs) []InstanceNetworkInterfacesIPv6AccessConfigs { @@ -2635,23 +2659,26 @@ func canonicalizeNewInstanceNetworkInterfacesAliasIPRangesSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []InstanceNetworkInterfacesAliasIPRanges + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceNetworkInterfacesAliasIPRanges for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceNetworkInterfacesAliasIPRangesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceNetworkInterfacesAliasIPRanges(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceNetworkInterfacesAliasIPRangesSlice(c *Client, des, nw []InstanceNetworkInterfacesAliasIPRanges) []InstanceNetworkInterfacesAliasIPRanges { @@ -2766,23 +2793,26 @@ func canonicalizeNewInstanceSchedulingSet(c *Client, des, nw []InstanceSchedulin if des == nil { return nw } - var reorderedNew []InstanceScheduling + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceScheduling for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceSchedulingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceScheduling(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceSchedulingSlice(c *Client, des, nw []InstanceScheduling) []InstanceScheduling { @@ -2889,23 +2919,26 @@ func canonicalizeNewInstanceServiceAccountsSet(c *Client, des, nw []InstanceServ if des == nil { return nw } - var reorderedNew []InstanceServiceAccounts + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceServiceAccounts for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceServiceAccountsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceServiceAccounts(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceServiceAccountsSlice(c *Client, des, nw []InstanceServiceAccounts) []InstanceServiceAccounts { @@ -3020,23 +3053,26 @@ func canonicalizeNewInstanceShieldedInstanceConfigSet(c *Client, des, nw []Insta if des == nil { return nw } - var reorderedNew []InstanceShieldedInstanceConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceShieldedInstanceConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceShieldedInstanceConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceShieldedInstanceConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceShieldedInstanceConfigSlice(c *Client, des, nw []InstanceShieldedInstanceConfig) []InstanceShieldedInstanceConfig { diff --git a/services/google/compute/beta/interconnect_attachment_internal.go b/services/google/compute/beta/interconnect_attachment_internal.go index 0ff0199710..05bb63387f 100755 --- a/services/google/compute/beta/interconnect_attachment_internal.go +++ b/services/google/compute/beta/interconnect_attachment_internal.go @@ -847,23 +847,26 @@ func canonicalizeNewInterconnectAttachmentPrivateInterconnectInfoSet(c *Client, if des == nil { return nw } - var reorderedNew []InterconnectAttachmentPrivateInterconnectInfo + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InterconnectAttachmentPrivateInterconnectInfo for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInterconnectAttachmentPrivateInterconnectInfoNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInterconnectAttachmentPrivateInterconnectInfo(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInterconnectAttachmentPrivateInterconnectInfoSlice(c *Client, des, nw []InterconnectAttachmentPrivateInterconnectInfo) []InterconnectAttachmentPrivateInterconnectInfo { @@ -978,23 +981,26 @@ func canonicalizeNewInterconnectAttachmentPartnerMetadataSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []InterconnectAttachmentPartnerMetadata + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InterconnectAttachmentPartnerMetadata for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInterconnectAttachmentPartnerMetadataNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInterconnectAttachmentPartnerMetadata(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInterconnectAttachmentPartnerMetadataSlice(c *Client, des, nw []InterconnectAttachmentPartnerMetadata) []InterconnectAttachmentPartnerMetadata { diff --git a/services/google/compute/beta/network_firewall_policy_rule_internal.go b/services/google/compute/beta/network_firewall_policy_rule_internal.go index a647371bc1..5b53c4e100 100755 --- a/services/google/compute/beta/network_firewall_policy_rule_internal.go +++ b/services/google/compute/beta/network_firewall_policy_rule_internal.go @@ -764,23 +764,26 @@ func canonicalizeNewNetworkFirewallPolicyRuleMatchSet(c *Client, des, nw []Netwo if des == nil { return nw } - var reorderedNew []NetworkFirewallPolicyRuleMatch + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NetworkFirewallPolicyRuleMatch for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNetworkFirewallPolicyRuleMatchNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNetworkFirewallPolicyRuleMatch(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNetworkFirewallPolicyRuleMatchSlice(c *Client, des, nw []NetworkFirewallPolicyRuleMatch) []NetworkFirewallPolicyRuleMatch { @@ -887,23 +890,26 @@ func canonicalizeNewNetworkFirewallPolicyRuleMatchLayer4ConfigsSet(c *Client, de if des == nil { return nw } - var reorderedNew []NetworkFirewallPolicyRuleMatchLayer4Configs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NetworkFirewallPolicyRuleMatchLayer4Configs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNetworkFirewallPolicyRuleMatchLayer4ConfigsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNetworkFirewallPolicyRuleMatchLayer4Configs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNetworkFirewallPolicyRuleMatchLayer4ConfigsSlice(c *Client, des, nw []NetworkFirewallPolicyRuleMatchLayer4Configs) []NetworkFirewallPolicyRuleMatchLayer4Configs { @@ -999,23 +1005,26 @@ func canonicalizeNewNetworkFirewallPolicyRuleMatchSrcSecureTagsSet(c *Client, de if des == nil { return nw } - var reorderedNew []NetworkFirewallPolicyRuleMatchSrcSecureTags + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NetworkFirewallPolicyRuleMatchSrcSecureTags for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNetworkFirewallPolicyRuleMatchSrcSecureTagsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNetworkFirewallPolicyRuleMatchSrcSecureTags(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNetworkFirewallPolicyRuleMatchSrcSecureTagsSlice(c *Client, des, nw []NetworkFirewallPolicyRuleMatchSrcSecureTags) []NetworkFirewallPolicyRuleMatchSrcSecureTags { @@ -1111,23 +1120,26 @@ func canonicalizeNewNetworkFirewallPolicyRuleTargetSecureTagsSet(c *Client, des, if des == nil { return nw } - var reorderedNew []NetworkFirewallPolicyRuleTargetSecureTags + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NetworkFirewallPolicyRuleTargetSecureTags for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNetworkFirewallPolicyRuleTargetSecureTagsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNetworkFirewallPolicyRuleTargetSecureTags(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNetworkFirewallPolicyRuleTargetSecureTagsSlice(c *Client, des, nw []NetworkFirewallPolicyRuleTargetSecureTags) []NetworkFirewallPolicyRuleTargetSecureTags { diff --git a/services/google/compute/beta/network_internal.go b/services/google/compute/beta/network_internal.go index cad2432de4..5c1d35bbdc 100755 --- a/services/google/compute/beta/network_internal.go +++ b/services/google/compute/beta/network_internal.go @@ -571,23 +571,26 @@ func canonicalizeNewNetworkRoutingConfigSet(c *Client, des, nw []NetworkRoutingC if des == nil { return nw } - var reorderedNew []NetworkRoutingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NetworkRoutingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNetworkRoutingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNetworkRoutingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNetworkRoutingConfigSlice(c *Client, des, nw []NetworkRoutingConfig) []NetworkRoutingConfig { diff --git a/services/google/compute/beta/packet_mirroring_internal.go b/services/google/compute/beta/packet_mirroring_internal.go index 697eaa6129..b89d85294e 100755 --- a/services/google/compute/beta/packet_mirroring_internal.go +++ b/services/google/compute/beta/packet_mirroring_internal.go @@ -702,23 +702,26 @@ func canonicalizeNewPacketMirroringNetworkSet(c *Client, des, nw []PacketMirrori if des == nil { return nw } - var reorderedNew []PacketMirroringNetwork + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PacketMirroringNetwork for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePacketMirroringNetworkNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPacketMirroringNetwork(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPacketMirroringNetworkSlice(c *Client, des, nw []PacketMirroringNetwork) []PacketMirroringNetwork { @@ -818,23 +821,26 @@ func canonicalizeNewPacketMirroringCollectorIlbSet(c *Client, des, nw []PacketMi if des == nil { return nw } - var reorderedNew []PacketMirroringCollectorIlb + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PacketMirroringCollectorIlb for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePacketMirroringCollectorIlbNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPacketMirroringCollectorIlb(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPacketMirroringCollectorIlbSlice(c *Client, des, nw []PacketMirroringCollectorIlb) []PacketMirroringCollectorIlb { @@ -937,23 +943,26 @@ func canonicalizeNewPacketMirroringMirroredResourcesSet(c *Client, des, nw []Pac if des == nil { return nw } - var reorderedNew []PacketMirroringMirroredResources + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PacketMirroringMirroredResources for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePacketMirroringMirroredResourcesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPacketMirroringMirroredResources(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPacketMirroringMirroredResourcesSlice(c *Client, des, nw []PacketMirroringMirroredResources) []PacketMirroringMirroredResources { @@ -1053,23 +1062,26 @@ func canonicalizeNewPacketMirroringMirroredResourcesSubnetworksSet(c *Client, de if des == nil { return nw } - var reorderedNew []PacketMirroringMirroredResourcesSubnetworks + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PacketMirroringMirroredResourcesSubnetworks for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePacketMirroringMirroredResourcesSubnetworksNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPacketMirroringMirroredResourcesSubnetworks(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPacketMirroringMirroredResourcesSubnetworksSlice(c *Client, des, nw []PacketMirroringMirroredResourcesSubnetworks) []PacketMirroringMirroredResourcesSubnetworks { @@ -1169,23 +1181,26 @@ func canonicalizeNewPacketMirroringMirroredResourcesInstancesSet(c *Client, des, if des == nil { return nw } - var reorderedNew []PacketMirroringMirroredResourcesInstances + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PacketMirroringMirroredResourcesInstances for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePacketMirroringMirroredResourcesInstancesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPacketMirroringMirroredResourcesInstances(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPacketMirroringMirroredResourcesInstancesSlice(c *Client, des, nw []PacketMirroringMirroredResourcesInstances) []PacketMirroringMirroredResourcesInstances { @@ -1298,23 +1313,26 @@ func canonicalizeNewPacketMirroringFilterSet(c *Client, des, nw []PacketMirrorin if des == nil { return nw } - var reorderedNew []PacketMirroringFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PacketMirroringFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePacketMirroringFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPacketMirroringFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPacketMirroringFilterSlice(c *Client, des, nw []PacketMirroringFilter) []PacketMirroringFilter { diff --git a/services/google/compute/beta/route_internal.go b/services/google/compute/beta/route_internal.go index ada8f36cc4..2cb8dad986 100755 --- a/services/google/compute/beta/route_internal.go +++ b/services/google/compute/beta/route_internal.go @@ -705,23 +705,26 @@ func canonicalizeNewRouteWarningSet(c *Client, des, nw []RouteWarning) []RouteWa if des == nil { return nw } - var reorderedNew []RouteWarning + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []RouteWarning for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareRouteWarningNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewRouteWarning(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewRouteWarningSlice(c *Client, des, nw []RouteWarning) []RouteWarning { diff --git a/services/google/compute/beta/service_attachment_internal.go b/services/google/compute/beta/service_attachment_internal.go index baa06730a7..7a63691a4e 100755 --- a/services/google/compute/beta/service_attachment_internal.go +++ b/services/google/compute/beta/service_attachment_internal.go @@ -735,23 +735,26 @@ func canonicalizeNewServiceAttachmentConnectedEndpointsSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []ServiceAttachmentConnectedEndpoints + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceAttachmentConnectedEndpoints for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceAttachmentConnectedEndpointsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceAttachmentConnectedEndpoints(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceAttachmentConnectedEndpointsSlice(c *Client, des, nw []ServiceAttachmentConnectedEndpoints) []ServiceAttachmentConnectedEndpoints { @@ -853,23 +856,26 @@ func canonicalizeNewServiceAttachmentConsumerAcceptListsSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []ServiceAttachmentConsumerAcceptLists + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceAttachmentConsumerAcceptLists for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceAttachmentConsumerAcceptListsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceAttachmentConsumerAcceptLists(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceAttachmentConsumerAcceptListsSlice(c *Client, des, nw []ServiceAttachmentConsumerAcceptLists) []ServiceAttachmentConsumerAcceptLists { @@ -958,23 +964,26 @@ func canonicalizeNewServiceAttachmentPscServiceAttachmentIdSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []ServiceAttachmentPscServiceAttachmentId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceAttachmentPscServiceAttachmentId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceAttachmentPscServiceAttachmentIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceAttachmentPscServiceAttachmentId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceAttachmentPscServiceAttachmentIdSlice(c *Client, des, nw []ServiceAttachmentPscServiceAttachmentId) []ServiceAttachmentPscServiceAttachmentId { diff --git a/services/google/compute/beta/subnetwork_internal.go b/services/google/compute/beta/subnetwork_internal.go index 2e0d439d45..dcf3c6ba26 100755 --- a/services/google/compute/beta/subnetwork_internal.go +++ b/services/google/compute/beta/subnetwork_internal.go @@ -831,23 +831,26 @@ func canonicalizeNewSubnetworkSecondaryIPRangesSet(c *Client, des, nw []Subnetwo if des == nil { return nw } - var reorderedNew []SubnetworkSecondaryIPRanges + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []SubnetworkSecondaryIPRanges for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareSubnetworkSecondaryIPRangesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewSubnetworkSecondaryIPRanges(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewSubnetworkSecondaryIPRangesSlice(c *Client, des, nw []SubnetworkSecondaryIPRanges) []SubnetworkSecondaryIPRanges { @@ -979,23 +982,26 @@ func canonicalizeNewSubnetworkLogConfigSet(c *Client, des, nw []SubnetworkLogCon if des == nil { return nw } - var reorderedNew []SubnetworkLogConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []SubnetworkLogConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareSubnetworkLogConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewSubnetworkLogConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewSubnetworkLogConfigSlice(c *Client, des, nw []SubnetworkLogConfig) []SubnetworkLogConfig { diff --git a/services/google/compute/firewall_policy_rule_internal.go b/services/google/compute/firewall_policy_rule_internal.go index 30abfae833..c0e0753e65 100755 --- a/services/google/compute/firewall_policy_rule_internal.go +++ b/services/google/compute/firewall_policy_rule_internal.go @@ -700,23 +700,26 @@ func canonicalizeNewFirewallPolicyRuleMatchSet(c *Client, des, nw []FirewallPoli if des == nil { return nw } - var reorderedNew []FirewallPolicyRuleMatch + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FirewallPolicyRuleMatch for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFirewallPolicyRuleMatchNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFirewallPolicyRuleMatch(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFirewallPolicyRuleMatchSlice(c *Client, des, nw []FirewallPolicyRuleMatch) []FirewallPolicyRuleMatch { @@ -823,23 +826,26 @@ func canonicalizeNewFirewallPolicyRuleMatchLayer4ConfigsSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []FirewallPolicyRuleMatchLayer4Configs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FirewallPolicyRuleMatchLayer4Configs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFirewallPolicyRuleMatchLayer4ConfigsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFirewallPolicyRuleMatchLayer4Configs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFirewallPolicyRuleMatchLayer4ConfigsSlice(c *Client, des, nw []FirewallPolicyRuleMatchLayer4Configs) []FirewallPolicyRuleMatchLayer4Configs { diff --git a/services/google/compute/forwarding_rule_internal.go b/services/google/compute/forwarding_rule_internal.go index b12b766db2..8f8a10c3d4 100755 --- a/services/google/compute/forwarding_rule_internal.go +++ b/services/google/compute/forwarding_rule_internal.go @@ -1014,23 +1014,26 @@ func canonicalizeNewForwardingRuleMetadataFilterSet(c *Client, des, nw []Forward if des == nil { return nw } - var reorderedNew []ForwardingRuleMetadataFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ForwardingRuleMetadataFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareForwardingRuleMetadataFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewForwardingRuleMetadataFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewForwardingRuleMetadataFilterSlice(c *Client, des, nw []ForwardingRuleMetadataFilter) []ForwardingRuleMetadataFilter { @@ -1137,23 +1140,26 @@ func canonicalizeNewForwardingRuleMetadataFilterFilterLabelSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []ForwardingRuleMetadataFilterFilterLabel + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ForwardingRuleMetadataFilterFilterLabel for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareForwardingRuleMetadataFilterFilterLabelNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewForwardingRuleMetadataFilterFilterLabel(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewForwardingRuleMetadataFilterFilterLabelSlice(c *Client, des, nw []ForwardingRuleMetadataFilterFilterLabel) []ForwardingRuleMetadataFilterFilterLabel { @@ -1260,23 +1266,26 @@ func canonicalizeNewForwardingRuleServiceDirectoryRegistrationsSet(c *Client, de if des == nil { return nw } - var reorderedNew []ForwardingRuleServiceDirectoryRegistrations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ForwardingRuleServiceDirectoryRegistrations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareForwardingRuleServiceDirectoryRegistrationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewForwardingRuleServiceDirectoryRegistrations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewForwardingRuleServiceDirectoryRegistrationsSlice(c *Client, des, nw []ForwardingRuleServiceDirectoryRegistrations) []ForwardingRuleServiceDirectoryRegistrations { diff --git a/services/google/compute/instance_group_manager_internal.go b/services/google/compute/instance_group_manager_internal.go index 1347fa1b71..5130886ec2 100755 --- a/services/google/compute/instance_group_manager_internal.go +++ b/services/google/compute/instance_group_manager_internal.go @@ -1083,23 +1083,26 @@ func canonicalizeNewInstanceGroupManagerDistributionPolicySet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []InstanceGroupManagerDistributionPolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerDistributionPolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerDistributionPolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerDistributionPolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerDistributionPolicySlice(c *Client, des, nw []InstanceGroupManagerDistributionPolicy) []InstanceGroupManagerDistributionPolicy { @@ -1198,23 +1201,26 @@ func canonicalizeNewInstanceGroupManagerDistributionPolicyZonesSet(c *Client, de if des == nil { return nw } - var reorderedNew []InstanceGroupManagerDistributionPolicyZones + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerDistributionPolicyZones for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerDistributionPolicyZonesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerDistributionPolicyZones(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerDistributionPolicyZonesSlice(c *Client, des, nw []InstanceGroupManagerDistributionPolicyZones) []InstanceGroupManagerDistributionPolicyZones { @@ -1321,23 +1327,26 @@ func canonicalizeNewInstanceGroupManagerVersionsSet(c *Client, des, nw []Instanc if des == nil { return nw } - var reorderedNew []InstanceGroupManagerVersions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerVersions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerVersionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerVersions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerVersionsSlice(c *Client, des, nw []InstanceGroupManagerVersions) []InstanceGroupManagerVersions { @@ -1439,23 +1448,26 @@ func canonicalizeNewInstanceGroupManagerVersionsTargetSizeSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []InstanceGroupManagerVersionsTargetSize + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerVersionsTargetSize for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerVersionsTargetSizeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerVersionsTargetSize(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerVersionsTargetSizeSlice(c *Client, des, nw []InstanceGroupManagerVersionsTargetSize) []InstanceGroupManagerVersionsTargetSize { @@ -1544,23 +1556,26 @@ func canonicalizeNewInstanceGroupManagerCurrentActionsSet(c *Client, des, nw []I if des == nil { return nw } - var reorderedNew []InstanceGroupManagerCurrentActions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerCurrentActions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerCurrentActionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerCurrentActions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerCurrentActionsSlice(c *Client, des, nw []InstanceGroupManagerCurrentActions) []InstanceGroupManagerCurrentActions { @@ -1658,23 +1673,26 @@ func canonicalizeNewInstanceGroupManagerStatusSet(c *Client, des, nw []InstanceG if des == nil { return nw } - var reorderedNew []InstanceGroupManagerStatus + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerStatus for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerStatusNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerStatus(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerStatusSlice(c *Client, des, nw []InstanceGroupManagerStatus) []InstanceGroupManagerStatus { @@ -1767,23 +1785,26 @@ func canonicalizeNewInstanceGroupManagerStatusVersionTargetSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []InstanceGroupManagerStatusVersionTarget + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerStatusVersionTarget for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerStatusVersionTargetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerStatusVersionTarget(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerStatusVersionTargetSlice(c *Client, des, nw []InstanceGroupManagerStatusVersionTarget) []InstanceGroupManagerStatusVersionTarget { @@ -1877,23 +1898,26 @@ func canonicalizeNewInstanceGroupManagerStatusStatefulSet(c *Client, des, nw []I if des == nil { return nw } - var reorderedNew []InstanceGroupManagerStatusStateful + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerStatusStateful for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerStatusStatefulNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerStatusStateful(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerStatusStatefulSlice(c *Client, des, nw []InstanceGroupManagerStatusStateful) []InstanceGroupManagerStatusStateful { @@ -1992,23 +2016,26 @@ func canonicalizeNewInstanceGroupManagerStatusStatefulPerInstanceConfigsSet(c *C if des == nil { return nw } - var reorderedNew []InstanceGroupManagerStatusStatefulPerInstanceConfigs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerStatusStatefulPerInstanceConfigs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerStatusStatefulPerInstanceConfigsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerStatusStatefulPerInstanceConfigs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerStatusStatefulPerInstanceConfigsSlice(c *Client, des, nw []InstanceGroupManagerStatusStatefulPerInstanceConfigs) []InstanceGroupManagerStatusStatefulPerInstanceConfigs { @@ -2110,23 +2137,26 @@ func canonicalizeNewInstanceGroupManagerAutoHealingPoliciesSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []InstanceGroupManagerAutoHealingPolicies + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerAutoHealingPolicies for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerAutoHealingPoliciesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerAutoHealingPolicies(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerAutoHealingPoliciesSlice(c *Client, des, nw []InstanceGroupManagerAutoHealingPolicies) []InstanceGroupManagerAutoHealingPolicies { @@ -2245,23 +2275,26 @@ func canonicalizeNewInstanceGroupManagerUpdatePolicySet(c *Client, des, nw []Ins if des == nil { return nw } - var reorderedNew []InstanceGroupManagerUpdatePolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerUpdatePolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerUpdatePolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerUpdatePolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerUpdatePolicySlice(c *Client, des, nw []InstanceGroupManagerUpdatePolicy) []InstanceGroupManagerUpdatePolicy { @@ -2363,23 +2396,26 @@ func canonicalizeNewInstanceGroupManagerUpdatePolicyMaxSurgeSet(c *Client, des, if des == nil { return nw } - var reorderedNew []InstanceGroupManagerUpdatePolicyMaxSurge + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerUpdatePolicyMaxSurge for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerUpdatePolicyMaxSurgeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerUpdatePolicyMaxSurge(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerUpdatePolicyMaxSurgeSlice(c *Client, des, nw []InstanceGroupManagerUpdatePolicyMaxSurge) []InstanceGroupManagerUpdatePolicyMaxSurge { @@ -2481,23 +2517,26 @@ func canonicalizeNewInstanceGroupManagerUpdatePolicyMaxUnavailableSet(c *Client, if des == nil { return nw } - var reorderedNew []InstanceGroupManagerUpdatePolicyMaxUnavailable + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerUpdatePolicyMaxUnavailable for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerUpdatePolicyMaxUnavailableNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerUpdatePolicyMaxUnavailable(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerUpdatePolicyMaxUnavailableSlice(c *Client, des, nw []InstanceGroupManagerUpdatePolicyMaxUnavailable) []InstanceGroupManagerUpdatePolicyMaxUnavailable { @@ -2602,23 +2641,26 @@ func canonicalizeNewInstanceGroupManagerNamedPortsSet(c *Client, des, nw []Insta if des == nil { return nw } - var reorderedNew []InstanceGroupManagerNamedPorts + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerNamedPorts for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerNamedPortsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerNamedPorts(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerNamedPortsSlice(c *Client, des, nw []InstanceGroupManagerNamedPorts) []InstanceGroupManagerNamedPorts { @@ -2711,23 +2753,26 @@ func canonicalizeNewInstanceGroupManagerStatefulPolicySet(c *Client, des, nw []I if des == nil { return nw } - var reorderedNew []InstanceGroupManagerStatefulPolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerStatefulPolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerStatefulPolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerStatefulPolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerStatefulPolicySlice(c *Client, des, nw []InstanceGroupManagerStatefulPolicy) []InstanceGroupManagerStatefulPolicy { @@ -2823,23 +2868,26 @@ func canonicalizeNewInstanceGroupManagerStatefulPolicyPreservedStateSet(c *Clien if des == nil { return nw } - var reorderedNew []InstanceGroupManagerStatefulPolicyPreservedState + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerStatefulPolicyPreservedState for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerStatefulPolicyPreservedStateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerStatefulPolicyPreservedState(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerStatefulPolicyPreservedStateSlice(c *Client, des, nw []InstanceGroupManagerStatefulPolicyPreservedState) []InstanceGroupManagerStatefulPolicyPreservedState { @@ -2935,23 +2983,26 @@ func canonicalizeNewInstanceGroupManagerStatefulPolicyPreservedStateDisksSet(c * if des == nil { return nw } - var reorderedNew []InstanceGroupManagerStatefulPolicyPreservedStateDisks + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGroupManagerStatefulPolicyPreservedStateDisks for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGroupManagerStatefulPolicyPreservedStateDisksNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGroupManagerStatefulPolicyPreservedStateDisks(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGroupManagerStatefulPolicyPreservedStateDisksSlice(c *Client, des, nw []InstanceGroupManagerStatefulPolicyPreservedStateDisks) []InstanceGroupManagerStatefulPolicyPreservedStateDisks { diff --git a/services/google/compute/instance_internal.go b/services/google/compute/instance_internal.go index 8636d60b1d..72510a0ec4 100755 --- a/services/google/compute/instance_internal.go +++ b/services/google/compute/instance_internal.go @@ -1564,23 +1564,26 @@ func canonicalizeNewInstanceDisksSet(c *Client, des, nw []InstanceDisks) []Insta if des == nil { return nw } - var reorderedNew []InstanceDisks + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceDisks for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceDisksNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceDisks(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceDisksSlice(c *Client, des, nw []InstanceDisks) []InstanceDisks { @@ -1690,23 +1693,26 @@ func canonicalizeNewInstanceDisksDiskEncryptionKeySet(c *Client, des, nw []Insta if des == nil { return nw } - var reorderedNew []InstanceDisksDiskEncryptionKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceDisksDiskEncryptionKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceDisksDiskEncryptionKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceDisksDiskEncryptionKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceDisksDiskEncryptionKeySlice(c *Client, des, nw []InstanceDisksDiskEncryptionKey) []InstanceDisksDiskEncryptionKey { @@ -1827,23 +1833,26 @@ func canonicalizeNewInstanceDisksInitializeParamsSet(c *Client, des, nw []Instan if des == nil { return nw } - var reorderedNew []InstanceDisksInitializeParams + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceDisksInitializeParams for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceDisksInitializeParamsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceDisksInitializeParams(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceDisksInitializeParamsSlice(c *Client, des, nw []InstanceDisksInitializeParams) []InstanceDisksInitializeParams { @@ -1945,23 +1954,26 @@ func canonicalizeNewInstanceDisksInitializeParamsSourceImageEncryptionKeySet(c * if des == nil { return nw } - var reorderedNew []InstanceDisksInitializeParamsSourceImageEncryptionKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceDisksInitializeParamsSourceImageEncryptionKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceDisksInitializeParamsSourceImageEncryptionKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceDisksInitializeParamsSourceImageEncryptionKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceDisksInitializeParamsSourceImageEncryptionKeySlice(c *Client, des, nw []InstanceDisksInitializeParamsSourceImageEncryptionKey) []InstanceDisksInitializeParamsSourceImageEncryptionKey { @@ -2066,23 +2078,26 @@ func canonicalizeNewInstanceGuestAcceleratorsSet(c *Client, des, nw []InstanceGu if des == nil { return nw } - var reorderedNew []InstanceGuestAccelerators + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceGuestAccelerators for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceGuestAcceleratorsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceGuestAccelerators(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceGuestAcceleratorsSlice(c *Client, des, nw []InstanceGuestAccelerators) []InstanceGuestAccelerators { @@ -2202,23 +2217,26 @@ func canonicalizeNewInstanceNetworkInterfacesSet(c *Client, des, nw []InstanceNe if des == nil { return nw } - var reorderedNew []InstanceNetworkInterfaces + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceNetworkInterfaces for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceNetworkInterfacesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceNetworkInterfaces(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceNetworkInterfacesSlice(c *Client, des, nw []InstanceNetworkInterfaces) []InstanceNetworkInterfaces { @@ -2357,23 +2375,26 @@ func canonicalizeNewInstanceNetworkInterfacesAccessConfigsSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []InstanceNetworkInterfacesAccessConfigs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceNetworkInterfacesAccessConfigs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceNetworkInterfacesAccessConfigsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceNetworkInterfacesAccessConfigs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceNetworkInterfacesAccessConfigsSlice(c *Client, des, nw []InstanceNetworkInterfacesAccessConfigs) []InstanceNetworkInterfacesAccessConfigs { @@ -2512,23 +2533,26 @@ func canonicalizeNewInstanceNetworkInterfacesIPv6AccessConfigsSet(c *Client, des if des == nil { return nw } - var reorderedNew []InstanceNetworkInterfacesIPv6AccessConfigs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceNetworkInterfacesIPv6AccessConfigs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceNetworkInterfacesIPv6AccessConfigsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceNetworkInterfacesIPv6AccessConfigs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceNetworkInterfacesIPv6AccessConfigsSlice(c *Client, des, nw []InstanceNetworkInterfacesIPv6AccessConfigs) []InstanceNetworkInterfacesIPv6AccessConfigs { @@ -2635,23 +2659,26 @@ func canonicalizeNewInstanceNetworkInterfacesAliasIPRangesSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []InstanceNetworkInterfacesAliasIPRanges + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceNetworkInterfacesAliasIPRanges for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceNetworkInterfacesAliasIPRangesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceNetworkInterfacesAliasIPRanges(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceNetworkInterfacesAliasIPRangesSlice(c *Client, des, nw []InstanceNetworkInterfacesAliasIPRanges) []InstanceNetworkInterfacesAliasIPRanges { @@ -2766,23 +2793,26 @@ func canonicalizeNewInstanceSchedulingSet(c *Client, des, nw []InstanceSchedulin if des == nil { return nw } - var reorderedNew []InstanceScheduling + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceScheduling for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceSchedulingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceScheduling(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceSchedulingSlice(c *Client, des, nw []InstanceScheduling) []InstanceScheduling { @@ -2889,23 +2919,26 @@ func canonicalizeNewInstanceServiceAccountsSet(c *Client, des, nw []InstanceServ if des == nil { return nw } - var reorderedNew []InstanceServiceAccounts + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceServiceAccounts for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceServiceAccountsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceServiceAccounts(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceServiceAccountsSlice(c *Client, des, nw []InstanceServiceAccounts) []InstanceServiceAccounts { @@ -3020,23 +3053,26 @@ func canonicalizeNewInstanceShieldedInstanceConfigSet(c *Client, des, nw []Insta if des == nil { return nw } - var reorderedNew []InstanceShieldedInstanceConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceShieldedInstanceConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceShieldedInstanceConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceShieldedInstanceConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceShieldedInstanceConfigSlice(c *Client, des, nw []InstanceShieldedInstanceConfig) []InstanceShieldedInstanceConfig { diff --git a/services/google/compute/interconnect_attachment_internal.go b/services/google/compute/interconnect_attachment_internal.go index de75817fdf..01fdb9f755 100755 --- a/services/google/compute/interconnect_attachment_internal.go +++ b/services/google/compute/interconnect_attachment_internal.go @@ -817,23 +817,26 @@ func canonicalizeNewInterconnectAttachmentPrivateInterconnectInfoSet(c *Client, if des == nil { return nw } - var reorderedNew []InterconnectAttachmentPrivateInterconnectInfo + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InterconnectAttachmentPrivateInterconnectInfo for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInterconnectAttachmentPrivateInterconnectInfoNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInterconnectAttachmentPrivateInterconnectInfo(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInterconnectAttachmentPrivateInterconnectInfoSlice(c *Client, des, nw []InterconnectAttachmentPrivateInterconnectInfo) []InterconnectAttachmentPrivateInterconnectInfo { @@ -948,23 +951,26 @@ func canonicalizeNewInterconnectAttachmentPartnerMetadataSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []InterconnectAttachmentPartnerMetadata + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InterconnectAttachmentPartnerMetadata for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInterconnectAttachmentPartnerMetadataNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInterconnectAttachmentPartnerMetadata(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInterconnectAttachmentPartnerMetadataSlice(c *Client, des, nw []InterconnectAttachmentPartnerMetadata) []InterconnectAttachmentPartnerMetadata { diff --git a/services/google/compute/network_firewall_policy_rule_internal.go b/services/google/compute/network_firewall_policy_rule_internal.go index b42e63685b..0a7a03c37b 100755 --- a/services/google/compute/network_firewall_policy_rule_internal.go +++ b/services/google/compute/network_firewall_policy_rule_internal.go @@ -764,23 +764,26 @@ func canonicalizeNewNetworkFirewallPolicyRuleMatchSet(c *Client, des, nw []Netwo if des == nil { return nw } - var reorderedNew []NetworkFirewallPolicyRuleMatch + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NetworkFirewallPolicyRuleMatch for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNetworkFirewallPolicyRuleMatchNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNetworkFirewallPolicyRuleMatch(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNetworkFirewallPolicyRuleMatchSlice(c *Client, des, nw []NetworkFirewallPolicyRuleMatch) []NetworkFirewallPolicyRuleMatch { @@ -887,23 +890,26 @@ func canonicalizeNewNetworkFirewallPolicyRuleMatchLayer4ConfigsSet(c *Client, de if des == nil { return nw } - var reorderedNew []NetworkFirewallPolicyRuleMatchLayer4Configs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NetworkFirewallPolicyRuleMatchLayer4Configs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNetworkFirewallPolicyRuleMatchLayer4ConfigsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNetworkFirewallPolicyRuleMatchLayer4Configs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNetworkFirewallPolicyRuleMatchLayer4ConfigsSlice(c *Client, des, nw []NetworkFirewallPolicyRuleMatchLayer4Configs) []NetworkFirewallPolicyRuleMatchLayer4Configs { @@ -999,23 +1005,26 @@ func canonicalizeNewNetworkFirewallPolicyRuleMatchSrcSecureTagsSet(c *Client, de if des == nil { return nw } - var reorderedNew []NetworkFirewallPolicyRuleMatchSrcSecureTags + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NetworkFirewallPolicyRuleMatchSrcSecureTags for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNetworkFirewallPolicyRuleMatchSrcSecureTagsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNetworkFirewallPolicyRuleMatchSrcSecureTags(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNetworkFirewallPolicyRuleMatchSrcSecureTagsSlice(c *Client, des, nw []NetworkFirewallPolicyRuleMatchSrcSecureTags) []NetworkFirewallPolicyRuleMatchSrcSecureTags { @@ -1111,23 +1120,26 @@ func canonicalizeNewNetworkFirewallPolicyRuleTargetSecureTagsSet(c *Client, des, if des == nil { return nw } - var reorderedNew []NetworkFirewallPolicyRuleTargetSecureTags + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NetworkFirewallPolicyRuleTargetSecureTags for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNetworkFirewallPolicyRuleTargetSecureTagsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNetworkFirewallPolicyRuleTargetSecureTags(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNetworkFirewallPolicyRuleTargetSecureTagsSlice(c *Client, des, nw []NetworkFirewallPolicyRuleTargetSecureTags) []NetworkFirewallPolicyRuleTargetSecureTags { diff --git a/services/google/compute/network_internal.go b/services/google/compute/network_internal.go index ecf501667e..b6baef5b43 100755 --- a/services/google/compute/network_internal.go +++ b/services/google/compute/network_internal.go @@ -571,23 +571,26 @@ func canonicalizeNewNetworkRoutingConfigSet(c *Client, des, nw []NetworkRoutingC if des == nil { return nw } - var reorderedNew []NetworkRoutingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NetworkRoutingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNetworkRoutingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNetworkRoutingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNetworkRoutingConfigSlice(c *Client, des, nw []NetworkRoutingConfig) []NetworkRoutingConfig { diff --git a/services/google/compute/packet_mirroring_internal.go b/services/google/compute/packet_mirroring_internal.go index fa460fbcd9..b790f28e4c 100755 --- a/services/google/compute/packet_mirroring_internal.go +++ b/services/google/compute/packet_mirroring_internal.go @@ -702,23 +702,26 @@ func canonicalizeNewPacketMirroringNetworkSet(c *Client, des, nw []PacketMirrori if des == nil { return nw } - var reorderedNew []PacketMirroringNetwork + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PacketMirroringNetwork for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePacketMirroringNetworkNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPacketMirroringNetwork(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPacketMirroringNetworkSlice(c *Client, des, nw []PacketMirroringNetwork) []PacketMirroringNetwork { @@ -818,23 +821,26 @@ func canonicalizeNewPacketMirroringCollectorIlbSet(c *Client, des, nw []PacketMi if des == nil { return nw } - var reorderedNew []PacketMirroringCollectorIlb + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PacketMirroringCollectorIlb for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePacketMirroringCollectorIlbNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPacketMirroringCollectorIlb(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPacketMirroringCollectorIlbSlice(c *Client, des, nw []PacketMirroringCollectorIlb) []PacketMirroringCollectorIlb { @@ -937,23 +943,26 @@ func canonicalizeNewPacketMirroringMirroredResourcesSet(c *Client, des, nw []Pac if des == nil { return nw } - var reorderedNew []PacketMirroringMirroredResources + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PacketMirroringMirroredResources for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePacketMirroringMirroredResourcesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPacketMirroringMirroredResources(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPacketMirroringMirroredResourcesSlice(c *Client, des, nw []PacketMirroringMirroredResources) []PacketMirroringMirroredResources { @@ -1053,23 +1062,26 @@ func canonicalizeNewPacketMirroringMirroredResourcesSubnetworksSet(c *Client, de if des == nil { return nw } - var reorderedNew []PacketMirroringMirroredResourcesSubnetworks + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PacketMirroringMirroredResourcesSubnetworks for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePacketMirroringMirroredResourcesSubnetworksNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPacketMirroringMirroredResourcesSubnetworks(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPacketMirroringMirroredResourcesSubnetworksSlice(c *Client, des, nw []PacketMirroringMirroredResourcesSubnetworks) []PacketMirroringMirroredResourcesSubnetworks { @@ -1169,23 +1181,26 @@ func canonicalizeNewPacketMirroringMirroredResourcesInstancesSet(c *Client, des, if des == nil { return nw } - var reorderedNew []PacketMirroringMirroredResourcesInstances + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PacketMirroringMirroredResourcesInstances for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePacketMirroringMirroredResourcesInstancesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPacketMirroringMirroredResourcesInstances(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPacketMirroringMirroredResourcesInstancesSlice(c *Client, des, nw []PacketMirroringMirroredResourcesInstances) []PacketMirroringMirroredResourcesInstances { @@ -1298,23 +1313,26 @@ func canonicalizeNewPacketMirroringFilterSet(c *Client, des, nw []PacketMirrorin if des == nil { return nw } - var reorderedNew []PacketMirroringFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PacketMirroringFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePacketMirroringFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPacketMirroringFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPacketMirroringFilterSlice(c *Client, des, nw []PacketMirroringFilter) []PacketMirroringFilter { diff --git a/services/google/compute/route_internal.go b/services/google/compute/route_internal.go index 8f8b2dd09b..fc02b40795 100755 --- a/services/google/compute/route_internal.go +++ b/services/google/compute/route_internal.go @@ -705,23 +705,26 @@ func canonicalizeNewRouteWarningSet(c *Client, des, nw []RouteWarning) []RouteWa if des == nil { return nw } - var reorderedNew []RouteWarning + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []RouteWarning for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareRouteWarningNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewRouteWarning(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewRouteWarningSlice(c *Client, des, nw []RouteWarning) []RouteWarning { diff --git a/services/google/compute/service_attachment_internal.go b/services/google/compute/service_attachment_internal.go index 5451f48bee..fc2af57187 100755 --- a/services/google/compute/service_attachment_internal.go +++ b/services/google/compute/service_attachment_internal.go @@ -735,23 +735,26 @@ func canonicalizeNewServiceAttachmentConnectedEndpointsSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []ServiceAttachmentConnectedEndpoints + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceAttachmentConnectedEndpoints for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceAttachmentConnectedEndpointsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceAttachmentConnectedEndpoints(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceAttachmentConnectedEndpointsSlice(c *Client, des, nw []ServiceAttachmentConnectedEndpoints) []ServiceAttachmentConnectedEndpoints { @@ -853,23 +856,26 @@ func canonicalizeNewServiceAttachmentConsumerAcceptListsSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []ServiceAttachmentConsumerAcceptLists + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceAttachmentConsumerAcceptLists for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceAttachmentConsumerAcceptListsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceAttachmentConsumerAcceptLists(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceAttachmentConsumerAcceptListsSlice(c *Client, des, nw []ServiceAttachmentConsumerAcceptLists) []ServiceAttachmentConsumerAcceptLists { @@ -958,23 +964,26 @@ func canonicalizeNewServiceAttachmentPscServiceAttachmentIdSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []ServiceAttachmentPscServiceAttachmentId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceAttachmentPscServiceAttachmentId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceAttachmentPscServiceAttachmentIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceAttachmentPscServiceAttachmentId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceAttachmentPscServiceAttachmentIdSlice(c *Client, des, nw []ServiceAttachmentPscServiceAttachmentId) []ServiceAttachmentPscServiceAttachmentId { diff --git a/services/google/compute/subnetwork_internal.go b/services/google/compute/subnetwork_internal.go index 80408f0fcb..dabc073edf 100755 --- a/services/google/compute/subnetwork_internal.go +++ b/services/google/compute/subnetwork_internal.go @@ -831,23 +831,26 @@ func canonicalizeNewSubnetworkSecondaryIPRangesSet(c *Client, des, nw []Subnetwo if des == nil { return nw } - var reorderedNew []SubnetworkSecondaryIPRanges + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []SubnetworkSecondaryIPRanges for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareSubnetworkSecondaryIPRangesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewSubnetworkSecondaryIPRanges(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewSubnetworkSecondaryIPRangesSlice(c *Client, des, nw []SubnetworkSecondaryIPRanges) []SubnetworkSecondaryIPRanges { @@ -979,23 +982,26 @@ func canonicalizeNewSubnetworkLogConfigSet(c *Client, des, nw []SubnetworkLogCon if des == nil { return nw } - var reorderedNew []SubnetworkLogConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []SubnetworkLogConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareSubnetworkLogConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewSubnetworkLogConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewSubnetworkLogConfigSlice(c *Client, des, nw []SubnetworkLogConfig) []SubnetworkLogConfig { diff --git a/services/google/configcontroller/alpha/instance_internal.go b/services/google/configcontroller/alpha/instance_internal.go index 61b3edddf0..331d7bb006 100755 --- a/services/google/configcontroller/alpha/instance_internal.go +++ b/services/google/configcontroller/alpha/instance_internal.go @@ -581,23 +581,26 @@ func canonicalizeNewInstanceBundlesConfigSet(c *Client, des, nw []InstanceBundle if des == nil { return nw } - var reorderedNew []InstanceBundlesConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceBundlesConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceBundlesConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceBundlesConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceBundlesConfigSlice(c *Client, des, nw []InstanceBundlesConfig) []InstanceBundlesConfig { @@ -696,23 +699,26 @@ func canonicalizeNewInstanceBundlesConfigConfigControllerConfigSet(c *Client, de if des == nil { return nw } - var reorderedNew []InstanceBundlesConfigConfigControllerConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceBundlesConfigConfigControllerConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceBundlesConfigConfigControllerConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceBundlesConfigConfigControllerConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceBundlesConfigConfigControllerConfigSlice(c *Client, des, nw []InstanceBundlesConfigConfigControllerConfig) []InstanceBundlesConfigConfigControllerConfig { @@ -827,23 +833,26 @@ func canonicalizeNewInstanceManagementConfigSet(c *Client, des, nw []InstanceMan if des == nil { return nw } - var reorderedNew []InstanceManagementConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceManagementConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceManagementConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceManagementConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceManagementConfigSlice(c *Client, des, nw []InstanceManagementConfig) []InstanceManagementConfig { @@ -988,23 +997,26 @@ func canonicalizeNewInstanceManagementConfigStandardManagementConfigSet(c *Clien if des == nil { return nw } - var reorderedNew []InstanceManagementConfigStandardManagementConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceManagementConfigStandardManagementConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceManagementConfigStandardManagementConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceManagementConfigStandardManagementConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceManagementConfigStandardManagementConfigSlice(c *Client, des, nw []InstanceManagementConfigStandardManagementConfig) []InstanceManagementConfigStandardManagementConfig { @@ -1149,23 +1161,26 @@ func canonicalizeNewInstanceManagementConfigFullManagementConfigSet(c *Client, d if des == nil { return nw } - var reorderedNew []InstanceManagementConfigFullManagementConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceManagementConfigFullManagementConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceManagementConfigFullManagementConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceManagementConfigFullManagementConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceManagementConfigFullManagementConfigSlice(c *Client, des, nw []InstanceManagementConfigFullManagementConfig) []InstanceManagementConfigFullManagementConfig { diff --git a/services/google/containeranalysis/alpha/note_internal.go b/services/google/containeranalysis/alpha/note_internal.go index 8ec5b6e714..ae3fd63617 100755 --- a/services/google/containeranalysis/alpha/note_internal.go +++ b/services/google/containeranalysis/alpha/note_internal.go @@ -985,23 +985,26 @@ func canonicalizeNewNoteRelatedUrlSet(c *Client, des, nw []NoteRelatedUrl) []Not if des == nil { return nw } - var reorderedNew []NoteRelatedUrl + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteRelatedUrl for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteRelatedUrlNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteRelatedUrl(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteRelatedUrlSlice(c *Client, des, nw []NoteRelatedUrl) []NoteRelatedUrl { @@ -1116,23 +1119,26 @@ func canonicalizeNewNoteVulnerabilitySet(c *Client, des, nw []NoteVulnerability) if des == nil { return nw } - var reorderedNew []NoteVulnerability + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteVulnerability for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteVulnerabilityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteVulnerability(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteVulnerabilitySlice(c *Client, des, nw []NoteVulnerability) []NoteVulnerability { @@ -1299,23 +1305,26 @@ func canonicalizeNewNoteVulnerabilityDetailsSet(c *Client, des, nw []NoteVulnera if des == nil { return nw } - var reorderedNew []NoteVulnerabilityDetails + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteVulnerabilityDetails for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteVulnerabilityDetailsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteVulnerabilityDetails(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteVulnerabilityDetailsSlice(c *Client, des, nw []NoteVulnerabilityDetails) []NoteVulnerabilityDetails { @@ -1442,23 +1451,26 @@ func canonicalizeNewNoteVulnerabilityDetailsAffectedVersionStartSet(c *Client, d if des == nil { return nw } - var reorderedNew []NoteVulnerabilityDetailsAffectedVersionStart + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteVulnerabilityDetailsAffectedVersionStart for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteVulnerabilityDetailsAffectedVersionStartNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteVulnerabilityDetailsAffectedVersionStart(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteVulnerabilityDetailsAffectedVersionStartSlice(c *Client, des, nw []NoteVulnerabilityDetailsAffectedVersionStart) []NoteVulnerabilityDetailsAffectedVersionStart { @@ -1585,23 +1597,26 @@ func canonicalizeNewNoteVulnerabilityDetailsAffectedVersionEndSet(c *Client, des if des == nil { return nw } - var reorderedNew []NoteVulnerabilityDetailsAffectedVersionEnd + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteVulnerabilityDetailsAffectedVersionEnd for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteVulnerabilityDetailsAffectedVersionEndNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteVulnerabilityDetailsAffectedVersionEnd(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteVulnerabilityDetailsAffectedVersionEndSlice(c *Client, des, nw []NoteVulnerabilityDetailsAffectedVersionEnd) []NoteVulnerabilityDetailsAffectedVersionEnd { @@ -1728,23 +1743,26 @@ func canonicalizeNewNoteVulnerabilityDetailsFixedVersionSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []NoteVulnerabilityDetailsFixedVersion + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteVulnerabilityDetailsFixedVersion for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteVulnerabilityDetailsFixedVersionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteVulnerabilityDetailsFixedVersion(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteVulnerabilityDetailsFixedVersionSlice(c *Client, des, nw []NoteVulnerabilityDetailsFixedVersion) []NoteVulnerabilityDetailsFixedVersion { @@ -1900,23 +1918,26 @@ func canonicalizeNewNoteVulnerabilityCvssV3Set(c *Client, des, nw []NoteVulnerab if des == nil { return nw } - var reorderedNew []NoteVulnerabilityCvssV3 + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteVulnerabilityCvssV3 for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteVulnerabilityCvssV3NewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteVulnerabilityCvssV3(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteVulnerabilityCvssV3Slice(c *Client, des, nw []NoteVulnerabilityCvssV3) []NoteVulnerabilityCvssV3 { @@ -2033,23 +2054,26 @@ func canonicalizeNewNoteVulnerabilityWindowsDetailsSet(c *Client, des, nw []Note if des == nil { return nw } - var reorderedNew []NoteVulnerabilityWindowsDetails + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteVulnerabilityWindowsDetails for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteVulnerabilityWindowsDetailsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteVulnerabilityWindowsDetails(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteVulnerabilityWindowsDetailsSlice(c *Client, des, nw []NoteVulnerabilityWindowsDetails) []NoteVulnerabilityWindowsDetails { @@ -2156,23 +2180,26 @@ func canonicalizeNewNoteVulnerabilityWindowsDetailsFixingKbsSet(c *Client, des, if des == nil { return nw } - var reorderedNew []NoteVulnerabilityWindowsDetailsFixingKbs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteVulnerabilityWindowsDetailsFixingKbs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteVulnerabilityWindowsDetailsFixingKbsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteVulnerabilityWindowsDetailsFixingKbs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteVulnerabilityWindowsDetailsFixingKbsSlice(c *Client, des, nw []NoteVulnerabilityWindowsDetailsFixingKbs) []NoteVulnerabilityWindowsDetailsFixingKbs { @@ -2273,23 +2300,26 @@ func canonicalizeNewNoteBuildSet(c *Client, des, nw []NoteBuild) []NoteBuild { if des == nil { return nw } - var reorderedNew []NoteBuild + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteBuild for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteBuildNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteBuild(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteBuildSlice(c *Client, des, nw []NoteBuild) []NoteBuild { @@ -2410,23 +2440,26 @@ func canonicalizeNewNoteBuildSignatureSet(c *Client, des, nw []NoteBuildSignatur if des == nil { return nw } - var reorderedNew []NoteBuildSignature + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteBuildSignature for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteBuildSignatureNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteBuildSignature(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteBuildSignatureSlice(c *Client, des, nw []NoteBuildSignature) []NoteBuildSignature { @@ -2527,23 +2560,26 @@ func canonicalizeNewNoteImageSet(c *Client, des, nw []NoteImage) []NoteImage { if des == nil { return nw } - var reorderedNew []NoteImage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteImage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteImageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteImage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteImageSlice(c *Client, des, nw []NoteImage) []NoteImage { @@ -2653,23 +2689,26 @@ func canonicalizeNewNoteImageFingerprintSet(c *Client, des, nw []NoteImageFinger if des == nil { return nw } - var reorderedNew []NoteImageFingerprint + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteImageFingerprint for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteImageFingerprintNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteImageFingerprint(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteImageFingerprintSlice(c *Client, des, nw []NoteImageFingerprint) []NoteImageFingerprint { @@ -2770,23 +2809,26 @@ func canonicalizeNewNotePackageSet(c *Client, des, nw []NotePackage) []NotePacka if des == nil { return nw } - var reorderedNew []NotePackage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NotePackage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNotePackageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNotePackage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNotePackageSlice(c *Client, des, nw []NotePackage) []NotePackage { @@ -2917,23 +2959,26 @@ func canonicalizeNewNotePackageDistributionSet(c *Client, des, nw []NotePackageD if des == nil { return nw } - var reorderedNew []NotePackageDistribution + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NotePackageDistribution for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNotePackageDistributionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNotePackageDistribution(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNotePackageDistributionSlice(c *Client, des, nw []NotePackageDistribution) []NotePackageDistribution { @@ -3060,23 +3105,26 @@ func canonicalizeNewNotePackageDistributionLatestVersionSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []NotePackageDistributionLatestVersion + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NotePackageDistributionLatestVersion for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNotePackageDistributionLatestVersionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNotePackageDistributionLatestVersion(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNotePackageDistributionLatestVersionSlice(c *Client, des, nw []NotePackageDistributionLatestVersion) []NotePackageDistributionLatestVersion { @@ -3172,23 +3220,26 @@ func canonicalizeNewNoteDiscoverySet(c *Client, des, nw []NoteDiscovery) []NoteD if des == nil { return nw } - var reorderedNew []NoteDiscovery + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteDiscovery for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteDiscoveryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteDiscovery(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteDiscoverySlice(c *Client, des, nw []NoteDiscovery) []NoteDiscovery { @@ -3287,23 +3338,26 @@ func canonicalizeNewNoteDeploymentSet(c *Client, des, nw []NoteDeployment) []Not if des == nil { return nw } - var reorderedNew []NoteDeployment + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteDeployment for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteDeploymentNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteDeployment(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteDeploymentSlice(c *Client, des, nw []NoteDeployment) []NoteDeployment { @@ -3396,23 +3450,26 @@ func canonicalizeNewNoteAttestationSet(c *Client, des, nw []NoteAttestation) []N if des == nil { return nw } - var reorderedNew []NoteAttestation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteAttestation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteAttestationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteAttestation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteAttestationSlice(c *Client, des, nw []NoteAttestation) []NoteAttestation { @@ -3511,23 +3568,26 @@ func canonicalizeNewNoteAttestationHintSet(c *Client, des, nw []NoteAttestationH if des == nil { return nw } - var reorderedNew []NoteAttestationHint + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteAttestationHint for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteAttestationHintNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteAttestationHint(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteAttestationHintSlice(c *Client, des, nw []NoteAttestationHint) []NoteAttestationHint { diff --git a/services/google/containeranalysis/beta/note_internal.go b/services/google/containeranalysis/beta/note_internal.go index 119f5143ef..143e186aab 100755 --- a/services/google/containeranalysis/beta/note_internal.go +++ b/services/google/containeranalysis/beta/note_internal.go @@ -985,23 +985,26 @@ func canonicalizeNewNoteRelatedUrlSet(c *Client, des, nw []NoteRelatedUrl) []Not if des == nil { return nw } - var reorderedNew []NoteRelatedUrl + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteRelatedUrl for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteRelatedUrlNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteRelatedUrl(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteRelatedUrlSlice(c *Client, des, nw []NoteRelatedUrl) []NoteRelatedUrl { @@ -1116,23 +1119,26 @@ func canonicalizeNewNoteVulnerabilitySet(c *Client, des, nw []NoteVulnerability) if des == nil { return nw } - var reorderedNew []NoteVulnerability + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteVulnerability for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteVulnerabilityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteVulnerability(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteVulnerabilitySlice(c *Client, des, nw []NoteVulnerability) []NoteVulnerability { @@ -1299,23 +1305,26 @@ func canonicalizeNewNoteVulnerabilityDetailsSet(c *Client, des, nw []NoteVulnera if des == nil { return nw } - var reorderedNew []NoteVulnerabilityDetails + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteVulnerabilityDetails for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteVulnerabilityDetailsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteVulnerabilityDetails(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteVulnerabilityDetailsSlice(c *Client, des, nw []NoteVulnerabilityDetails) []NoteVulnerabilityDetails { @@ -1442,23 +1451,26 @@ func canonicalizeNewNoteVulnerabilityDetailsAffectedVersionStartSet(c *Client, d if des == nil { return nw } - var reorderedNew []NoteVulnerabilityDetailsAffectedVersionStart + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteVulnerabilityDetailsAffectedVersionStart for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteVulnerabilityDetailsAffectedVersionStartNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteVulnerabilityDetailsAffectedVersionStart(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteVulnerabilityDetailsAffectedVersionStartSlice(c *Client, des, nw []NoteVulnerabilityDetailsAffectedVersionStart) []NoteVulnerabilityDetailsAffectedVersionStart { @@ -1585,23 +1597,26 @@ func canonicalizeNewNoteVulnerabilityDetailsAffectedVersionEndSet(c *Client, des if des == nil { return nw } - var reorderedNew []NoteVulnerabilityDetailsAffectedVersionEnd + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteVulnerabilityDetailsAffectedVersionEnd for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteVulnerabilityDetailsAffectedVersionEndNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteVulnerabilityDetailsAffectedVersionEnd(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteVulnerabilityDetailsAffectedVersionEndSlice(c *Client, des, nw []NoteVulnerabilityDetailsAffectedVersionEnd) []NoteVulnerabilityDetailsAffectedVersionEnd { @@ -1728,23 +1743,26 @@ func canonicalizeNewNoteVulnerabilityDetailsFixedVersionSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []NoteVulnerabilityDetailsFixedVersion + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteVulnerabilityDetailsFixedVersion for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteVulnerabilityDetailsFixedVersionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteVulnerabilityDetailsFixedVersion(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteVulnerabilityDetailsFixedVersionSlice(c *Client, des, nw []NoteVulnerabilityDetailsFixedVersion) []NoteVulnerabilityDetailsFixedVersion { @@ -1900,23 +1918,26 @@ func canonicalizeNewNoteVulnerabilityCvssV3Set(c *Client, des, nw []NoteVulnerab if des == nil { return nw } - var reorderedNew []NoteVulnerabilityCvssV3 + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteVulnerabilityCvssV3 for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteVulnerabilityCvssV3NewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteVulnerabilityCvssV3(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteVulnerabilityCvssV3Slice(c *Client, des, nw []NoteVulnerabilityCvssV3) []NoteVulnerabilityCvssV3 { @@ -2033,23 +2054,26 @@ func canonicalizeNewNoteVulnerabilityWindowsDetailsSet(c *Client, des, nw []Note if des == nil { return nw } - var reorderedNew []NoteVulnerabilityWindowsDetails + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteVulnerabilityWindowsDetails for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteVulnerabilityWindowsDetailsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteVulnerabilityWindowsDetails(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteVulnerabilityWindowsDetailsSlice(c *Client, des, nw []NoteVulnerabilityWindowsDetails) []NoteVulnerabilityWindowsDetails { @@ -2156,23 +2180,26 @@ func canonicalizeNewNoteVulnerabilityWindowsDetailsFixingKbsSet(c *Client, des, if des == nil { return nw } - var reorderedNew []NoteVulnerabilityWindowsDetailsFixingKbs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteVulnerabilityWindowsDetailsFixingKbs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteVulnerabilityWindowsDetailsFixingKbsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteVulnerabilityWindowsDetailsFixingKbs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteVulnerabilityWindowsDetailsFixingKbsSlice(c *Client, des, nw []NoteVulnerabilityWindowsDetailsFixingKbs) []NoteVulnerabilityWindowsDetailsFixingKbs { @@ -2273,23 +2300,26 @@ func canonicalizeNewNoteBuildSet(c *Client, des, nw []NoteBuild) []NoteBuild { if des == nil { return nw } - var reorderedNew []NoteBuild + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteBuild for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteBuildNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteBuild(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteBuildSlice(c *Client, des, nw []NoteBuild) []NoteBuild { @@ -2410,23 +2440,26 @@ func canonicalizeNewNoteBuildSignatureSet(c *Client, des, nw []NoteBuildSignatur if des == nil { return nw } - var reorderedNew []NoteBuildSignature + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteBuildSignature for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteBuildSignatureNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteBuildSignature(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteBuildSignatureSlice(c *Client, des, nw []NoteBuildSignature) []NoteBuildSignature { @@ -2527,23 +2560,26 @@ func canonicalizeNewNoteImageSet(c *Client, des, nw []NoteImage) []NoteImage { if des == nil { return nw } - var reorderedNew []NoteImage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteImage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteImageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteImage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteImageSlice(c *Client, des, nw []NoteImage) []NoteImage { @@ -2653,23 +2689,26 @@ func canonicalizeNewNoteImageFingerprintSet(c *Client, des, nw []NoteImageFinger if des == nil { return nw } - var reorderedNew []NoteImageFingerprint + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteImageFingerprint for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteImageFingerprintNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteImageFingerprint(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteImageFingerprintSlice(c *Client, des, nw []NoteImageFingerprint) []NoteImageFingerprint { @@ -2770,23 +2809,26 @@ func canonicalizeNewNotePackageSet(c *Client, des, nw []NotePackage) []NotePacka if des == nil { return nw } - var reorderedNew []NotePackage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NotePackage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNotePackageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNotePackage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNotePackageSlice(c *Client, des, nw []NotePackage) []NotePackage { @@ -2917,23 +2959,26 @@ func canonicalizeNewNotePackageDistributionSet(c *Client, des, nw []NotePackageD if des == nil { return nw } - var reorderedNew []NotePackageDistribution + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NotePackageDistribution for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNotePackageDistributionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNotePackageDistribution(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNotePackageDistributionSlice(c *Client, des, nw []NotePackageDistribution) []NotePackageDistribution { @@ -3060,23 +3105,26 @@ func canonicalizeNewNotePackageDistributionLatestVersionSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []NotePackageDistributionLatestVersion + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NotePackageDistributionLatestVersion for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNotePackageDistributionLatestVersionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNotePackageDistributionLatestVersion(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNotePackageDistributionLatestVersionSlice(c *Client, des, nw []NotePackageDistributionLatestVersion) []NotePackageDistributionLatestVersion { @@ -3172,23 +3220,26 @@ func canonicalizeNewNoteDiscoverySet(c *Client, des, nw []NoteDiscovery) []NoteD if des == nil { return nw } - var reorderedNew []NoteDiscovery + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteDiscovery for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteDiscoveryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteDiscovery(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteDiscoverySlice(c *Client, des, nw []NoteDiscovery) []NoteDiscovery { @@ -3287,23 +3338,26 @@ func canonicalizeNewNoteDeploymentSet(c *Client, des, nw []NoteDeployment) []Not if des == nil { return nw } - var reorderedNew []NoteDeployment + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteDeployment for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteDeploymentNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteDeployment(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteDeploymentSlice(c *Client, des, nw []NoteDeployment) []NoteDeployment { @@ -3396,23 +3450,26 @@ func canonicalizeNewNoteAttestationSet(c *Client, des, nw []NoteAttestation) []N if des == nil { return nw } - var reorderedNew []NoteAttestation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteAttestation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteAttestationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteAttestation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteAttestationSlice(c *Client, des, nw []NoteAttestation) []NoteAttestation { @@ -3511,23 +3568,26 @@ func canonicalizeNewNoteAttestationHintSet(c *Client, des, nw []NoteAttestationH if des == nil { return nw } - var reorderedNew []NoteAttestationHint + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteAttestationHint for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteAttestationHintNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteAttestationHint(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteAttestationHintSlice(c *Client, des, nw []NoteAttestationHint) []NoteAttestationHint { diff --git a/services/google/containeranalysis/note_internal.go b/services/google/containeranalysis/note_internal.go index 24f201e30c..189d27b7b3 100755 --- a/services/google/containeranalysis/note_internal.go +++ b/services/google/containeranalysis/note_internal.go @@ -974,23 +974,26 @@ func canonicalizeNewNoteRelatedUrlSet(c *Client, des, nw []NoteRelatedUrl) []Not if des == nil { return nw } - var reorderedNew []NoteRelatedUrl + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteRelatedUrl for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteRelatedUrlNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteRelatedUrl(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteRelatedUrlSlice(c *Client, des, nw []NoteRelatedUrl) []NoteRelatedUrl { @@ -1105,23 +1108,26 @@ func canonicalizeNewNoteVulnerabilitySet(c *Client, des, nw []NoteVulnerability) if des == nil { return nw } - var reorderedNew []NoteVulnerability + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteVulnerability for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteVulnerabilityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteVulnerability(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteVulnerabilitySlice(c *Client, des, nw []NoteVulnerability) []NoteVulnerability { @@ -1288,23 +1294,26 @@ func canonicalizeNewNoteVulnerabilityDetailsSet(c *Client, des, nw []NoteVulnera if des == nil { return nw } - var reorderedNew []NoteVulnerabilityDetails + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteVulnerabilityDetails for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteVulnerabilityDetailsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteVulnerabilityDetails(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteVulnerabilityDetailsSlice(c *Client, des, nw []NoteVulnerabilityDetails) []NoteVulnerabilityDetails { @@ -1431,23 +1440,26 @@ func canonicalizeNewNoteVulnerabilityDetailsAffectedVersionStartSet(c *Client, d if des == nil { return nw } - var reorderedNew []NoteVulnerabilityDetailsAffectedVersionStart + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteVulnerabilityDetailsAffectedVersionStart for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteVulnerabilityDetailsAffectedVersionStartNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteVulnerabilityDetailsAffectedVersionStart(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteVulnerabilityDetailsAffectedVersionStartSlice(c *Client, des, nw []NoteVulnerabilityDetailsAffectedVersionStart) []NoteVulnerabilityDetailsAffectedVersionStart { @@ -1574,23 +1586,26 @@ func canonicalizeNewNoteVulnerabilityDetailsAffectedVersionEndSet(c *Client, des if des == nil { return nw } - var reorderedNew []NoteVulnerabilityDetailsAffectedVersionEnd + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteVulnerabilityDetailsAffectedVersionEnd for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteVulnerabilityDetailsAffectedVersionEndNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteVulnerabilityDetailsAffectedVersionEnd(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteVulnerabilityDetailsAffectedVersionEndSlice(c *Client, des, nw []NoteVulnerabilityDetailsAffectedVersionEnd) []NoteVulnerabilityDetailsAffectedVersionEnd { @@ -1717,23 +1732,26 @@ func canonicalizeNewNoteVulnerabilityDetailsFixedVersionSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []NoteVulnerabilityDetailsFixedVersion + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteVulnerabilityDetailsFixedVersion for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteVulnerabilityDetailsFixedVersionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteVulnerabilityDetailsFixedVersion(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteVulnerabilityDetailsFixedVersionSlice(c *Client, des, nw []NoteVulnerabilityDetailsFixedVersion) []NoteVulnerabilityDetailsFixedVersion { @@ -1889,23 +1907,26 @@ func canonicalizeNewNoteVulnerabilityCvssV3Set(c *Client, des, nw []NoteVulnerab if des == nil { return nw } - var reorderedNew []NoteVulnerabilityCvssV3 + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteVulnerabilityCvssV3 for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteVulnerabilityCvssV3NewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteVulnerabilityCvssV3(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteVulnerabilityCvssV3Slice(c *Client, des, nw []NoteVulnerabilityCvssV3) []NoteVulnerabilityCvssV3 { @@ -2022,23 +2043,26 @@ func canonicalizeNewNoteVulnerabilityWindowsDetailsSet(c *Client, des, nw []Note if des == nil { return nw } - var reorderedNew []NoteVulnerabilityWindowsDetails + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteVulnerabilityWindowsDetails for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteVulnerabilityWindowsDetailsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteVulnerabilityWindowsDetails(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteVulnerabilityWindowsDetailsSlice(c *Client, des, nw []NoteVulnerabilityWindowsDetails) []NoteVulnerabilityWindowsDetails { @@ -2145,23 +2169,26 @@ func canonicalizeNewNoteVulnerabilityWindowsDetailsFixingKbsSet(c *Client, des, if des == nil { return nw } - var reorderedNew []NoteVulnerabilityWindowsDetailsFixingKbs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteVulnerabilityWindowsDetailsFixingKbs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteVulnerabilityWindowsDetailsFixingKbsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteVulnerabilityWindowsDetailsFixingKbs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteVulnerabilityWindowsDetailsFixingKbsSlice(c *Client, des, nw []NoteVulnerabilityWindowsDetailsFixingKbs) []NoteVulnerabilityWindowsDetailsFixingKbs { @@ -2260,23 +2287,26 @@ func canonicalizeNewNoteBuildSet(c *Client, des, nw []NoteBuild) []NoteBuild { if des == nil { return nw } - var reorderedNew []NoteBuild + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteBuild for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteBuildNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteBuild(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteBuildSlice(c *Client, des, nw []NoteBuild) []NoteBuild { @@ -2377,23 +2407,26 @@ func canonicalizeNewNoteImageSet(c *Client, des, nw []NoteImage) []NoteImage { if des == nil { return nw } - var reorderedNew []NoteImage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteImage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteImageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteImage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteImageSlice(c *Client, des, nw []NoteImage) []NoteImage { @@ -2503,23 +2536,26 @@ func canonicalizeNewNoteImageFingerprintSet(c *Client, des, nw []NoteImageFinger if des == nil { return nw } - var reorderedNew []NoteImageFingerprint + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteImageFingerprint for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteImageFingerprintNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteImageFingerprint(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteImageFingerprintSlice(c *Client, des, nw []NoteImageFingerprint) []NoteImageFingerprint { @@ -2620,23 +2656,26 @@ func canonicalizeNewNotePackageSet(c *Client, des, nw []NotePackage) []NotePacka if des == nil { return nw } - var reorderedNew []NotePackage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NotePackage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNotePackageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNotePackage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNotePackageSlice(c *Client, des, nw []NotePackage) []NotePackage { @@ -2767,23 +2806,26 @@ func canonicalizeNewNotePackageDistributionSet(c *Client, des, nw []NotePackageD if des == nil { return nw } - var reorderedNew []NotePackageDistribution + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NotePackageDistribution for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNotePackageDistributionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNotePackageDistribution(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNotePackageDistributionSlice(c *Client, des, nw []NotePackageDistribution) []NotePackageDistribution { @@ -2910,23 +2952,26 @@ func canonicalizeNewNotePackageDistributionLatestVersionSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []NotePackageDistributionLatestVersion + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NotePackageDistributionLatestVersion for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNotePackageDistributionLatestVersionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNotePackageDistributionLatestVersion(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNotePackageDistributionLatestVersionSlice(c *Client, des, nw []NotePackageDistributionLatestVersion) []NotePackageDistributionLatestVersion { @@ -3022,23 +3067,26 @@ func canonicalizeNewNoteDiscoverySet(c *Client, des, nw []NoteDiscovery) []NoteD if des == nil { return nw } - var reorderedNew []NoteDiscovery + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteDiscovery for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteDiscoveryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteDiscovery(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteDiscoverySlice(c *Client, des, nw []NoteDiscovery) []NoteDiscovery { @@ -3137,23 +3185,26 @@ func canonicalizeNewNoteDeploymentSet(c *Client, des, nw []NoteDeployment) []Not if des == nil { return nw } - var reorderedNew []NoteDeployment + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteDeployment for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteDeploymentNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteDeployment(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteDeploymentSlice(c *Client, des, nw []NoteDeployment) []NoteDeployment { @@ -3246,23 +3297,26 @@ func canonicalizeNewNoteAttestationSet(c *Client, des, nw []NoteAttestation) []N if des == nil { return nw } - var reorderedNew []NoteAttestation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteAttestation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteAttestationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteAttestation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteAttestationSlice(c *Client, des, nw []NoteAttestation) []NoteAttestation { @@ -3361,23 +3415,26 @@ func canonicalizeNewNoteAttestationHintSet(c *Client, des, nw []NoteAttestationH if des == nil { return nw } - var reorderedNew []NoteAttestationHint + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NoteAttestationHint for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNoteAttestationHintNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNoteAttestationHint(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNoteAttestationHintSlice(c *Client, des, nw []NoteAttestationHint) []NoteAttestationHint { diff --git a/services/google/containeraws/alpha/cluster_internal.go b/services/google/containeraws/alpha/cluster_internal.go index eef498802f..542b24b93b 100755 --- a/services/google/containeraws/alpha/cluster_internal.go +++ b/services/google/containeraws/alpha/cluster_internal.go @@ -950,23 +950,26 @@ func canonicalizeNewClusterNetworkingSet(c *Client, des, nw []ClusterNetworking) if des == nil { return nw } - var reorderedNew []ClusterNetworking + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterNetworking for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterNetworkingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterNetworking(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterNetworkingSlice(c *Client, des, nw []ClusterNetworking) []ClusterNetworking { @@ -1119,23 +1122,26 @@ func canonicalizeNewClusterControlPlaneSet(c *Client, des, nw []ClusterControlPl if des == nil { return nw } - var reorderedNew []ClusterControlPlane + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlane for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlane(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneSlice(c *Client, des, nw []ClusterControlPlane) []ClusterControlPlane { @@ -1234,23 +1240,26 @@ func canonicalizeNewClusterControlPlaneSshConfigSet(c *Client, des, nw []Cluster if des == nil { return nw } - var reorderedNew []ClusterControlPlaneSshConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneSshConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneSshConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneSshConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneSshConfigSlice(c *Client, des, nw []ClusterControlPlaneSshConfig) []ClusterControlPlaneSshConfig { @@ -1349,23 +1358,26 @@ func canonicalizeNewClusterControlPlaneConfigEncryptionSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []ClusterControlPlaneConfigEncryption + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneConfigEncryption for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneConfigEncryptionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneConfigEncryption(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneConfigEncryptionSlice(c *Client, des, nw []ClusterControlPlaneConfigEncryption) []ClusterControlPlaneConfigEncryption { @@ -1482,23 +1494,26 @@ func canonicalizeNewClusterControlPlaneRootVolumeSet(c *Client, des, nw []Cluste if des == nil { return nw } - var reorderedNew []ClusterControlPlaneRootVolume + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneRootVolume for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneRootVolumeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneRootVolume(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneRootVolumeSlice(c *Client, des, nw []ClusterControlPlaneRootVolume) []ClusterControlPlaneRootVolume { @@ -1615,23 +1630,26 @@ func canonicalizeNewClusterControlPlaneMainVolumeSet(c *Client, des, nw []Cluste if des == nil { return nw } - var reorderedNew []ClusterControlPlaneMainVolume + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneMainVolume for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneMainVolumeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneMainVolume(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneMainVolumeSlice(c *Client, des, nw []ClusterControlPlaneMainVolume) []ClusterControlPlaneMainVolume { @@ -1730,23 +1748,26 @@ func canonicalizeNewClusterControlPlaneDatabaseEncryptionSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []ClusterControlPlaneDatabaseEncryption + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneDatabaseEncryption for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneDatabaseEncryptionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneDatabaseEncryption(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneDatabaseEncryptionSlice(c *Client, des, nw []ClusterControlPlaneDatabaseEncryption) []ClusterControlPlaneDatabaseEncryption { @@ -1853,23 +1874,26 @@ func canonicalizeNewClusterControlPlaneAwsServicesAuthenticationSet(c *Client, d if des == nil { return nw } - var reorderedNew []ClusterControlPlaneAwsServicesAuthentication + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneAwsServicesAuthentication for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneAwsServicesAuthenticationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneAwsServicesAuthentication(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneAwsServicesAuthenticationSlice(c *Client, des, nw []ClusterControlPlaneAwsServicesAuthentication) []ClusterControlPlaneAwsServicesAuthentication { @@ -1976,23 +2000,26 @@ func canonicalizeNewClusterControlPlaneProxyConfigSet(c *Client, des, nw []Clust if des == nil { return nw } - var reorderedNew []ClusterControlPlaneProxyConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneProxyConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneProxyConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneProxyConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneProxyConfigSlice(c *Client, des, nw []ClusterControlPlaneProxyConfig) []ClusterControlPlaneProxyConfig { @@ -2088,23 +2115,26 @@ func canonicalizeNewClusterControlPlaneInstancePlacementSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []ClusterControlPlaneInstancePlacement + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneInstancePlacement for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneInstancePlacementNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneInstancePlacement(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneInstancePlacementSlice(c *Client, des, nw []ClusterControlPlaneInstancePlacement) []ClusterControlPlaneInstancePlacement { @@ -2197,23 +2227,26 @@ func canonicalizeNewClusterAuthorizationSet(c *Client, des, nw []ClusterAuthoriz if des == nil { return nw } - var reorderedNew []ClusterAuthorization + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterAuthorization for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterAuthorizationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterAuthorization(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterAuthorizationSlice(c *Client, des, nw []ClusterAuthorization) []ClusterAuthorization { @@ -2312,23 +2345,26 @@ func canonicalizeNewClusterAuthorizationAdminUsersSet(c *Client, des, nw []Clust if des == nil { return nw } - var reorderedNew []ClusterAuthorizationAdminUsers + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterAuthorizationAdminUsers for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterAuthorizationAdminUsersNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterAuthorizationAdminUsers(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterAuthorizationAdminUsersSlice(c *Client, des, nw []ClusterAuthorizationAdminUsers) []ClusterAuthorizationAdminUsers { @@ -2443,23 +2479,26 @@ func canonicalizeNewClusterWorkloadIdentityConfigSet(c *Client, des, nw []Cluste if des == nil { return nw } - var reorderedNew []ClusterWorkloadIdentityConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterWorkloadIdentityConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterWorkloadIdentityConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterWorkloadIdentityConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterWorkloadIdentityConfigSlice(c *Client, des, nw []ClusterWorkloadIdentityConfig) []ClusterWorkloadIdentityConfig { @@ -2561,23 +2600,26 @@ func canonicalizeNewClusterFleetSet(c *Client, des, nw []ClusterFleet) []Cluster if des == nil { return nw } - var reorderedNew []ClusterFleet + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterFleet for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterFleetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterFleet(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterFleetSlice(c *Client, des, nw []ClusterFleet) []ClusterFleet { @@ -2670,23 +2712,26 @@ func canonicalizeNewClusterLoggingConfigSet(c *Client, des, nw []ClusterLoggingC if des == nil { return nw } - var reorderedNew []ClusterLoggingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterLoggingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterLoggingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterLoggingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterLoggingConfigSlice(c *Client, des, nw []ClusterLoggingConfig) []ClusterLoggingConfig { @@ -2782,23 +2827,26 @@ func canonicalizeNewClusterLoggingConfigComponentConfigSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []ClusterLoggingConfigComponentConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterLoggingConfigComponentConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterLoggingConfigComponentConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterLoggingConfigComponentConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterLoggingConfigComponentConfigSlice(c *Client, des, nw []ClusterLoggingConfigComponentConfig) []ClusterLoggingConfigComponentConfig { @@ -2891,23 +2939,26 @@ func canonicalizeNewClusterMonitoringConfigSet(c *Client, des, nw []ClusterMonit if des == nil { return nw } - var reorderedNew []ClusterMonitoringConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterMonitoringConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterMonitoringConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterMonitoringConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterMonitoringConfigSlice(c *Client, des, nw []ClusterMonitoringConfig) []ClusterMonitoringConfig { @@ -3006,23 +3057,26 @@ func canonicalizeNewClusterMonitoringConfigManagedPrometheusConfigSet(c *Client, if des == nil { return nw } - var reorderedNew []ClusterMonitoringConfigManagedPrometheusConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterMonitoringConfigManagedPrometheusConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterMonitoringConfigManagedPrometheusConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterMonitoringConfigManagedPrometheusConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterMonitoringConfigManagedPrometheusConfigSlice(c *Client, des, nw []ClusterMonitoringConfigManagedPrometheusConfig) []ClusterMonitoringConfigManagedPrometheusConfig { diff --git a/services/google/containeraws/alpha/node_pool_internal.go b/services/google/containeraws/alpha/node_pool_internal.go index b6a5853356..2f1e08e751 100755 --- a/services/google/containeraws/alpha/node_pool_internal.go +++ b/services/google/containeraws/alpha/node_pool_internal.go @@ -871,23 +871,26 @@ func canonicalizeNewNodePoolConfigSet(c *Client, des, nw []NodePoolConfig) []Nod if des == nil { return nw } - var reorderedNew []NodePoolConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigSlice(c *Client, des, nw []NodePoolConfig) []NodePoolConfig { @@ -1004,23 +1007,26 @@ func canonicalizeNewNodePoolConfigRootVolumeSet(c *Client, des, nw []NodePoolCon if des == nil { return nw } - var reorderedNew []NodePoolConfigRootVolume + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfigRootVolume for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigRootVolumeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfigRootVolume(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigRootVolumeSlice(c *Client, des, nw []NodePoolConfigRootVolume) []NodePoolConfigRootVolume { @@ -1133,23 +1139,26 @@ func canonicalizeNewNodePoolConfigTaintsSet(c *Client, des, nw []NodePoolConfigT if des == nil { return nw } - var reorderedNew []NodePoolConfigTaints + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfigTaints for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigTaintsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfigTaints(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigTaintsSlice(c *Client, des, nw []NodePoolConfigTaints) []NodePoolConfigTaints { @@ -1248,23 +1257,26 @@ func canonicalizeNewNodePoolConfigConfigEncryptionSet(c *Client, des, nw []NodeP if des == nil { return nw } - var reorderedNew []NodePoolConfigConfigEncryption + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfigConfigEncryption for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigConfigEncryptionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfigConfigEncryption(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigConfigEncryptionSlice(c *Client, des, nw []NodePoolConfigConfigEncryption) []NodePoolConfigConfigEncryption { @@ -1363,23 +1375,26 @@ func canonicalizeNewNodePoolConfigSshConfigSet(c *Client, des, nw []NodePoolConf if des == nil { return nw } - var reorderedNew []NodePoolConfigSshConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfigSshConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigSshConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfigSshConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigSshConfigSlice(c *Client, des, nw []NodePoolConfigSshConfig) []NodePoolConfigSshConfig { @@ -1486,23 +1501,26 @@ func canonicalizeNewNodePoolConfigProxyConfigSet(c *Client, des, nw []NodePoolCo if des == nil { return nw } - var reorderedNew []NodePoolConfigProxyConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfigProxyConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigProxyConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfigProxyConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigProxyConfigSlice(c *Client, des, nw []NodePoolConfigProxyConfig) []NodePoolConfigProxyConfig { @@ -1598,23 +1616,26 @@ func canonicalizeNewNodePoolConfigInstancePlacementSet(c *Client, des, nw []Node if des == nil { return nw } - var reorderedNew []NodePoolConfigInstancePlacement + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfigInstancePlacement for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigInstancePlacementNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfigInstancePlacement(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigInstancePlacementSlice(c *Client, des, nw []NodePoolConfigInstancePlacement) []NodePoolConfigInstancePlacement { @@ -1721,23 +1742,26 @@ func canonicalizeNewNodePoolConfigAutoscalingMetricsCollectionSet(c *Client, des if des == nil { return nw } - var reorderedNew []NodePoolConfigAutoscalingMetricsCollection + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfigAutoscalingMetricsCollection for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigAutoscalingMetricsCollectionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfigAutoscalingMetricsCollection(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigAutoscalingMetricsCollectionSlice(c *Client, des, nw []NodePoolConfigAutoscalingMetricsCollection) []NodePoolConfigAutoscalingMetricsCollection { @@ -1839,23 +1863,26 @@ func canonicalizeNewNodePoolAutoscalingSet(c *Client, des, nw []NodePoolAutoscal if des == nil { return nw } - var reorderedNew []NodePoolAutoscaling + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolAutoscaling for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolAutoscalingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolAutoscaling(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolAutoscalingSlice(c *Client, des, nw []NodePoolAutoscaling) []NodePoolAutoscaling { @@ -1951,23 +1978,26 @@ func canonicalizeNewNodePoolMaxPodsConstraintSet(c *Client, des, nw []NodePoolMa if des == nil { return nw } - var reorderedNew []NodePoolMaxPodsConstraint + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolMaxPodsConstraint for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolMaxPodsConstraintNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolMaxPodsConstraint(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolMaxPodsConstraintSlice(c *Client, des, nw []NodePoolMaxPodsConstraint) []NodePoolMaxPodsConstraint { diff --git a/services/google/containeraws/beta/cluster_internal.go b/services/google/containeraws/beta/cluster_internal.go index 5cef7bb170..abd3050eaf 100755 --- a/services/google/containeraws/beta/cluster_internal.go +++ b/services/google/containeraws/beta/cluster_internal.go @@ -950,23 +950,26 @@ func canonicalizeNewClusterNetworkingSet(c *Client, des, nw []ClusterNetworking) if des == nil { return nw } - var reorderedNew []ClusterNetworking + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterNetworking for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterNetworkingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterNetworking(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterNetworkingSlice(c *Client, des, nw []ClusterNetworking) []ClusterNetworking { @@ -1119,23 +1122,26 @@ func canonicalizeNewClusterControlPlaneSet(c *Client, des, nw []ClusterControlPl if des == nil { return nw } - var reorderedNew []ClusterControlPlane + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlane for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlane(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneSlice(c *Client, des, nw []ClusterControlPlane) []ClusterControlPlane { @@ -1234,23 +1240,26 @@ func canonicalizeNewClusterControlPlaneSshConfigSet(c *Client, des, nw []Cluster if des == nil { return nw } - var reorderedNew []ClusterControlPlaneSshConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneSshConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneSshConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneSshConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneSshConfigSlice(c *Client, des, nw []ClusterControlPlaneSshConfig) []ClusterControlPlaneSshConfig { @@ -1349,23 +1358,26 @@ func canonicalizeNewClusterControlPlaneConfigEncryptionSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []ClusterControlPlaneConfigEncryption + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneConfigEncryption for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneConfigEncryptionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneConfigEncryption(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneConfigEncryptionSlice(c *Client, des, nw []ClusterControlPlaneConfigEncryption) []ClusterControlPlaneConfigEncryption { @@ -1482,23 +1494,26 @@ func canonicalizeNewClusterControlPlaneRootVolumeSet(c *Client, des, nw []Cluste if des == nil { return nw } - var reorderedNew []ClusterControlPlaneRootVolume + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneRootVolume for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneRootVolumeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneRootVolume(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneRootVolumeSlice(c *Client, des, nw []ClusterControlPlaneRootVolume) []ClusterControlPlaneRootVolume { @@ -1615,23 +1630,26 @@ func canonicalizeNewClusterControlPlaneMainVolumeSet(c *Client, des, nw []Cluste if des == nil { return nw } - var reorderedNew []ClusterControlPlaneMainVolume + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneMainVolume for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneMainVolumeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneMainVolume(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneMainVolumeSlice(c *Client, des, nw []ClusterControlPlaneMainVolume) []ClusterControlPlaneMainVolume { @@ -1730,23 +1748,26 @@ func canonicalizeNewClusterControlPlaneDatabaseEncryptionSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []ClusterControlPlaneDatabaseEncryption + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneDatabaseEncryption for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneDatabaseEncryptionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneDatabaseEncryption(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneDatabaseEncryptionSlice(c *Client, des, nw []ClusterControlPlaneDatabaseEncryption) []ClusterControlPlaneDatabaseEncryption { @@ -1853,23 +1874,26 @@ func canonicalizeNewClusterControlPlaneAwsServicesAuthenticationSet(c *Client, d if des == nil { return nw } - var reorderedNew []ClusterControlPlaneAwsServicesAuthentication + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneAwsServicesAuthentication for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneAwsServicesAuthenticationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneAwsServicesAuthentication(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneAwsServicesAuthenticationSlice(c *Client, des, nw []ClusterControlPlaneAwsServicesAuthentication) []ClusterControlPlaneAwsServicesAuthentication { @@ -1976,23 +2000,26 @@ func canonicalizeNewClusterControlPlaneProxyConfigSet(c *Client, des, nw []Clust if des == nil { return nw } - var reorderedNew []ClusterControlPlaneProxyConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneProxyConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneProxyConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneProxyConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneProxyConfigSlice(c *Client, des, nw []ClusterControlPlaneProxyConfig) []ClusterControlPlaneProxyConfig { @@ -2088,23 +2115,26 @@ func canonicalizeNewClusterControlPlaneInstancePlacementSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []ClusterControlPlaneInstancePlacement + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneInstancePlacement for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneInstancePlacementNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneInstancePlacement(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneInstancePlacementSlice(c *Client, des, nw []ClusterControlPlaneInstancePlacement) []ClusterControlPlaneInstancePlacement { @@ -2197,23 +2227,26 @@ func canonicalizeNewClusterAuthorizationSet(c *Client, des, nw []ClusterAuthoriz if des == nil { return nw } - var reorderedNew []ClusterAuthorization + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterAuthorization for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterAuthorizationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterAuthorization(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterAuthorizationSlice(c *Client, des, nw []ClusterAuthorization) []ClusterAuthorization { @@ -2312,23 +2345,26 @@ func canonicalizeNewClusterAuthorizationAdminUsersSet(c *Client, des, nw []Clust if des == nil { return nw } - var reorderedNew []ClusterAuthorizationAdminUsers + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterAuthorizationAdminUsers for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterAuthorizationAdminUsersNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterAuthorizationAdminUsers(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterAuthorizationAdminUsersSlice(c *Client, des, nw []ClusterAuthorizationAdminUsers) []ClusterAuthorizationAdminUsers { @@ -2443,23 +2479,26 @@ func canonicalizeNewClusterWorkloadIdentityConfigSet(c *Client, des, nw []Cluste if des == nil { return nw } - var reorderedNew []ClusterWorkloadIdentityConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterWorkloadIdentityConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterWorkloadIdentityConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterWorkloadIdentityConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterWorkloadIdentityConfigSlice(c *Client, des, nw []ClusterWorkloadIdentityConfig) []ClusterWorkloadIdentityConfig { @@ -2561,23 +2600,26 @@ func canonicalizeNewClusterFleetSet(c *Client, des, nw []ClusterFleet) []Cluster if des == nil { return nw } - var reorderedNew []ClusterFleet + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterFleet for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterFleetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterFleet(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterFleetSlice(c *Client, des, nw []ClusterFleet) []ClusterFleet { @@ -2670,23 +2712,26 @@ func canonicalizeNewClusterLoggingConfigSet(c *Client, des, nw []ClusterLoggingC if des == nil { return nw } - var reorderedNew []ClusterLoggingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterLoggingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterLoggingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterLoggingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterLoggingConfigSlice(c *Client, des, nw []ClusterLoggingConfig) []ClusterLoggingConfig { @@ -2782,23 +2827,26 @@ func canonicalizeNewClusterLoggingConfigComponentConfigSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []ClusterLoggingConfigComponentConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterLoggingConfigComponentConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterLoggingConfigComponentConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterLoggingConfigComponentConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterLoggingConfigComponentConfigSlice(c *Client, des, nw []ClusterLoggingConfigComponentConfig) []ClusterLoggingConfigComponentConfig { @@ -2891,23 +2939,26 @@ func canonicalizeNewClusterMonitoringConfigSet(c *Client, des, nw []ClusterMonit if des == nil { return nw } - var reorderedNew []ClusterMonitoringConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterMonitoringConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterMonitoringConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterMonitoringConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterMonitoringConfigSlice(c *Client, des, nw []ClusterMonitoringConfig) []ClusterMonitoringConfig { @@ -3006,23 +3057,26 @@ func canonicalizeNewClusterMonitoringConfigManagedPrometheusConfigSet(c *Client, if des == nil { return nw } - var reorderedNew []ClusterMonitoringConfigManagedPrometheusConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterMonitoringConfigManagedPrometheusConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterMonitoringConfigManagedPrometheusConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterMonitoringConfigManagedPrometheusConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterMonitoringConfigManagedPrometheusConfigSlice(c *Client, des, nw []ClusterMonitoringConfigManagedPrometheusConfig) []ClusterMonitoringConfigManagedPrometheusConfig { diff --git a/services/google/containeraws/beta/node_pool_internal.go b/services/google/containeraws/beta/node_pool_internal.go index a4cdf8bdc5..d8102df561 100755 --- a/services/google/containeraws/beta/node_pool_internal.go +++ b/services/google/containeraws/beta/node_pool_internal.go @@ -871,23 +871,26 @@ func canonicalizeNewNodePoolConfigSet(c *Client, des, nw []NodePoolConfig) []Nod if des == nil { return nw } - var reorderedNew []NodePoolConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigSlice(c *Client, des, nw []NodePoolConfig) []NodePoolConfig { @@ -1004,23 +1007,26 @@ func canonicalizeNewNodePoolConfigRootVolumeSet(c *Client, des, nw []NodePoolCon if des == nil { return nw } - var reorderedNew []NodePoolConfigRootVolume + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfigRootVolume for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigRootVolumeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfigRootVolume(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigRootVolumeSlice(c *Client, des, nw []NodePoolConfigRootVolume) []NodePoolConfigRootVolume { @@ -1133,23 +1139,26 @@ func canonicalizeNewNodePoolConfigTaintsSet(c *Client, des, nw []NodePoolConfigT if des == nil { return nw } - var reorderedNew []NodePoolConfigTaints + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfigTaints for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigTaintsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfigTaints(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigTaintsSlice(c *Client, des, nw []NodePoolConfigTaints) []NodePoolConfigTaints { @@ -1248,23 +1257,26 @@ func canonicalizeNewNodePoolConfigConfigEncryptionSet(c *Client, des, nw []NodeP if des == nil { return nw } - var reorderedNew []NodePoolConfigConfigEncryption + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfigConfigEncryption for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigConfigEncryptionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfigConfigEncryption(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigConfigEncryptionSlice(c *Client, des, nw []NodePoolConfigConfigEncryption) []NodePoolConfigConfigEncryption { @@ -1363,23 +1375,26 @@ func canonicalizeNewNodePoolConfigSshConfigSet(c *Client, des, nw []NodePoolConf if des == nil { return nw } - var reorderedNew []NodePoolConfigSshConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfigSshConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigSshConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfigSshConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigSshConfigSlice(c *Client, des, nw []NodePoolConfigSshConfig) []NodePoolConfigSshConfig { @@ -1486,23 +1501,26 @@ func canonicalizeNewNodePoolConfigProxyConfigSet(c *Client, des, nw []NodePoolCo if des == nil { return nw } - var reorderedNew []NodePoolConfigProxyConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfigProxyConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigProxyConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfigProxyConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigProxyConfigSlice(c *Client, des, nw []NodePoolConfigProxyConfig) []NodePoolConfigProxyConfig { @@ -1598,23 +1616,26 @@ func canonicalizeNewNodePoolConfigInstancePlacementSet(c *Client, des, nw []Node if des == nil { return nw } - var reorderedNew []NodePoolConfigInstancePlacement + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfigInstancePlacement for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigInstancePlacementNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfigInstancePlacement(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigInstancePlacementSlice(c *Client, des, nw []NodePoolConfigInstancePlacement) []NodePoolConfigInstancePlacement { @@ -1721,23 +1742,26 @@ func canonicalizeNewNodePoolConfigAutoscalingMetricsCollectionSet(c *Client, des if des == nil { return nw } - var reorderedNew []NodePoolConfigAutoscalingMetricsCollection + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfigAutoscalingMetricsCollection for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigAutoscalingMetricsCollectionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfigAutoscalingMetricsCollection(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigAutoscalingMetricsCollectionSlice(c *Client, des, nw []NodePoolConfigAutoscalingMetricsCollection) []NodePoolConfigAutoscalingMetricsCollection { @@ -1839,23 +1863,26 @@ func canonicalizeNewNodePoolAutoscalingSet(c *Client, des, nw []NodePoolAutoscal if des == nil { return nw } - var reorderedNew []NodePoolAutoscaling + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolAutoscaling for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolAutoscalingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolAutoscaling(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolAutoscalingSlice(c *Client, des, nw []NodePoolAutoscaling) []NodePoolAutoscaling { @@ -1951,23 +1978,26 @@ func canonicalizeNewNodePoolMaxPodsConstraintSet(c *Client, des, nw []NodePoolMa if des == nil { return nw } - var reorderedNew []NodePoolMaxPodsConstraint + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolMaxPodsConstraint for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolMaxPodsConstraintNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolMaxPodsConstraint(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolMaxPodsConstraintSlice(c *Client, des, nw []NodePoolMaxPodsConstraint) []NodePoolMaxPodsConstraint { diff --git a/services/google/containeraws/cluster_internal.go b/services/google/containeraws/cluster_internal.go index f0855238ae..b67831988a 100755 --- a/services/google/containeraws/cluster_internal.go +++ b/services/google/containeraws/cluster_internal.go @@ -884,23 +884,26 @@ func canonicalizeNewClusterNetworkingSet(c *Client, des, nw []ClusterNetworking) if des == nil { return nw } - var reorderedNew []ClusterNetworking + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterNetworking for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterNetworkingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterNetworking(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterNetworkingSlice(c *Client, des, nw []ClusterNetworking) []ClusterNetworking { @@ -1051,23 +1054,26 @@ func canonicalizeNewClusterControlPlaneSet(c *Client, des, nw []ClusterControlPl if des == nil { return nw } - var reorderedNew []ClusterControlPlane + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlane for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlane(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneSlice(c *Client, des, nw []ClusterControlPlane) []ClusterControlPlane { @@ -1166,23 +1172,26 @@ func canonicalizeNewClusterControlPlaneSshConfigSet(c *Client, des, nw []Cluster if des == nil { return nw } - var reorderedNew []ClusterControlPlaneSshConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneSshConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneSshConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneSshConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneSshConfigSlice(c *Client, des, nw []ClusterControlPlaneSshConfig) []ClusterControlPlaneSshConfig { @@ -1281,23 +1290,26 @@ func canonicalizeNewClusterControlPlaneConfigEncryptionSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []ClusterControlPlaneConfigEncryption + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneConfigEncryption for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneConfigEncryptionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneConfigEncryption(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneConfigEncryptionSlice(c *Client, des, nw []ClusterControlPlaneConfigEncryption) []ClusterControlPlaneConfigEncryption { @@ -1414,23 +1426,26 @@ func canonicalizeNewClusterControlPlaneRootVolumeSet(c *Client, des, nw []Cluste if des == nil { return nw } - var reorderedNew []ClusterControlPlaneRootVolume + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneRootVolume for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneRootVolumeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneRootVolume(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneRootVolumeSlice(c *Client, des, nw []ClusterControlPlaneRootVolume) []ClusterControlPlaneRootVolume { @@ -1547,23 +1562,26 @@ func canonicalizeNewClusterControlPlaneMainVolumeSet(c *Client, des, nw []Cluste if des == nil { return nw } - var reorderedNew []ClusterControlPlaneMainVolume + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneMainVolume for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneMainVolumeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneMainVolume(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneMainVolumeSlice(c *Client, des, nw []ClusterControlPlaneMainVolume) []ClusterControlPlaneMainVolume { @@ -1662,23 +1680,26 @@ func canonicalizeNewClusterControlPlaneDatabaseEncryptionSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []ClusterControlPlaneDatabaseEncryption + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneDatabaseEncryption for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneDatabaseEncryptionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneDatabaseEncryption(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneDatabaseEncryptionSlice(c *Client, des, nw []ClusterControlPlaneDatabaseEncryption) []ClusterControlPlaneDatabaseEncryption { @@ -1785,23 +1806,26 @@ func canonicalizeNewClusterControlPlaneAwsServicesAuthenticationSet(c *Client, d if des == nil { return nw } - var reorderedNew []ClusterControlPlaneAwsServicesAuthentication + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneAwsServicesAuthentication for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneAwsServicesAuthenticationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneAwsServicesAuthentication(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneAwsServicesAuthenticationSlice(c *Client, des, nw []ClusterControlPlaneAwsServicesAuthentication) []ClusterControlPlaneAwsServicesAuthentication { @@ -1908,23 +1932,26 @@ func canonicalizeNewClusterControlPlaneProxyConfigSet(c *Client, des, nw []Clust if des == nil { return nw } - var reorderedNew []ClusterControlPlaneProxyConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneProxyConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneProxyConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneProxyConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneProxyConfigSlice(c *Client, des, nw []ClusterControlPlaneProxyConfig) []ClusterControlPlaneProxyConfig { @@ -2017,23 +2044,26 @@ func canonicalizeNewClusterAuthorizationSet(c *Client, des, nw []ClusterAuthoriz if des == nil { return nw } - var reorderedNew []ClusterAuthorization + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterAuthorization for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterAuthorizationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterAuthorization(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterAuthorizationSlice(c *Client, des, nw []ClusterAuthorization) []ClusterAuthorization { @@ -2132,23 +2162,26 @@ func canonicalizeNewClusterAuthorizationAdminUsersSet(c *Client, des, nw []Clust if des == nil { return nw } - var reorderedNew []ClusterAuthorizationAdminUsers + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterAuthorizationAdminUsers for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterAuthorizationAdminUsersNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterAuthorizationAdminUsers(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterAuthorizationAdminUsersSlice(c *Client, des, nw []ClusterAuthorizationAdminUsers) []ClusterAuthorizationAdminUsers { @@ -2263,23 +2296,26 @@ func canonicalizeNewClusterWorkloadIdentityConfigSet(c *Client, des, nw []Cluste if des == nil { return nw } - var reorderedNew []ClusterWorkloadIdentityConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterWorkloadIdentityConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterWorkloadIdentityConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterWorkloadIdentityConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterWorkloadIdentityConfigSlice(c *Client, des, nw []ClusterWorkloadIdentityConfig) []ClusterWorkloadIdentityConfig { @@ -2381,23 +2417,26 @@ func canonicalizeNewClusterFleetSet(c *Client, des, nw []ClusterFleet) []Cluster if des == nil { return nw } - var reorderedNew []ClusterFleet + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterFleet for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterFleetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterFleet(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterFleetSlice(c *Client, des, nw []ClusterFleet) []ClusterFleet { diff --git a/services/google/containeraws/node_pool_internal.go b/services/google/containeraws/node_pool_internal.go index cfd7d20268..f3fa23afb2 100755 --- a/services/google/containeraws/node_pool_internal.go +++ b/services/google/containeraws/node_pool_internal.go @@ -853,23 +853,26 @@ func canonicalizeNewNodePoolConfigSet(c *Client, des, nw []NodePoolConfig) []Nod if des == nil { return nw } - var reorderedNew []NodePoolConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigSlice(c *Client, des, nw []NodePoolConfig) []NodePoolConfig { @@ -986,23 +989,26 @@ func canonicalizeNewNodePoolConfigRootVolumeSet(c *Client, des, nw []NodePoolCon if des == nil { return nw } - var reorderedNew []NodePoolConfigRootVolume + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfigRootVolume for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigRootVolumeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfigRootVolume(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigRootVolumeSlice(c *Client, des, nw []NodePoolConfigRootVolume) []NodePoolConfigRootVolume { @@ -1115,23 +1121,26 @@ func canonicalizeNewNodePoolConfigTaintsSet(c *Client, des, nw []NodePoolConfigT if des == nil { return nw } - var reorderedNew []NodePoolConfigTaints + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfigTaints for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigTaintsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfigTaints(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigTaintsSlice(c *Client, des, nw []NodePoolConfigTaints) []NodePoolConfigTaints { @@ -1230,23 +1239,26 @@ func canonicalizeNewNodePoolConfigConfigEncryptionSet(c *Client, des, nw []NodeP if des == nil { return nw } - var reorderedNew []NodePoolConfigConfigEncryption + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfigConfigEncryption for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigConfigEncryptionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfigConfigEncryption(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigConfigEncryptionSlice(c *Client, des, nw []NodePoolConfigConfigEncryption) []NodePoolConfigConfigEncryption { @@ -1345,23 +1357,26 @@ func canonicalizeNewNodePoolConfigSshConfigSet(c *Client, des, nw []NodePoolConf if des == nil { return nw } - var reorderedNew []NodePoolConfigSshConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfigSshConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigSshConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfigSshConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigSshConfigSlice(c *Client, des, nw []NodePoolConfigSshConfig) []NodePoolConfigSshConfig { @@ -1468,23 +1483,26 @@ func canonicalizeNewNodePoolConfigProxyConfigSet(c *Client, des, nw []NodePoolCo if des == nil { return nw } - var reorderedNew []NodePoolConfigProxyConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfigProxyConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigProxyConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfigProxyConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigProxyConfigSlice(c *Client, des, nw []NodePoolConfigProxyConfig) []NodePoolConfigProxyConfig { @@ -1591,23 +1609,26 @@ func canonicalizeNewNodePoolConfigAutoscalingMetricsCollectionSet(c *Client, des if des == nil { return nw } - var reorderedNew []NodePoolConfigAutoscalingMetricsCollection + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfigAutoscalingMetricsCollection for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigAutoscalingMetricsCollectionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfigAutoscalingMetricsCollection(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigAutoscalingMetricsCollectionSlice(c *Client, des, nw []NodePoolConfigAutoscalingMetricsCollection) []NodePoolConfigAutoscalingMetricsCollection { @@ -1709,23 +1730,26 @@ func canonicalizeNewNodePoolAutoscalingSet(c *Client, des, nw []NodePoolAutoscal if des == nil { return nw } - var reorderedNew []NodePoolAutoscaling + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolAutoscaling for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolAutoscalingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolAutoscaling(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolAutoscalingSlice(c *Client, des, nw []NodePoolAutoscaling) []NodePoolAutoscaling { @@ -1821,23 +1845,26 @@ func canonicalizeNewNodePoolMaxPodsConstraintSet(c *Client, des, nw []NodePoolMa if des == nil { return nw } - var reorderedNew []NodePoolMaxPodsConstraint + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolMaxPodsConstraint for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolMaxPodsConstraintNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolMaxPodsConstraint(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolMaxPodsConstraintSlice(c *Client, des, nw []NodePoolMaxPodsConstraint) []NodePoolMaxPodsConstraint { diff --git a/services/google/containerazure/alpha/cluster_internal.go b/services/google/containerazure/alpha/cluster_internal.go index 5980794947..5e7b8326aa 100755 --- a/services/google/containerazure/alpha/cluster_internal.go +++ b/services/google/containerazure/alpha/cluster_internal.go @@ -950,23 +950,26 @@ func canonicalizeNewClusterNetworkingSet(c *Client, des, nw []ClusterNetworking) if des == nil { return nw } - var reorderedNew []ClusterNetworking + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterNetworking for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterNetworkingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterNetworking(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterNetworkingSlice(c *Client, des, nw []ClusterNetworking) []ClusterNetworking { @@ -1099,23 +1102,26 @@ func canonicalizeNewClusterControlPlaneSet(c *Client, des, nw []ClusterControlPl if des == nil { return nw } - var reorderedNew []ClusterControlPlane + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlane for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlane(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneSlice(c *Client, des, nw []ClusterControlPlane) []ClusterControlPlane { @@ -1214,23 +1220,26 @@ func canonicalizeNewClusterControlPlaneSshConfigSet(c *Client, des, nw []Cluster if des == nil { return nw } - var reorderedNew []ClusterControlPlaneSshConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneSshConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneSshConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneSshConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneSshConfigSlice(c *Client, des, nw []ClusterControlPlaneSshConfig) []ClusterControlPlaneSshConfig { @@ -1326,23 +1335,26 @@ func canonicalizeNewClusterControlPlaneRootVolumeSet(c *Client, des, nw []Cluste if des == nil { return nw } - var reorderedNew []ClusterControlPlaneRootVolume + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneRootVolume for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneRootVolumeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneRootVolume(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneRootVolumeSlice(c *Client, des, nw []ClusterControlPlaneRootVolume) []ClusterControlPlaneRootVolume { @@ -1438,23 +1450,26 @@ func canonicalizeNewClusterControlPlaneMainVolumeSet(c *Client, des, nw []Cluste if des == nil { return nw } - var reorderedNew []ClusterControlPlaneMainVolume + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneMainVolume for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneMainVolumeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneMainVolume(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneMainVolumeSlice(c *Client, des, nw []ClusterControlPlaneMainVolume) []ClusterControlPlaneMainVolume { @@ -1553,23 +1568,26 @@ func canonicalizeNewClusterControlPlaneDatabaseEncryptionSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []ClusterControlPlaneDatabaseEncryption + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneDatabaseEncryption for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneDatabaseEncryptionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneDatabaseEncryption(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneDatabaseEncryptionSlice(c *Client, des, nw []ClusterControlPlaneDatabaseEncryption) []ClusterControlPlaneDatabaseEncryption { @@ -1676,23 +1694,26 @@ func canonicalizeNewClusterControlPlaneProxyConfigSet(c *Client, des, nw []Clust if des == nil { return nw } - var reorderedNew []ClusterControlPlaneProxyConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneProxyConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneProxyConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneProxyConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneProxyConfigSlice(c *Client, des, nw []ClusterControlPlaneProxyConfig) []ClusterControlPlaneProxyConfig { @@ -1799,23 +1820,26 @@ func canonicalizeNewClusterControlPlaneReplicaPlacementsSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []ClusterControlPlaneReplicaPlacements + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneReplicaPlacements for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneReplicaPlacementsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneReplicaPlacements(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneReplicaPlacementsSlice(c *Client, des, nw []ClusterControlPlaneReplicaPlacements) []ClusterControlPlaneReplicaPlacements { @@ -1908,23 +1932,26 @@ func canonicalizeNewClusterAuthorizationSet(c *Client, des, nw []ClusterAuthoriz if des == nil { return nw } - var reorderedNew []ClusterAuthorization + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterAuthorization for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterAuthorizationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterAuthorization(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterAuthorizationSlice(c *Client, des, nw []ClusterAuthorization) []ClusterAuthorization { @@ -2023,23 +2050,26 @@ func canonicalizeNewClusterAuthorizationAdminUsersSet(c *Client, des, nw []Clust if des == nil { return nw } - var reorderedNew []ClusterAuthorizationAdminUsers + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterAuthorizationAdminUsers for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterAuthorizationAdminUsersNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterAuthorizationAdminUsers(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterAuthorizationAdminUsersSlice(c *Client, des, nw []ClusterAuthorizationAdminUsers) []ClusterAuthorizationAdminUsers { @@ -2154,23 +2184,26 @@ func canonicalizeNewClusterWorkloadIdentityConfigSet(c *Client, des, nw []Cluste if des == nil { return nw } - var reorderedNew []ClusterWorkloadIdentityConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterWorkloadIdentityConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterWorkloadIdentityConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterWorkloadIdentityConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterWorkloadIdentityConfigSlice(c *Client, des, nw []ClusterWorkloadIdentityConfig) []ClusterWorkloadIdentityConfig { @@ -2272,23 +2305,26 @@ func canonicalizeNewClusterFleetSet(c *Client, des, nw []ClusterFleet) []Cluster if des == nil { return nw } - var reorderedNew []ClusterFleet + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterFleet for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterFleetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterFleet(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterFleetSlice(c *Client, des, nw []ClusterFleet) []ClusterFleet { @@ -2381,23 +2417,26 @@ func canonicalizeNewClusterLoggingConfigSet(c *Client, des, nw []ClusterLoggingC if des == nil { return nw } - var reorderedNew []ClusterLoggingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterLoggingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterLoggingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterLoggingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterLoggingConfigSlice(c *Client, des, nw []ClusterLoggingConfig) []ClusterLoggingConfig { @@ -2493,23 +2532,26 @@ func canonicalizeNewClusterLoggingConfigComponentConfigSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []ClusterLoggingConfigComponentConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterLoggingConfigComponentConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterLoggingConfigComponentConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterLoggingConfigComponentConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterLoggingConfigComponentConfigSlice(c *Client, des, nw []ClusterLoggingConfigComponentConfig) []ClusterLoggingConfigComponentConfig { @@ -2602,23 +2644,26 @@ func canonicalizeNewClusterMonitoringConfigSet(c *Client, des, nw []ClusterMonit if des == nil { return nw } - var reorderedNew []ClusterMonitoringConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterMonitoringConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterMonitoringConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterMonitoringConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterMonitoringConfigSlice(c *Client, des, nw []ClusterMonitoringConfig) []ClusterMonitoringConfig { @@ -2717,23 +2762,26 @@ func canonicalizeNewClusterMonitoringConfigManagedPrometheusConfigSet(c *Client, if des == nil { return nw } - var reorderedNew []ClusterMonitoringConfigManagedPrometheusConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterMonitoringConfigManagedPrometheusConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterMonitoringConfigManagedPrometheusConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterMonitoringConfigManagedPrometheusConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterMonitoringConfigManagedPrometheusConfigSlice(c *Client, des, nw []ClusterMonitoringConfigManagedPrometheusConfig) []ClusterMonitoringConfigManagedPrometheusConfig { diff --git a/services/google/containerazure/alpha/node_pool_internal.go b/services/google/containerazure/alpha/node_pool_internal.go index 9971f4080a..203d2d77aa 100755 --- a/services/google/containerazure/alpha/node_pool_internal.go +++ b/services/google/containerazure/alpha/node_pool_internal.go @@ -809,23 +809,26 @@ func canonicalizeNewNodePoolConfigSet(c *Client, des, nw []NodePoolConfig) []Nod if des == nil { return nw } - var reorderedNew []NodePoolConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigSlice(c *Client, des, nw []NodePoolConfig) []NodePoolConfig { @@ -921,23 +924,26 @@ func canonicalizeNewNodePoolConfigRootVolumeSet(c *Client, des, nw []NodePoolCon if des == nil { return nw } - var reorderedNew []NodePoolConfigRootVolume + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfigRootVolume for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigRootVolumeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfigRootVolume(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigRootVolumeSlice(c *Client, des, nw []NodePoolConfigRootVolume) []NodePoolConfigRootVolume { @@ -1036,23 +1042,26 @@ func canonicalizeNewNodePoolConfigSshConfigSet(c *Client, des, nw []NodePoolConf if des == nil { return nw } - var reorderedNew []NodePoolConfigSshConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfigSshConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigSshConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfigSshConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigSshConfigSlice(c *Client, des, nw []NodePoolConfigSshConfig) []NodePoolConfigSshConfig { @@ -1159,23 +1168,26 @@ func canonicalizeNewNodePoolConfigProxyConfigSet(c *Client, des, nw []NodePoolCo if des == nil { return nw } - var reorderedNew []NodePoolConfigProxyConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfigProxyConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigProxyConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfigProxyConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigProxyConfigSlice(c *Client, des, nw []NodePoolConfigProxyConfig) []NodePoolConfigProxyConfig { @@ -1277,23 +1289,26 @@ func canonicalizeNewNodePoolAutoscalingSet(c *Client, des, nw []NodePoolAutoscal if des == nil { return nw } - var reorderedNew []NodePoolAutoscaling + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolAutoscaling for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolAutoscalingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolAutoscaling(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolAutoscalingSlice(c *Client, des, nw []NodePoolAutoscaling) []NodePoolAutoscaling { @@ -1389,23 +1404,26 @@ func canonicalizeNewNodePoolMaxPodsConstraintSet(c *Client, des, nw []NodePoolMa if des == nil { return nw } - var reorderedNew []NodePoolMaxPodsConstraint + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolMaxPodsConstraint for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolMaxPodsConstraintNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolMaxPodsConstraint(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolMaxPodsConstraintSlice(c *Client, des, nw []NodePoolMaxPodsConstraint) []NodePoolMaxPodsConstraint { diff --git a/services/google/containerazure/beta/cluster_internal.go b/services/google/containerazure/beta/cluster_internal.go index dae4669bcf..d7017e1ab2 100755 --- a/services/google/containerazure/beta/cluster_internal.go +++ b/services/google/containerazure/beta/cluster_internal.go @@ -950,23 +950,26 @@ func canonicalizeNewClusterNetworkingSet(c *Client, des, nw []ClusterNetworking) if des == nil { return nw } - var reorderedNew []ClusterNetworking + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterNetworking for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterNetworkingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterNetworking(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterNetworkingSlice(c *Client, des, nw []ClusterNetworking) []ClusterNetworking { @@ -1099,23 +1102,26 @@ func canonicalizeNewClusterControlPlaneSet(c *Client, des, nw []ClusterControlPl if des == nil { return nw } - var reorderedNew []ClusterControlPlane + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlane for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlane(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneSlice(c *Client, des, nw []ClusterControlPlane) []ClusterControlPlane { @@ -1214,23 +1220,26 @@ func canonicalizeNewClusterControlPlaneSshConfigSet(c *Client, des, nw []Cluster if des == nil { return nw } - var reorderedNew []ClusterControlPlaneSshConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneSshConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneSshConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneSshConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneSshConfigSlice(c *Client, des, nw []ClusterControlPlaneSshConfig) []ClusterControlPlaneSshConfig { @@ -1326,23 +1335,26 @@ func canonicalizeNewClusterControlPlaneRootVolumeSet(c *Client, des, nw []Cluste if des == nil { return nw } - var reorderedNew []ClusterControlPlaneRootVolume + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneRootVolume for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneRootVolumeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneRootVolume(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneRootVolumeSlice(c *Client, des, nw []ClusterControlPlaneRootVolume) []ClusterControlPlaneRootVolume { @@ -1438,23 +1450,26 @@ func canonicalizeNewClusterControlPlaneMainVolumeSet(c *Client, des, nw []Cluste if des == nil { return nw } - var reorderedNew []ClusterControlPlaneMainVolume + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneMainVolume for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneMainVolumeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneMainVolume(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneMainVolumeSlice(c *Client, des, nw []ClusterControlPlaneMainVolume) []ClusterControlPlaneMainVolume { @@ -1553,23 +1568,26 @@ func canonicalizeNewClusterControlPlaneDatabaseEncryptionSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []ClusterControlPlaneDatabaseEncryption + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneDatabaseEncryption for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneDatabaseEncryptionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneDatabaseEncryption(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneDatabaseEncryptionSlice(c *Client, des, nw []ClusterControlPlaneDatabaseEncryption) []ClusterControlPlaneDatabaseEncryption { @@ -1676,23 +1694,26 @@ func canonicalizeNewClusterControlPlaneProxyConfigSet(c *Client, des, nw []Clust if des == nil { return nw } - var reorderedNew []ClusterControlPlaneProxyConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneProxyConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneProxyConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneProxyConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneProxyConfigSlice(c *Client, des, nw []ClusterControlPlaneProxyConfig) []ClusterControlPlaneProxyConfig { @@ -1799,23 +1820,26 @@ func canonicalizeNewClusterControlPlaneReplicaPlacementsSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []ClusterControlPlaneReplicaPlacements + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneReplicaPlacements for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneReplicaPlacementsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneReplicaPlacements(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneReplicaPlacementsSlice(c *Client, des, nw []ClusterControlPlaneReplicaPlacements) []ClusterControlPlaneReplicaPlacements { @@ -1908,23 +1932,26 @@ func canonicalizeNewClusterAuthorizationSet(c *Client, des, nw []ClusterAuthoriz if des == nil { return nw } - var reorderedNew []ClusterAuthorization + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterAuthorization for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterAuthorizationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterAuthorization(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterAuthorizationSlice(c *Client, des, nw []ClusterAuthorization) []ClusterAuthorization { @@ -2023,23 +2050,26 @@ func canonicalizeNewClusterAuthorizationAdminUsersSet(c *Client, des, nw []Clust if des == nil { return nw } - var reorderedNew []ClusterAuthorizationAdminUsers + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterAuthorizationAdminUsers for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterAuthorizationAdminUsersNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterAuthorizationAdminUsers(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterAuthorizationAdminUsersSlice(c *Client, des, nw []ClusterAuthorizationAdminUsers) []ClusterAuthorizationAdminUsers { @@ -2154,23 +2184,26 @@ func canonicalizeNewClusterWorkloadIdentityConfigSet(c *Client, des, nw []Cluste if des == nil { return nw } - var reorderedNew []ClusterWorkloadIdentityConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterWorkloadIdentityConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterWorkloadIdentityConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterWorkloadIdentityConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterWorkloadIdentityConfigSlice(c *Client, des, nw []ClusterWorkloadIdentityConfig) []ClusterWorkloadIdentityConfig { @@ -2272,23 +2305,26 @@ func canonicalizeNewClusterFleetSet(c *Client, des, nw []ClusterFleet) []Cluster if des == nil { return nw } - var reorderedNew []ClusterFleet + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterFleet for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterFleetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterFleet(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterFleetSlice(c *Client, des, nw []ClusterFleet) []ClusterFleet { @@ -2381,23 +2417,26 @@ func canonicalizeNewClusterLoggingConfigSet(c *Client, des, nw []ClusterLoggingC if des == nil { return nw } - var reorderedNew []ClusterLoggingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterLoggingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterLoggingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterLoggingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterLoggingConfigSlice(c *Client, des, nw []ClusterLoggingConfig) []ClusterLoggingConfig { @@ -2493,23 +2532,26 @@ func canonicalizeNewClusterLoggingConfigComponentConfigSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []ClusterLoggingConfigComponentConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterLoggingConfigComponentConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterLoggingConfigComponentConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterLoggingConfigComponentConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterLoggingConfigComponentConfigSlice(c *Client, des, nw []ClusterLoggingConfigComponentConfig) []ClusterLoggingConfigComponentConfig { @@ -2602,23 +2644,26 @@ func canonicalizeNewClusterMonitoringConfigSet(c *Client, des, nw []ClusterMonit if des == nil { return nw } - var reorderedNew []ClusterMonitoringConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterMonitoringConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterMonitoringConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterMonitoringConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterMonitoringConfigSlice(c *Client, des, nw []ClusterMonitoringConfig) []ClusterMonitoringConfig { @@ -2717,23 +2762,26 @@ func canonicalizeNewClusterMonitoringConfigManagedPrometheusConfigSet(c *Client, if des == nil { return nw } - var reorderedNew []ClusterMonitoringConfigManagedPrometheusConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterMonitoringConfigManagedPrometheusConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterMonitoringConfigManagedPrometheusConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterMonitoringConfigManagedPrometheusConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterMonitoringConfigManagedPrometheusConfigSlice(c *Client, des, nw []ClusterMonitoringConfigManagedPrometheusConfig) []ClusterMonitoringConfigManagedPrometheusConfig { diff --git a/services/google/containerazure/beta/node_pool_internal.go b/services/google/containerazure/beta/node_pool_internal.go index 4040632953..b8571cd327 100755 --- a/services/google/containerazure/beta/node_pool_internal.go +++ b/services/google/containerazure/beta/node_pool_internal.go @@ -809,23 +809,26 @@ func canonicalizeNewNodePoolConfigSet(c *Client, des, nw []NodePoolConfig) []Nod if des == nil { return nw } - var reorderedNew []NodePoolConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigSlice(c *Client, des, nw []NodePoolConfig) []NodePoolConfig { @@ -921,23 +924,26 @@ func canonicalizeNewNodePoolConfigRootVolumeSet(c *Client, des, nw []NodePoolCon if des == nil { return nw } - var reorderedNew []NodePoolConfigRootVolume + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfigRootVolume for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigRootVolumeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfigRootVolume(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigRootVolumeSlice(c *Client, des, nw []NodePoolConfigRootVolume) []NodePoolConfigRootVolume { @@ -1036,23 +1042,26 @@ func canonicalizeNewNodePoolConfigSshConfigSet(c *Client, des, nw []NodePoolConf if des == nil { return nw } - var reorderedNew []NodePoolConfigSshConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfigSshConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigSshConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfigSshConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigSshConfigSlice(c *Client, des, nw []NodePoolConfigSshConfig) []NodePoolConfigSshConfig { @@ -1159,23 +1168,26 @@ func canonicalizeNewNodePoolConfigProxyConfigSet(c *Client, des, nw []NodePoolCo if des == nil { return nw } - var reorderedNew []NodePoolConfigProxyConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfigProxyConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigProxyConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfigProxyConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigProxyConfigSlice(c *Client, des, nw []NodePoolConfigProxyConfig) []NodePoolConfigProxyConfig { @@ -1277,23 +1289,26 @@ func canonicalizeNewNodePoolAutoscalingSet(c *Client, des, nw []NodePoolAutoscal if des == nil { return nw } - var reorderedNew []NodePoolAutoscaling + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolAutoscaling for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolAutoscalingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolAutoscaling(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolAutoscalingSlice(c *Client, des, nw []NodePoolAutoscaling) []NodePoolAutoscaling { @@ -1389,23 +1404,26 @@ func canonicalizeNewNodePoolMaxPodsConstraintSet(c *Client, des, nw []NodePoolMa if des == nil { return nw } - var reorderedNew []NodePoolMaxPodsConstraint + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolMaxPodsConstraint for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolMaxPodsConstraintNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolMaxPodsConstraint(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolMaxPodsConstraintSlice(c *Client, des, nw []NodePoolMaxPodsConstraint) []NodePoolMaxPodsConstraint { diff --git a/services/google/containerazure/cluster_internal.go b/services/google/containerazure/cluster_internal.go index 7396ce3d83..0a16f28534 100755 --- a/services/google/containerazure/cluster_internal.go +++ b/services/google/containerazure/cluster_internal.go @@ -892,23 +892,26 @@ func canonicalizeNewClusterNetworkingSet(c *Client, des, nw []ClusterNetworking) if des == nil { return nw } - var reorderedNew []ClusterNetworking + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterNetworking for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterNetworkingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterNetworking(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterNetworkingSlice(c *Client, des, nw []ClusterNetworking) []ClusterNetworking { @@ -1041,23 +1044,26 @@ func canonicalizeNewClusterControlPlaneSet(c *Client, des, nw []ClusterControlPl if des == nil { return nw } - var reorderedNew []ClusterControlPlane + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlane for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlane(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneSlice(c *Client, des, nw []ClusterControlPlane) []ClusterControlPlane { @@ -1156,23 +1162,26 @@ func canonicalizeNewClusterControlPlaneSshConfigSet(c *Client, des, nw []Cluster if des == nil { return nw } - var reorderedNew []ClusterControlPlaneSshConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneSshConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneSshConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneSshConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneSshConfigSlice(c *Client, des, nw []ClusterControlPlaneSshConfig) []ClusterControlPlaneSshConfig { @@ -1268,23 +1277,26 @@ func canonicalizeNewClusterControlPlaneRootVolumeSet(c *Client, des, nw []Cluste if des == nil { return nw } - var reorderedNew []ClusterControlPlaneRootVolume + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneRootVolume for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneRootVolumeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneRootVolume(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneRootVolumeSlice(c *Client, des, nw []ClusterControlPlaneRootVolume) []ClusterControlPlaneRootVolume { @@ -1380,23 +1392,26 @@ func canonicalizeNewClusterControlPlaneMainVolumeSet(c *Client, des, nw []Cluste if des == nil { return nw } - var reorderedNew []ClusterControlPlaneMainVolume + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneMainVolume for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneMainVolumeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneMainVolume(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneMainVolumeSlice(c *Client, des, nw []ClusterControlPlaneMainVolume) []ClusterControlPlaneMainVolume { @@ -1495,23 +1510,26 @@ func canonicalizeNewClusterControlPlaneDatabaseEncryptionSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []ClusterControlPlaneDatabaseEncryption + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneDatabaseEncryption for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneDatabaseEncryptionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneDatabaseEncryption(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneDatabaseEncryptionSlice(c *Client, des, nw []ClusterControlPlaneDatabaseEncryption) []ClusterControlPlaneDatabaseEncryption { @@ -1618,23 +1636,26 @@ func canonicalizeNewClusterControlPlaneProxyConfigSet(c *Client, des, nw []Clust if des == nil { return nw } - var reorderedNew []ClusterControlPlaneProxyConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneProxyConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneProxyConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneProxyConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneProxyConfigSlice(c *Client, des, nw []ClusterControlPlaneProxyConfig) []ClusterControlPlaneProxyConfig { @@ -1741,23 +1762,26 @@ func canonicalizeNewClusterControlPlaneReplicaPlacementsSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []ClusterControlPlaneReplicaPlacements + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterControlPlaneReplicaPlacements for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterControlPlaneReplicaPlacementsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterControlPlaneReplicaPlacements(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterControlPlaneReplicaPlacementsSlice(c *Client, des, nw []ClusterControlPlaneReplicaPlacements) []ClusterControlPlaneReplicaPlacements { @@ -1850,23 +1874,26 @@ func canonicalizeNewClusterAuthorizationSet(c *Client, des, nw []ClusterAuthoriz if des == nil { return nw } - var reorderedNew []ClusterAuthorization + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterAuthorization for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterAuthorizationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterAuthorization(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterAuthorizationSlice(c *Client, des, nw []ClusterAuthorization) []ClusterAuthorization { @@ -1965,23 +1992,26 @@ func canonicalizeNewClusterAuthorizationAdminUsersSet(c *Client, des, nw []Clust if des == nil { return nw } - var reorderedNew []ClusterAuthorizationAdminUsers + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterAuthorizationAdminUsers for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterAuthorizationAdminUsersNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterAuthorizationAdminUsers(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterAuthorizationAdminUsersSlice(c *Client, des, nw []ClusterAuthorizationAdminUsers) []ClusterAuthorizationAdminUsers { @@ -2096,23 +2126,26 @@ func canonicalizeNewClusterWorkloadIdentityConfigSet(c *Client, des, nw []Cluste if des == nil { return nw } - var reorderedNew []ClusterWorkloadIdentityConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterWorkloadIdentityConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterWorkloadIdentityConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterWorkloadIdentityConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterWorkloadIdentityConfigSlice(c *Client, des, nw []ClusterWorkloadIdentityConfig) []ClusterWorkloadIdentityConfig { @@ -2214,23 +2247,26 @@ func canonicalizeNewClusterFleetSet(c *Client, des, nw []ClusterFleet) []Cluster if des == nil { return nw } - var reorderedNew []ClusterFleet + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterFleet for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterFleetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterFleet(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterFleetSlice(c *Client, des, nw []ClusterFleet) []ClusterFleet { diff --git a/services/google/containerazure/node_pool_internal.go b/services/google/containerazure/node_pool_internal.go index 1d9e27da49..975c6684ba 100755 --- a/services/google/containerazure/node_pool_internal.go +++ b/services/google/containerazure/node_pool_internal.go @@ -801,23 +801,26 @@ func canonicalizeNewNodePoolConfigSet(c *Client, des, nw []NodePoolConfig) []Nod if des == nil { return nw } - var reorderedNew []NodePoolConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigSlice(c *Client, des, nw []NodePoolConfig) []NodePoolConfig { @@ -913,23 +916,26 @@ func canonicalizeNewNodePoolConfigRootVolumeSet(c *Client, des, nw []NodePoolCon if des == nil { return nw } - var reorderedNew []NodePoolConfigRootVolume + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfigRootVolume for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigRootVolumeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfigRootVolume(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigRootVolumeSlice(c *Client, des, nw []NodePoolConfigRootVolume) []NodePoolConfigRootVolume { @@ -1028,23 +1034,26 @@ func canonicalizeNewNodePoolConfigSshConfigSet(c *Client, des, nw []NodePoolConf if des == nil { return nw } - var reorderedNew []NodePoolConfigSshConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfigSshConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigSshConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfigSshConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigSshConfigSlice(c *Client, des, nw []NodePoolConfigSshConfig) []NodePoolConfigSshConfig { @@ -1151,23 +1160,26 @@ func canonicalizeNewNodePoolConfigProxyConfigSet(c *Client, des, nw []NodePoolCo if des == nil { return nw } - var reorderedNew []NodePoolConfigProxyConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolConfigProxyConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolConfigProxyConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolConfigProxyConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolConfigProxyConfigSlice(c *Client, des, nw []NodePoolConfigProxyConfig) []NodePoolConfigProxyConfig { @@ -1269,23 +1281,26 @@ func canonicalizeNewNodePoolAutoscalingSet(c *Client, des, nw []NodePoolAutoscal if des == nil { return nw } - var reorderedNew []NodePoolAutoscaling + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolAutoscaling for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolAutoscalingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolAutoscaling(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolAutoscalingSlice(c *Client, des, nw []NodePoolAutoscaling) []NodePoolAutoscaling { @@ -1381,23 +1396,26 @@ func canonicalizeNewNodePoolMaxPodsConstraintSet(c *Client, des, nw []NodePoolMa if des == nil { return nw } - var reorderedNew []NodePoolMaxPodsConstraint + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []NodePoolMaxPodsConstraint for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareNodePoolMaxPodsConstraintNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewNodePoolMaxPodsConstraint(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewNodePoolMaxPodsConstraintSlice(c *Client, des, nw []NodePoolMaxPodsConstraint) []NodePoolMaxPodsConstraint { diff --git a/services/google/datafusion/alpha/instance_internal.go b/services/google/datafusion/alpha/instance_internal.go index 6f8a593576..a97caead11 100755 --- a/services/google/datafusion/alpha/instance_internal.go +++ b/services/google/datafusion/alpha/instance_internal.go @@ -780,23 +780,26 @@ func canonicalizeNewInstanceNetworkConfigSet(c *Client, des, nw []InstanceNetwor if des == nil { return nw } - var reorderedNew []InstanceNetworkConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceNetworkConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceNetworkConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceNetworkConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceNetworkConfigSlice(c *Client, des, nw []InstanceNetworkConfig) []InstanceNetworkConfig { @@ -895,23 +898,26 @@ func canonicalizeNewInstanceAvailableVersionSet(c *Client, des, nw []InstanceAva if des == nil { return nw } - var reorderedNew []InstanceAvailableVersion + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceAvailableVersion for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceAvailableVersionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceAvailableVersion(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceAvailableVersionSlice(c *Client, des, nw []InstanceAvailableVersion) []InstanceAvailableVersion { diff --git a/services/google/datafusion/beta/instance_internal.go b/services/google/datafusion/beta/instance_internal.go index 1f4b456d06..ffdba0523e 100755 --- a/services/google/datafusion/beta/instance_internal.go +++ b/services/google/datafusion/beta/instance_internal.go @@ -780,23 +780,26 @@ func canonicalizeNewInstanceNetworkConfigSet(c *Client, des, nw []InstanceNetwor if des == nil { return nw } - var reorderedNew []InstanceNetworkConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceNetworkConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceNetworkConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceNetworkConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceNetworkConfigSlice(c *Client, des, nw []InstanceNetworkConfig) []InstanceNetworkConfig { @@ -895,23 +898,26 @@ func canonicalizeNewInstanceAvailableVersionSet(c *Client, des, nw []InstanceAva if des == nil { return nw } - var reorderedNew []InstanceAvailableVersion + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceAvailableVersion for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceAvailableVersionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceAvailableVersion(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceAvailableVersionSlice(c *Client, des, nw []InstanceAvailableVersion) []InstanceAvailableVersion { diff --git a/services/google/dataplex/alpha/asset_internal.go b/services/google/dataplex/alpha/asset_internal.go index ab1d9f44bb..9c6241a5b5 100755 --- a/services/google/dataplex/alpha/asset_internal.go +++ b/services/google/dataplex/alpha/asset_internal.go @@ -807,23 +807,26 @@ func canonicalizeNewAssetResourceSpecSet(c *Client, des, nw []AssetResourceSpec) if des == nil { return nw } - var reorderedNew []AssetResourceSpec + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AssetResourceSpec for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAssetResourceSpecNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAssetResourceSpec(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAssetResourceSpecSlice(c *Client, des, nw []AssetResourceSpec) []AssetResourceSpec { @@ -934,23 +937,26 @@ func canonicalizeNewAssetResourceStatusSet(c *Client, des, nw []AssetResourceSta if des == nil { return nw } - var reorderedNew []AssetResourceStatus + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AssetResourceStatus for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAssetResourceStatusNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAssetResourceStatus(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAssetResourceStatusSlice(c *Client, des, nw []AssetResourceStatus) []AssetResourceStatus { @@ -1061,23 +1067,26 @@ func canonicalizeNewAssetSecurityStatusSet(c *Client, des, nw []AssetSecuritySta if des == nil { return nw } - var reorderedNew []AssetSecurityStatus + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AssetSecurityStatus for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAssetSecurityStatusNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAssetSecurityStatus(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAssetSecurityStatusSlice(c *Client, des, nw []AssetSecurityStatus) []AssetSecurityStatus { @@ -1204,23 +1213,26 @@ func canonicalizeNewAssetDiscoverySpecSet(c *Client, des, nw []AssetDiscoverySpe if des == nil { return nw } - var reorderedNew []AssetDiscoverySpec + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AssetDiscoverySpec for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAssetDiscoverySpecNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAssetDiscoverySpec(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAssetDiscoverySpecSlice(c *Client, des, nw []AssetDiscoverySpec) []AssetDiscoverySpec { @@ -1341,23 +1353,26 @@ func canonicalizeNewAssetDiscoverySpecCsvOptionsSet(c *Client, des, nw []AssetDi if des == nil { return nw } - var reorderedNew []AssetDiscoverySpecCsvOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AssetDiscoverySpecCsvOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAssetDiscoverySpecCsvOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAssetDiscoverySpecCsvOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAssetDiscoverySpecCsvOptionsSlice(c *Client, des, nw []AssetDiscoverySpecCsvOptions) []AssetDiscoverySpecCsvOptions { @@ -1464,23 +1479,26 @@ func canonicalizeNewAssetDiscoverySpecJsonOptionsSet(c *Client, des, nw []AssetD if des == nil { return nw } - var reorderedNew []AssetDiscoverySpecJsonOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AssetDiscoverySpecJsonOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAssetDiscoverySpecJsonOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAssetDiscoverySpecJsonOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAssetDiscoverySpecJsonOptionsSlice(c *Client, des, nw []AssetDiscoverySpecJsonOptions) []AssetDiscoverySpecJsonOptions { @@ -1607,23 +1625,26 @@ func canonicalizeNewAssetDiscoveryStatusSet(c *Client, des, nw []AssetDiscoveryS if des == nil { return nw } - var reorderedNew []AssetDiscoveryStatus + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AssetDiscoveryStatus for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAssetDiscoveryStatusNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAssetDiscoveryStatus(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAssetDiscoveryStatusSlice(c *Client, des, nw []AssetDiscoveryStatus) []AssetDiscoveryStatus { @@ -1737,23 +1758,26 @@ func canonicalizeNewAssetDiscoveryStatusStatsSet(c *Client, des, nw []AssetDisco if des == nil { return nw } - var reorderedNew []AssetDiscoveryStatusStats + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AssetDiscoveryStatusStats for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAssetDiscoveryStatusStatsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAssetDiscoveryStatusStats(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAssetDiscoveryStatusStatsSlice(c *Client, des, nw []AssetDiscoveryStatusStats) []AssetDiscoveryStatusStats { diff --git a/services/google/dataplex/alpha/lake_internal.go b/services/google/dataplex/alpha/lake_internal.go index e4b94aad4f..a3d7933ba3 100755 --- a/services/google/dataplex/alpha/lake_internal.go +++ b/services/google/dataplex/alpha/lake_internal.go @@ -707,23 +707,26 @@ func canonicalizeNewLakeMetastoreSet(c *Client, des, nw []LakeMetastore) []LakeM if des == nil { return nw } - var reorderedNew []LakeMetastore + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []LakeMetastore for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareLakeMetastoreNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewLakeMetastore(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewLakeMetastoreSlice(c *Client, des, nw []LakeMetastore) []LakeMetastore { @@ -831,23 +834,26 @@ func canonicalizeNewLakeAssetStatusSet(c *Client, des, nw []LakeAssetStatus) []L if des == nil { return nw } - var reorderedNew []LakeAssetStatus + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []LakeAssetStatus for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareLakeAssetStatusNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewLakeAssetStatus(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewLakeAssetStatusSlice(c *Client, des, nw []LakeAssetStatus) []LakeAssetStatus { @@ -966,23 +972,26 @@ func canonicalizeNewLakeMetastoreStatusSet(c *Client, des, nw []LakeMetastoreSta if des == nil { return nw } - var reorderedNew []LakeMetastoreStatus + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []LakeMetastoreStatus for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareLakeMetastoreStatusNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewLakeMetastoreStatus(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewLakeMetastoreStatusSlice(c *Client, des, nw []LakeMetastoreStatus) []LakeMetastoreStatus { diff --git a/services/google/dataplex/alpha/zone_internal.go b/services/google/dataplex/alpha/zone_internal.go index df8fd71199..10501b4c55 100755 --- a/services/google/dataplex/alpha/zone_internal.go +++ b/services/google/dataplex/alpha/zone_internal.go @@ -780,23 +780,26 @@ func canonicalizeNewZoneDiscoverySpecSet(c *Client, des, nw []ZoneDiscoverySpec) if des == nil { return nw } - var reorderedNew []ZoneDiscoverySpec + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ZoneDiscoverySpec for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareZoneDiscoverySpecNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewZoneDiscoverySpec(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewZoneDiscoverySpecSlice(c *Client, des, nw []ZoneDiscoverySpec) []ZoneDiscoverySpec { @@ -917,23 +920,26 @@ func canonicalizeNewZoneDiscoverySpecCsvOptionsSet(c *Client, des, nw []ZoneDisc if des == nil { return nw } - var reorderedNew []ZoneDiscoverySpecCsvOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ZoneDiscoverySpecCsvOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareZoneDiscoverySpecCsvOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewZoneDiscoverySpecCsvOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewZoneDiscoverySpecCsvOptionsSlice(c *Client, des, nw []ZoneDiscoverySpecCsvOptions) []ZoneDiscoverySpecCsvOptions { @@ -1040,23 +1046,26 @@ func canonicalizeNewZoneDiscoverySpecJsonOptionsSet(c *Client, des, nw []ZoneDis if des == nil { return nw } - var reorderedNew []ZoneDiscoverySpecJsonOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ZoneDiscoverySpecJsonOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareZoneDiscoverySpecJsonOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewZoneDiscoverySpecJsonOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewZoneDiscoverySpecJsonOptionsSlice(c *Client, des, nw []ZoneDiscoverySpecJsonOptions) []ZoneDiscoverySpecJsonOptions { @@ -1152,23 +1161,26 @@ func canonicalizeNewZoneResourceSpecSet(c *Client, des, nw []ZoneResourceSpec) [ if des == nil { return nw } - var reorderedNew []ZoneResourceSpec + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ZoneResourceSpec for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareZoneResourceSpecNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewZoneResourceSpec(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewZoneResourceSpecSlice(c *Client, des, nw []ZoneResourceSpec) []ZoneResourceSpec { @@ -1276,23 +1288,26 @@ func canonicalizeNewZoneAssetStatusSet(c *Client, des, nw []ZoneAssetStatus) []Z if des == nil { return nw } - var reorderedNew []ZoneAssetStatus + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ZoneAssetStatus for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareZoneAssetStatusNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewZoneAssetStatus(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewZoneAssetStatusSlice(c *Client, des, nw []ZoneAssetStatus) []ZoneAssetStatus { diff --git a/services/google/dataplex/asset_internal.go b/services/google/dataplex/asset_internal.go index 08f4c7e007..25e3b22906 100755 --- a/services/google/dataplex/asset_internal.go +++ b/services/google/dataplex/asset_internal.go @@ -807,23 +807,26 @@ func canonicalizeNewAssetResourceSpecSet(c *Client, des, nw []AssetResourceSpec) if des == nil { return nw } - var reorderedNew []AssetResourceSpec + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AssetResourceSpec for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAssetResourceSpecNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAssetResourceSpec(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAssetResourceSpecSlice(c *Client, des, nw []AssetResourceSpec) []AssetResourceSpec { @@ -934,23 +937,26 @@ func canonicalizeNewAssetResourceStatusSet(c *Client, des, nw []AssetResourceSta if des == nil { return nw } - var reorderedNew []AssetResourceStatus + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AssetResourceStatus for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAssetResourceStatusNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAssetResourceStatus(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAssetResourceStatusSlice(c *Client, des, nw []AssetResourceStatus) []AssetResourceStatus { @@ -1061,23 +1067,26 @@ func canonicalizeNewAssetSecurityStatusSet(c *Client, des, nw []AssetSecuritySta if des == nil { return nw } - var reorderedNew []AssetSecurityStatus + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AssetSecurityStatus for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAssetSecurityStatusNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAssetSecurityStatus(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAssetSecurityStatusSlice(c *Client, des, nw []AssetSecurityStatus) []AssetSecurityStatus { @@ -1204,23 +1213,26 @@ func canonicalizeNewAssetDiscoverySpecSet(c *Client, des, nw []AssetDiscoverySpe if des == nil { return nw } - var reorderedNew []AssetDiscoverySpec + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AssetDiscoverySpec for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAssetDiscoverySpecNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAssetDiscoverySpec(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAssetDiscoverySpecSlice(c *Client, des, nw []AssetDiscoverySpec) []AssetDiscoverySpec { @@ -1341,23 +1353,26 @@ func canonicalizeNewAssetDiscoverySpecCsvOptionsSet(c *Client, des, nw []AssetDi if des == nil { return nw } - var reorderedNew []AssetDiscoverySpecCsvOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AssetDiscoverySpecCsvOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAssetDiscoverySpecCsvOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAssetDiscoverySpecCsvOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAssetDiscoverySpecCsvOptionsSlice(c *Client, des, nw []AssetDiscoverySpecCsvOptions) []AssetDiscoverySpecCsvOptions { @@ -1464,23 +1479,26 @@ func canonicalizeNewAssetDiscoverySpecJsonOptionsSet(c *Client, des, nw []AssetD if des == nil { return nw } - var reorderedNew []AssetDiscoverySpecJsonOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AssetDiscoverySpecJsonOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAssetDiscoverySpecJsonOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAssetDiscoverySpecJsonOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAssetDiscoverySpecJsonOptionsSlice(c *Client, des, nw []AssetDiscoverySpecJsonOptions) []AssetDiscoverySpecJsonOptions { @@ -1607,23 +1625,26 @@ func canonicalizeNewAssetDiscoveryStatusSet(c *Client, des, nw []AssetDiscoveryS if des == nil { return nw } - var reorderedNew []AssetDiscoveryStatus + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AssetDiscoveryStatus for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAssetDiscoveryStatusNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAssetDiscoveryStatus(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAssetDiscoveryStatusSlice(c *Client, des, nw []AssetDiscoveryStatus) []AssetDiscoveryStatus { @@ -1737,23 +1758,26 @@ func canonicalizeNewAssetDiscoveryStatusStatsSet(c *Client, des, nw []AssetDisco if des == nil { return nw } - var reorderedNew []AssetDiscoveryStatusStats + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AssetDiscoveryStatusStats for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAssetDiscoveryStatusStatsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAssetDiscoveryStatusStats(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAssetDiscoveryStatusStatsSlice(c *Client, des, nw []AssetDiscoveryStatusStats) []AssetDiscoveryStatusStats { diff --git a/services/google/dataplex/beta/asset_internal.go b/services/google/dataplex/beta/asset_internal.go index 7f2d0d66c6..e798f2bff2 100755 --- a/services/google/dataplex/beta/asset_internal.go +++ b/services/google/dataplex/beta/asset_internal.go @@ -807,23 +807,26 @@ func canonicalizeNewAssetResourceSpecSet(c *Client, des, nw []AssetResourceSpec) if des == nil { return nw } - var reorderedNew []AssetResourceSpec + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AssetResourceSpec for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAssetResourceSpecNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAssetResourceSpec(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAssetResourceSpecSlice(c *Client, des, nw []AssetResourceSpec) []AssetResourceSpec { @@ -934,23 +937,26 @@ func canonicalizeNewAssetResourceStatusSet(c *Client, des, nw []AssetResourceSta if des == nil { return nw } - var reorderedNew []AssetResourceStatus + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AssetResourceStatus for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAssetResourceStatusNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAssetResourceStatus(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAssetResourceStatusSlice(c *Client, des, nw []AssetResourceStatus) []AssetResourceStatus { @@ -1061,23 +1067,26 @@ func canonicalizeNewAssetSecurityStatusSet(c *Client, des, nw []AssetSecuritySta if des == nil { return nw } - var reorderedNew []AssetSecurityStatus + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AssetSecurityStatus for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAssetSecurityStatusNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAssetSecurityStatus(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAssetSecurityStatusSlice(c *Client, des, nw []AssetSecurityStatus) []AssetSecurityStatus { @@ -1204,23 +1213,26 @@ func canonicalizeNewAssetDiscoverySpecSet(c *Client, des, nw []AssetDiscoverySpe if des == nil { return nw } - var reorderedNew []AssetDiscoverySpec + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AssetDiscoverySpec for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAssetDiscoverySpecNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAssetDiscoverySpec(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAssetDiscoverySpecSlice(c *Client, des, nw []AssetDiscoverySpec) []AssetDiscoverySpec { @@ -1341,23 +1353,26 @@ func canonicalizeNewAssetDiscoverySpecCsvOptionsSet(c *Client, des, nw []AssetDi if des == nil { return nw } - var reorderedNew []AssetDiscoverySpecCsvOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AssetDiscoverySpecCsvOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAssetDiscoverySpecCsvOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAssetDiscoverySpecCsvOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAssetDiscoverySpecCsvOptionsSlice(c *Client, des, nw []AssetDiscoverySpecCsvOptions) []AssetDiscoverySpecCsvOptions { @@ -1464,23 +1479,26 @@ func canonicalizeNewAssetDiscoverySpecJsonOptionsSet(c *Client, des, nw []AssetD if des == nil { return nw } - var reorderedNew []AssetDiscoverySpecJsonOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AssetDiscoverySpecJsonOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAssetDiscoverySpecJsonOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAssetDiscoverySpecJsonOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAssetDiscoverySpecJsonOptionsSlice(c *Client, des, nw []AssetDiscoverySpecJsonOptions) []AssetDiscoverySpecJsonOptions { @@ -1607,23 +1625,26 @@ func canonicalizeNewAssetDiscoveryStatusSet(c *Client, des, nw []AssetDiscoveryS if des == nil { return nw } - var reorderedNew []AssetDiscoveryStatus + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AssetDiscoveryStatus for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAssetDiscoveryStatusNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAssetDiscoveryStatus(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAssetDiscoveryStatusSlice(c *Client, des, nw []AssetDiscoveryStatus) []AssetDiscoveryStatus { @@ -1737,23 +1758,26 @@ func canonicalizeNewAssetDiscoveryStatusStatsSet(c *Client, des, nw []AssetDisco if des == nil { return nw } - var reorderedNew []AssetDiscoveryStatusStats + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AssetDiscoveryStatusStats for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAssetDiscoveryStatusStatsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAssetDiscoveryStatusStats(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAssetDiscoveryStatusStatsSlice(c *Client, des, nw []AssetDiscoveryStatusStats) []AssetDiscoveryStatusStats { diff --git a/services/google/dataplex/beta/lake_internal.go b/services/google/dataplex/beta/lake_internal.go index 6ada7dc733..95f86757d4 100755 --- a/services/google/dataplex/beta/lake_internal.go +++ b/services/google/dataplex/beta/lake_internal.go @@ -707,23 +707,26 @@ func canonicalizeNewLakeMetastoreSet(c *Client, des, nw []LakeMetastore) []LakeM if des == nil { return nw } - var reorderedNew []LakeMetastore + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []LakeMetastore for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareLakeMetastoreNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewLakeMetastore(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewLakeMetastoreSlice(c *Client, des, nw []LakeMetastore) []LakeMetastore { @@ -831,23 +834,26 @@ func canonicalizeNewLakeAssetStatusSet(c *Client, des, nw []LakeAssetStatus) []L if des == nil { return nw } - var reorderedNew []LakeAssetStatus + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []LakeAssetStatus for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareLakeAssetStatusNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewLakeAssetStatus(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewLakeAssetStatusSlice(c *Client, des, nw []LakeAssetStatus) []LakeAssetStatus { @@ -966,23 +972,26 @@ func canonicalizeNewLakeMetastoreStatusSet(c *Client, des, nw []LakeMetastoreSta if des == nil { return nw } - var reorderedNew []LakeMetastoreStatus + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []LakeMetastoreStatus for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareLakeMetastoreStatusNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewLakeMetastoreStatus(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewLakeMetastoreStatusSlice(c *Client, des, nw []LakeMetastoreStatus) []LakeMetastoreStatus { diff --git a/services/google/dataplex/beta/zone_internal.go b/services/google/dataplex/beta/zone_internal.go index 54d729cfb8..5a5154f87e 100755 --- a/services/google/dataplex/beta/zone_internal.go +++ b/services/google/dataplex/beta/zone_internal.go @@ -780,23 +780,26 @@ func canonicalizeNewZoneDiscoverySpecSet(c *Client, des, nw []ZoneDiscoverySpec) if des == nil { return nw } - var reorderedNew []ZoneDiscoverySpec + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ZoneDiscoverySpec for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareZoneDiscoverySpecNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewZoneDiscoverySpec(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewZoneDiscoverySpecSlice(c *Client, des, nw []ZoneDiscoverySpec) []ZoneDiscoverySpec { @@ -917,23 +920,26 @@ func canonicalizeNewZoneDiscoverySpecCsvOptionsSet(c *Client, des, nw []ZoneDisc if des == nil { return nw } - var reorderedNew []ZoneDiscoverySpecCsvOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ZoneDiscoverySpecCsvOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareZoneDiscoverySpecCsvOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewZoneDiscoverySpecCsvOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewZoneDiscoverySpecCsvOptionsSlice(c *Client, des, nw []ZoneDiscoverySpecCsvOptions) []ZoneDiscoverySpecCsvOptions { @@ -1040,23 +1046,26 @@ func canonicalizeNewZoneDiscoverySpecJsonOptionsSet(c *Client, des, nw []ZoneDis if des == nil { return nw } - var reorderedNew []ZoneDiscoverySpecJsonOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ZoneDiscoverySpecJsonOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareZoneDiscoverySpecJsonOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewZoneDiscoverySpecJsonOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewZoneDiscoverySpecJsonOptionsSlice(c *Client, des, nw []ZoneDiscoverySpecJsonOptions) []ZoneDiscoverySpecJsonOptions { @@ -1152,23 +1161,26 @@ func canonicalizeNewZoneResourceSpecSet(c *Client, des, nw []ZoneResourceSpec) [ if des == nil { return nw } - var reorderedNew []ZoneResourceSpec + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ZoneResourceSpec for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareZoneResourceSpecNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewZoneResourceSpec(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewZoneResourceSpecSlice(c *Client, des, nw []ZoneResourceSpec) []ZoneResourceSpec { @@ -1276,23 +1288,26 @@ func canonicalizeNewZoneAssetStatusSet(c *Client, des, nw []ZoneAssetStatus) []Z if des == nil { return nw } - var reorderedNew []ZoneAssetStatus + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ZoneAssetStatus for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareZoneAssetStatusNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewZoneAssetStatus(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewZoneAssetStatusSlice(c *Client, des, nw []ZoneAssetStatus) []ZoneAssetStatus { diff --git a/services/google/dataplex/lake_internal.go b/services/google/dataplex/lake_internal.go index 3b59699a64..5cc2676e1a 100755 --- a/services/google/dataplex/lake_internal.go +++ b/services/google/dataplex/lake_internal.go @@ -707,23 +707,26 @@ func canonicalizeNewLakeMetastoreSet(c *Client, des, nw []LakeMetastore) []LakeM if des == nil { return nw } - var reorderedNew []LakeMetastore + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []LakeMetastore for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareLakeMetastoreNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewLakeMetastore(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewLakeMetastoreSlice(c *Client, des, nw []LakeMetastore) []LakeMetastore { @@ -831,23 +834,26 @@ func canonicalizeNewLakeAssetStatusSet(c *Client, des, nw []LakeAssetStatus) []L if des == nil { return nw } - var reorderedNew []LakeAssetStatus + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []LakeAssetStatus for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareLakeAssetStatusNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewLakeAssetStatus(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewLakeAssetStatusSlice(c *Client, des, nw []LakeAssetStatus) []LakeAssetStatus { @@ -966,23 +972,26 @@ func canonicalizeNewLakeMetastoreStatusSet(c *Client, des, nw []LakeMetastoreSta if des == nil { return nw } - var reorderedNew []LakeMetastoreStatus + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []LakeMetastoreStatus for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareLakeMetastoreStatusNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewLakeMetastoreStatus(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewLakeMetastoreStatusSlice(c *Client, des, nw []LakeMetastoreStatus) []LakeMetastoreStatus { diff --git a/services/google/dataplex/zone_internal.go b/services/google/dataplex/zone_internal.go index b3c8d308a8..838e4bf482 100755 --- a/services/google/dataplex/zone_internal.go +++ b/services/google/dataplex/zone_internal.go @@ -780,23 +780,26 @@ func canonicalizeNewZoneDiscoverySpecSet(c *Client, des, nw []ZoneDiscoverySpec) if des == nil { return nw } - var reorderedNew []ZoneDiscoverySpec + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ZoneDiscoverySpec for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareZoneDiscoverySpecNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewZoneDiscoverySpec(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewZoneDiscoverySpecSlice(c *Client, des, nw []ZoneDiscoverySpec) []ZoneDiscoverySpec { @@ -917,23 +920,26 @@ func canonicalizeNewZoneDiscoverySpecCsvOptionsSet(c *Client, des, nw []ZoneDisc if des == nil { return nw } - var reorderedNew []ZoneDiscoverySpecCsvOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ZoneDiscoverySpecCsvOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareZoneDiscoverySpecCsvOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewZoneDiscoverySpecCsvOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewZoneDiscoverySpecCsvOptionsSlice(c *Client, des, nw []ZoneDiscoverySpecCsvOptions) []ZoneDiscoverySpecCsvOptions { @@ -1040,23 +1046,26 @@ func canonicalizeNewZoneDiscoverySpecJsonOptionsSet(c *Client, des, nw []ZoneDis if des == nil { return nw } - var reorderedNew []ZoneDiscoverySpecJsonOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ZoneDiscoverySpecJsonOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareZoneDiscoverySpecJsonOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewZoneDiscoverySpecJsonOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewZoneDiscoverySpecJsonOptionsSlice(c *Client, des, nw []ZoneDiscoverySpecJsonOptions) []ZoneDiscoverySpecJsonOptions { @@ -1152,23 +1161,26 @@ func canonicalizeNewZoneResourceSpecSet(c *Client, des, nw []ZoneResourceSpec) [ if des == nil { return nw } - var reorderedNew []ZoneResourceSpec + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ZoneResourceSpec for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareZoneResourceSpecNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewZoneResourceSpec(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewZoneResourceSpecSlice(c *Client, des, nw []ZoneResourceSpec) []ZoneResourceSpec { @@ -1276,23 +1288,26 @@ func canonicalizeNewZoneAssetStatusSet(c *Client, des, nw []ZoneAssetStatus) []Z if des == nil { return nw } - var reorderedNew []ZoneAssetStatus + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ZoneAssetStatus for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareZoneAssetStatusNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewZoneAssetStatus(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewZoneAssetStatusSlice(c *Client, des, nw []ZoneAssetStatus) []ZoneAssetStatus { diff --git a/services/google/dataproc/alpha/autoscaling_policy_internal.go b/services/google/dataproc/alpha/autoscaling_policy_internal.go index 92a4a40458..e23c4eea1f 100755 --- a/services/google/dataproc/alpha/autoscaling_policy_internal.go +++ b/services/google/dataproc/alpha/autoscaling_policy_internal.go @@ -611,23 +611,26 @@ func canonicalizeNewAutoscalingPolicyBasicAlgorithmSet(c *Client, des, nw []Auto if des == nil { return nw } - var reorderedNew []AutoscalingPolicyBasicAlgorithm + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AutoscalingPolicyBasicAlgorithm for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAutoscalingPolicyBasicAlgorithmNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAutoscalingPolicyBasicAlgorithm(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAutoscalingPolicyBasicAlgorithmSlice(c *Client, des, nw []AutoscalingPolicyBasicAlgorithm) []AutoscalingPolicyBasicAlgorithm { @@ -750,23 +753,26 @@ func canonicalizeNewAutoscalingPolicyBasicAlgorithmYarnConfigSet(c *Client, des, if des == nil { return nw } - var reorderedNew []AutoscalingPolicyBasicAlgorithmYarnConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AutoscalingPolicyBasicAlgorithmYarnConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAutoscalingPolicyBasicAlgorithmYarnConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAutoscalingPolicyBasicAlgorithmYarnConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAutoscalingPolicyBasicAlgorithmYarnConfigSlice(c *Client, des, nw []AutoscalingPolicyBasicAlgorithmYarnConfig) []AutoscalingPolicyBasicAlgorithmYarnConfig { @@ -874,23 +880,26 @@ func canonicalizeNewAutoscalingPolicyWorkerConfigSet(c *Client, des, nw []Autosc if des == nil { return nw } - var reorderedNew []AutoscalingPolicyWorkerConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AutoscalingPolicyWorkerConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAutoscalingPolicyWorkerConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAutoscalingPolicyWorkerConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAutoscalingPolicyWorkerConfigSlice(c *Client, des, nw []AutoscalingPolicyWorkerConfig) []AutoscalingPolicyWorkerConfig { @@ -998,23 +1007,26 @@ func canonicalizeNewAutoscalingPolicySecondaryWorkerConfigSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []AutoscalingPolicySecondaryWorkerConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AutoscalingPolicySecondaryWorkerConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAutoscalingPolicySecondaryWorkerConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAutoscalingPolicySecondaryWorkerConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAutoscalingPolicySecondaryWorkerConfigSlice(c *Client, des, nw []AutoscalingPolicySecondaryWorkerConfig) []AutoscalingPolicySecondaryWorkerConfig { diff --git a/services/google/dataproc/alpha/cluster_internal.go b/services/google/dataproc/alpha/cluster_internal.go index 778442b793..1d4177540b 100755 --- a/services/google/dataproc/alpha/cluster_internal.go +++ b/services/google/dataproc/alpha/cluster_internal.go @@ -1045,23 +1045,26 @@ func canonicalizeNewClusterConfigSet(c *Client, des, nw []ClusterConfig) []Clust if des == nil { return nw } - var reorderedNew []ClusterConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigSlice(c *Client, des, nw []ClusterConfig) []ClusterConfig { @@ -1222,23 +1225,26 @@ func canonicalizeNewClusterConfigGceClusterConfigSet(c *Client, des, nw []Cluste if des == nil { return nw } - var reorderedNew []ClusterConfigGceClusterConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigGceClusterConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigGceClusterConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigGceClusterConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigGceClusterConfigSlice(c *Client, des, nw []ClusterConfigGceClusterConfig) []ClusterConfigGceClusterConfig { @@ -1351,23 +1357,26 @@ func canonicalizeNewClusterConfigGceClusterConfigReservationAffinitySet(c *Clien if des == nil { return nw } - var reorderedNew []ClusterConfigGceClusterConfigReservationAffinity + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigGceClusterConfigReservationAffinity for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigGceClusterConfigReservationAffinityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigGceClusterConfigReservationAffinity(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigGceClusterConfigReservationAffinitySlice(c *Client, des, nw []ClusterConfigGceClusterConfigReservationAffinity) []ClusterConfigGceClusterConfigReservationAffinity { @@ -1463,23 +1472,26 @@ func canonicalizeNewClusterConfigGceClusterConfigNodeGroupAffinitySet(c *Client, if des == nil { return nw } - var reorderedNew []ClusterConfigGceClusterConfigNodeGroupAffinity + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigGceClusterConfigNodeGroupAffinity for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigGceClusterConfigNodeGroupAffinityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigGceClusterConfigNodeGroupAffinity(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigGceClusterConfigNodeGroupAffinitySlice(c *Client, des, nw []ClusterConfigGceClusterConfigNodeGroupAffinity) []ClusterConfigGceClusterConfigNodeGroupAffinity { @@ -1594,23 +1606,26 @@ func canonicalizeNewClusterConfigGceClusterConfigShieldedInstanceConfigSet(c *Cl if des == nil { return nw } - var reorderedNew []ClusterConfigGceClusterConfigShieldedInstanceConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigGceClusterConfigShieldedInstanceConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigGceClusterConfigShieldedInstanceConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigGceClusterConfigShieldedInstanceConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigGceClusterConfigShieldedInstanceConfigSlice(c *Client, des, nw []ClusterConfigGceClusterConfigShieldedInstanceConfig) []ClusterConfigGceClusterConfigShieldedInstanceConfig { @@ -1709,23 +1724,26 @@ func canonicalizeNewClusterConfigGceClusterConfigConfidentialInstanceConfigSet(c if des == nil { return nw } - var reorderedNew []ClusterConfigGceClusterConfigConfidentialInstanceConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigGceClusterConfigConfidentialInstanceConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigGceClusterConfigConfidentialInstanceConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigGceClusterConfigConfidentialInstanceConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigGceClusterConfigConfidentialInstanceConfigSlice(c *Client, des, nw []ClusterConfigGceClusterConfigConfidentialInstanceConfig) []ClusterConfigGceClusterConfigConfidentialInstanceConfig { @@ -1862,23 +1880,26 @@ func canonicalizeNewClusterConfigMasterConfigSet(c *Client, des, nw []ClusterCon if des == nil { return nw } - var reorderedNew []ClusterConfigMasterConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigMasterConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigMasterConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigMasterConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigMasterConfigSlice(c *Client, des, nw []ClusterConfigMasterConfig) []ClusterConfigMasterConfig { @@ -1997,23 +2018,26 @@ func canonicalizeNewClusterConfigMasterConfigDiskConfigSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []ClusterConfigMasterConfigDiskConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigMasterConfigDiskConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigMasterConfigDiskConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigMasterConfigDiskConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigMasterConfigDiskConfigSlice(c *Client, des, nw []ClusterConfigMasterConfigDiskConfig) []ClusterConfigMasterConfigDiskConfig { @@ -2109,23 +2133,26 @@ func canonicalizeNewClusterConfigMasterConfigManagedGroupConfigSet(c *Client, de if des == nil { return nw } - var reorderedNew []ClusterConfigMasterConfigManagedGroupConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigMasterConfigManagedGroupConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigMasterConfigManagedGroupConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigMasterConfigManagedGroupConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigMasterConfigManagedGroupConfigSlice(c *Client, des, nw []ClusterConfigMasterConfigManagedGroupConfig) []ClusterConfigMasterConfigManagedGroupConfig { @@ -2230,23 +2257,26 @@ func canonicalizeNewClusterConfigMasterConfigAcceleratorsSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []ClusterConfigMasterConfigAccelerators + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigMasterConfigAccelerators for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigMasterConfigAcceleratorsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigMasterConfigAccelerators(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigMasterConfigAcceleratorsSlice(c *Client, des, nw []ClusterConfigMasterConfigAccelerators) []ClusterConfigMasterConfigAccelerators { @@ -2369,23 +2399,26 @@ func canonicalizeNewClusterConfigMasterConfigInstanceReferencesSet(c *Client, de if des == nil { return nw } - var reorderedNew []ClusterConfigMasterConfigInstanceReferences + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigMasterConfigInstanceReferences for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigMasterConfigInstanceReferencesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigMasterConfigInstanceReferences(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigMasterConfigInstanceReferencesSlice(c *Client, des, nw []ClusterConfigMasterConfigInstanceReferences) []ClusterConfigMasterConfigInstanceReferences { @@ -2522,23 +2555,26 @@ func canonicalizeNewClusterConfigWorkerConfigSet(c *Client, des, nw []ClusterCon if des == nil { return nw } - var reorderedNew []ClusterConfigWorkerConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigWorkerConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigWorkerConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigWorkerConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigWorkerConfigSlice(c *Client, des, nw []ClusterConfigWorkerConfig) []ClusterConfigWorkerConfig { @@ -2657,23 +2693,26 @@ func canonicalizeNewClusterConfigWorkerConfigDiskConfigSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []ClusterConfigWorkerConfigDiskConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigWorkerConfigDiskConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigWorkerConfigDiskConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigWorkerConfigDiskConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigWorkerConfigDiskConfigSlice(c *Client, des, nw []ClusterConfigWorkerConfigDiskConfig) []ClusterConfigWorkerConfigDiskConfig { @@ -2769,23 +2808,26 @@ func canonicalizeNewClusterConfigWorkerConfigManagedGroupConfigSet(c *Client, de if des == nil { return nw } - var reorderedNew []ClusterConfigWorkerConfigManagedGroupConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigWorkerConfigManagedGroupConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigWorkerConfigManagedGroupConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigWorkerConfigManagedGroupConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigWorkerConfigManagedGroupConfigSlice(c *Client, des, nw []ClusterConfigWorkerConfigManagedGroupConfig) []ClusterConfigWorkerConfigManagedGroupConfig { @@ -2890,23 +2932,26 @@ func canonicalizeNewClusterConfigWorkerConfigAcceleratorsSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []ClusterConfigWorkerConfigAccelerators + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigWorkerConfigAccelerators for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigWorkerConfigAcceleratorsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigWorkerConfigAccelerators(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigWorkerConfigAcceleratorsSlice(c *Client, des, nw []ClusterConfigWorkerConfigAccelerators) []ClusterConfigWorkerConfigAccelerators { @@ -3029,23 +3074,26 @@ func canonicalizeNewClusterConfigWorkerConfigInstanceReferencesSet(c *Client, de if des == nil { return nw } - var reorderedNew []ClusterConfigWorkerConfigInstanceReferences + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigWorkerConfigInstanceReferences for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigWorkerConfigInstanceReferencesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigWorkerConfigInstanceReferences(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigWorkerConfigInstanceReferencesSlice(c *Client, des, nw []ClusterConfigWorkerConfigInstanceReferences) []ClusterConfigWorkerConfigInstanceReferences { @@ -3182,23 +3230,26 @@ func canonicalizeNewClusterConfigSecondaryWorkerConfigSet(c *Client, des, nw []C if des == nil { return nw } - var reorderedNew []ClusterConfigSecondaryWorkerConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigSecondaryWorkerConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigSecondaryWorkerConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigSecondaryWorkerConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigSecondaryWorkerConfigSlice(c *Client, des, nw []ClusterConfigSecondaryWorkerConfig) []ClusterConfigSecondaryWorkerConfig { @@ -3317,23 +3368,26 @@ func canonicalizeNewClusterConfigSecondaryWorkerConfigDiskConfigSet(c *Client, d if des == nil { return nw } - var reorderedNew []ClusterConfigSecondaryWorkerConfigDiskConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigSecondaryWorkerConfigDiskConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigSecondaryWorkerConfigDiskConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigSecondaryWorkerConfigDiskConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigSecondaryWorkerConfigDiskConfigSlice(c *Client, des, nw []ClusterConfigSecondaryWorkerConfigDiskConfig) []ClusterConfigSecondaryWorkerConfigDiskConfig { @@ -3429,23 +3483,26 @@ func canonicalizeNewClusterConfigSecondaryWorkerConfigManagedGroupConfigSet(c *C if des == nil { return nw } - var reorderedNew []ClusterConfigSecondaryWorkerConfigManagedGroupConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigSecondaryWorkerConfigManagedGroupConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigSecondaryWorkerConfigManagedGroupConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigSecondaryWorkerConfigManagedGroupConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigSecondaryWorkerConfigManagedGroupConfigSlice(c *Client, des, nw []ClusterConfigSecondaryWorkerConfigManagedGroupConfig) []ClusterConfigSecondaryWorkerConfigManagedGroupConfig { @@ -3550,23 +3607,26 @@ func canonicalizeNewClusterConfigSecondaryWorkerConfigAcceleratorsSet(c *Client, if des == nil { return nw } - var reorderedNew []ClusterConfigSecondaryWorkerConfigAccelerators + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigSecondaryWorkerConfigAccelerators for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigSecondaryWorkerConfigAcceleratorsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigSecondaryWorkerConfigAccelerators(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigSecondaryWorkerConfigAcceleratorsSlice(c *Client, des, nw []ClusterConfigSecondaryWorkerConfigAccelerators) []ClusterConfigSecondaryWorkerConfigAccelerators { @@ -3689,23 +3749,26 @@ func canonicalizeNewClusterConfigSecondaryWorkerConfigInstanceReferencesSet(c *C if des == nil { return nw } - var reorderedNew []ClusterConfigSecondaryWorkerConfigInstanceReferences + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigSecondaryWorkerConfigInstanceReferences for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigSecondaryWorkerConfigInstanceReferencesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigSecondaryWorkerConfigInstanceReferences(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigSecondaryWorkerConfigInstanceReferencesSlice(c *Client, des, nw []ClusterConfigSecondaryWorkerConfigInstanceReferences) []ClusterConfigSecondaryWorkerConfigInstanceReferences { @@ -3818,23 +3881,26 @@ func canonicalizeNewClusterConfigSoftwareConfigSet(c *Client, des, nw []ClusterC if des == nil { return nw } - var reorderedNew []ClusterConfigSoftwareConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigSoftwareConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigSoftwareConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigSoftwareConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigSoftwareConfigSlice(c *Client, des, nw []ClusterConfigSoftwareConfig) []ClusterConfigSoftwareConfig { @@ -3941,23 +4007,26 @@ func canonicalizeNewClusterConfigInitializationActionsSet(c *Client, des, nw []C if des == nil { return nw } - var reorderedNew []ClusterConfigInitializationActions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigInitializationActions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigInitializationActionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigInitializationActions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigInitializationActionsSlice(c *Client, des, nw []ClusterConfigInitializationActions) []ClusterConfigInitializationActions { @@ -4053,23 +4122,26 @@ func canonicalizeNewClusterConfigEncryptionConfigSet(c *Client, des, nw []Cluste if des == nil { return nw } - var reorderedNew []ClusterConfigEncryptionConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigEncryptionConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigEncryptionConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigEncryptionConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigEncryptionConfigSlice(c *Client, des, nw []ClusterConfigEncryptionConfig) []ClusterConfigEncryptionConfig { @@ -4165,23 +4237,26 @@ func canonicalizeNewClusterConfigAutoscalingConfigSet(c *Client, des, nw []Clust if des == nil { return nw } - var reorderedNew []ClusterConfigAutoscalingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigAutoscalingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigAutoscalingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigAutoscalingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigAutoscalingConfigSlice(c *Client, des, nw []ClusterConfigAutoscalingConfig) []ClusterConfigAutoscalingConfig { @@ -4276,23 +4351,26 @@ func canonicalizeNewClusterConfigSecurityConfigSet(c *Client, des, nw []ClusterC if des == nil { return nw } - var reorderedNew []ClusterConfigSecurityConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigSecurityConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigSecurityConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigSecurityConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigSecurityConfigSlice(c *Client, des, nw []ClusterConfigSecurityConfig) []ClusterConfigSecurityConfig { @@ -4499,23 +4577,26 @@ func canonicalizeNewClusterConfigSecurityConfigKerberosConfigSet(c *Client, des, if des == nil { return nw } - var reorderedNew []ClusterConfigSecurityConfigKerberosConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigSecurityConfigKerberosConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigSecurityConfigKerberosConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigSecurityConfigKerberosConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigSecurityConfigKerberosConfigSlice(c *Client, des, nw []ClusterConfigSecurityConfigKerberosConfig) []ClusterConfigSecurityConfigKerberosConfig { @@ -4611,23 +4692,26 @@ func canonicalizeNewClusterConfigSecurityConfigIdentityConfigSet(c *Client, des, if des == nil { return nw } - var reorderedNew []ClusterConfigSecurityConfigIdentityConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigSecurityConfigIdentityConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigSecurityConfigIdentityConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigSecurityConfigIdentityConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigSecurityConfigIdentityConfigSlice(c *Client, des, nw []ClusterConfigSecurityConfigIdentityConfig) []ClusterConfigSecurityConfigIdentityConfig { @@ -4740,23 +4824,26 @@ func canonicalizeNewClusterConfigLifecycleConfigSet(c *Client, des, nw []Cluster if des == nil { return nw } - var reorderedNew []ClusterConfigLifecycleConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigLifecycleConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigLifecycleConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigLifecycleConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigLifecycleConfigSlice(c *Client, des, nw []ClusterConfigLifecycleConfig) []ClusterConfigLifecycleConfig { @@ -4855,23 +4942,26 @@ func canonicalizeNewClusterConfigEndpointConfigSet(c *Client, des, nw []ClusterC if des == nil { return nw } - var reorderedNew []ClusterConfigEndpointConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigEndpointConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigEndpointConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigEndpointConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigEndpointConfigSlice(c *Client, des, nw []ClusterConfigEndpointConfig) []ClusterConfigEndpointConfig { @@ -4964,23 +5054,26 @@ func canonicalizeNewClusterConfigGkeClusterConfigSet(c *Client, des, nw []Cluste if des == nil { return nw } - var reorderedNew []ClusterConfigGkeClusterConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigGkeClusterConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigGkeClusterConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigGkeClusterConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigGkeClusterConfigSlice(c *Client, des, nw []ClusterConfigGkeClusterConfig) []ClusterConfigGkeClusterConfig { @@ -5085,23 +5178,26 @@ func canonicalizeNewClusterConfigGkeClusterConfigNamespacedGkeDeploymentTargetSe if des == nil { return nw } - var reorderedNew []ClusterConfigGkeClusterConfigNamespacedGkeDeploymentTarget + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigGkeClusterConfigNamespacedGkeDeploymentTarget for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigGkeClusterConfigNamespacedGkeDeploymentTargetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigGkeClusterConfigNamespacedGkeDeploymentTarget(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigGkeClusterConfigNamespacedGkeDeploymentTargetSlice(c *Client, des, nw []ClusterConfigGkeClusterConfigNamespacedGkeDeploymentTarget) []ClusterConfigGkeClusterConfigNamespacedGkeDeploymentTarget { @@ -5197,23 +5293,26 @@ func canonicalizeNewClusterConfigMetastoreConfigSet(c *Client, des, nw []Cluster if des == nil { return nw } - var reorderedNew []ClusterConfigMetastoreConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigMetastoreConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigMetastoreConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigMetastoreConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigMetastoreConfigSlice(c *Client, des, nw []ClusterConfigMetastoreConfig) []ClusterConfigMetastoreConfig { @@ -5306,23 +5405,26 @@ func canonicalizeNewClusterConfigDataprocMetricConfigSet(c *Client, des, nw []Cl if des == nil { return nw } - var reorderedNew []ClusterConfigDataprocMetricConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigDataprocMetricConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigDataprocMetricConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigDataprocMetricConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigDataprocMetricConfigSlice(c *Client, des, nw []ClusterConfigDataprocMetricConfig) []ClusterConfigDataprocMetricConfig { @@ -5427,23 +5529,26 @@ func canonicalizeNewClusterConfigDataprocMetricConfigMetricsSet(c *Client, des, if des == nil { return nw } - var reorderedNew []ClusterConfigDataprocMetricConfigMetrics + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigDataprocMetricConfigMetrics for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigDataprocMetricConfigMetricsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigDataprocMetricConfigMetrics(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigDataprocMetricConfigMetricsSlice(c *Client, des, nw []ClusterConfigDataprocMetricConfigMetrics) []ClusterConfigDataprocMetricConfigMetrics { @@ -5536,23 +5641,26 @@ func canonicalizeNewClusterStatusSet(c *Client, des, nw []ClusterStatus) []Clust if des == nil { return nw } - var reorderedNew []ClusterStatus + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterStatus for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterStatusNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterStatus(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterStatusSlice(c *Client, des, nw []ClusterStatus) []ClusterStatus { @@ -5645,23 +5753,26 @@ func canonicalizeNewClusterStatusHistorySet(c *Client, des, nw []ClusterStatusHi if des == nil { return nw } - var reorderedNew []ClusterStatusHistory + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterStatusHistory for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterStatusHistoryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterStatusHistory(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterStatusHistorySlice(c *Client, des, nw []ClusterStatusHistory) []ClusterStatusHistory { @@ -5763,23 +5874,26 @@ func canonicalizeNewClusterMetricsSet(c *Client, des, nw []ClusterMetrics) []Clu if des == nil { return nw } - var reorderedNew []ClusterMetrics + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterMetrics for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterMetricsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterMetrics(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterMetricsSlice(c *Client, des, nw []ClusterMetrics) []ClusterMetrics { @@ -5880,23 +5994,26 @@ func canonicalizeNewClusterVirtualClusterConfigSet(c *Client, des, nw []ClusterV if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigSlice(c *Client, des, nw []ClusterVirtualClusterConfig) []ClusterVirtualClusterConfig { @@ -5999,23 +6116,26 @@ func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigSet(c *Cli if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigKubernetesClusterConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigKubernetesClusterConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigKubernetesClusterConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigSlice(c *Client, des, nw []ClusterVirtualClusterConfigKubernetesClusterConfig) []ClusterVirtualClusterConfigKubernetesClusterConfig { @@ -6114,23 +6234,26 @@ func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeCluster if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigSlice(c *Client, des, nw []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfig) []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfig { @@ -6235,23 +6358,26 @@ func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeCluster if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTarget + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTarget for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTarget(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetSlice(c *Client, des, nw []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTarget) []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTarget { @@ -6354,23 +6480,26 @@ func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeCluster if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigSlice(c *Client, des, nw []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfig) []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfig { @@ -6511,23 +6640,26 @@ func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeCluster if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigSlice(c *Client, des, nw []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfig) []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfig { @@ -6640,23 +6772,26 @@ func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeCluster if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigAccelerators + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigAccelerators for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigAcceleratorsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigAccelerators(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigAcceleratorsSlice(c *Client, des, nw []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigAccelerators) []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigAccelerators { @@ -6752,23 +6887,26 @@ func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeCluster if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigEphemeralStorageConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigEphemeralStorageConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigEphemeralStorageConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigEphemeralStorageConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigEphemeralStorageConfigSlice(c *Client, des, nw []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigEphemeralStorageConfig) []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigEphemeralStorageConfig { @@ -6870,23 +7008,26 @@ func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeCluster if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigAutoscaling + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigAutoscaling for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigAutoscalingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigAutoscaling(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigAutoscalingSlice(c *Client, des, nw []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigAutoscaling) []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigAutoscaling { @@ -6988,23 +7129,26 @@ func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigKubernetes if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigKubernetesClusterConfigKubernetesSoftwareConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigKubernetesClusterConfigKubernetesSoftwareConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigKubernetesClusterConfigKubernetesSoftwareConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigKubernetesSoftwareConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigKubernetesSoftwareConfigSlice(c *Client, des, nw []ClusterVirtualClusterConfigKubernetesClusterConfigKubernetesSoftwareConfig) []ClusterVirtualClusterConfigKubernetesClusterConfigKubernetesSoftwareConfig { @@ -7099,23 +7243,26 @@ func canonicalizeNewClusterVirtualClusterConfigAuxiliaryServicesConfigSet(c *Cli if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigAuxiliaryServicesConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigAuxiliaryServicesConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigAuxiliaryServicesConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigAuxiliaryServicesConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigAuxiliaryServicesConfigSlice(c *Client, des, nw []ClusterVirtualClusterConfigAuxiliaryServicesConfig) []ClusterVirtualClusterConfigAuxiliaryServicesConfig { @@ -7211,23 +7358,26 @@ func canonicalizeNewClusterVirtualClusterConfigAuxiliaryServicesConfigMetastoreC if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigAuxiliaryServicesConfigMetastoreConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigAuxiliaryServicesConfigMetastoreConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigAuxiliaryServicesConfigMetastoreConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigAuxiliaryServicesConfigMetastoreConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigAuxiliaryServicesConfigMetastoreConfigSlice(c *Client, des, nw []ClusterVirtualClusterConfigAuxiliaryServicesConfigMetastoreConfig) []ClusterVirtualClusterConfigAuxiliaryServicesConfigMetastoreConfig { @@ -7323,23 +7473,26 @@ func canonicalizeNewClusterVirtualClusterConfigAuxiliaryServicesConfigSparkHisto if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigAuxiliaryServicesConfigSparkHistoryServerConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigAuxiliaryServicesConfigSparkHistoryServerConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigAuxiliaryServicesConfigSparkHistoryServerConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigAuxiliaryServicesConfigSparkHistoryServerConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigAuxiliaryServicesConfigSparkHistoryServerConfigSlice(c *Client, des, nw []ClusterVirtualClusterConfigAuxiliaryServicesConfigSparkHistoryServerConfig) []ClusterVirtualClusterConfigAuxiliaryServicesConfigSparkHistoryServerConfig { diff --git a/services/google/dataproc/alpha/workflow_template_internal.go b/services/google/dataproc/alpha/workflow_template_internal.go index 506c7dfb75..13db353a3e 100755 --- a/services/google/dataproc/alpha/workflow_template_internal.go +++ b/services/google/dataproc/alpha/workflow_template_internal.go @@ -986,23 +986,26 @@ func canonicalizeNewWorkflowTemplatePlacementSet(c *Client, des, nw []WorkflowTe if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacement + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacement for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacement(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementSlice(c *Client, des, nw []WorkflowTemplatePlacement) []WorkflowTemplatePlacement { @@ -1109,23 +1112,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedCluster + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedCluster for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedCluster(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedCluster) []WorkflowTemplatePlacementManagedCluster { @@ -1254,23 +1260,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSet(c *Client, if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfig) []WorkflowTemplatePlacementManagedClusterConfig { @@ -1429,23 +1438,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfi if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfig) []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfig { @@ -1558,23 +1570,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfi if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigReservationAffinity + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigReservationAffinity for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigReservationAffinityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigReservationAffinity(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigReservationAffinitySlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigReservationAffinity) []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigReservationAffinity { @@ -1670,23 +1685,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfi if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigNodeGroupAffinity + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigNodeGroupAffinity for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigNodeGroupAffinityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigNodeGroupAffinity(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigNodeGroupAffinitySlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigNodeGroupAffinity) []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigNodeGroupAffinity { @@ -1801,23 +1819,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfi if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigShieldedInstanceConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigShieldedInstanceConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigShieldedInstanceConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigShieldedInstanceConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigShieldedInstanceConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigShieldedInstanceConfig) []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigShieldedInstanceConfig { @@ -1953,23 +1974,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfigSet if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigMasterConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigMasterConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigMasterConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigMasterConfig) []WorkflowTemplatePlacementManagedClusterConfigMasterConfig { @@ -2080,23 +2104,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfigDis if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigMasterConfigDiskConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigMasterConfigDiskConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigMasterConfigDiskConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfigDiskConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfigDiskConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigMasterConfigDiskConfig) []WorkflowTemplatePlacementManagedClusterConfigMasterConfigDiskConfig { @@ -2192,23 +2219,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfigMan if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigMasterConfigManagedGroupConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigMasterConfigManagedGroupConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigMasterConfigManagedGroupConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfigManagedGroupConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfigManagedGroupConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigMasterConfigManagedGroupConfig) []WorkflowTemplatePlacementManagedClusterConfigMasterConfigManagedGroupConfig { @@ -2313,23 +2343,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfigAcc if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigMasterConfigAccelerators + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigMasterConfigAccelerators for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigMasterConfigAcceleratorsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfigAccelerators(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfigAcceleratorsSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigMasterConfigAccelerators) []WorkflowTemplatePlacementManagedClusterConfigMasterConfigAccelerators { @@ -2465,23 +2498,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfigSet if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigWorkerConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigWorkerConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigWorkerConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigWorkerConfig) []WorkflowTemplatePlacementManagedClusterConfigWorkerConfig { @@ -2592,23 +2628,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfigDis if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigDiskConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigDiskConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigWorkerConfigDiskConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfigDiskConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfigDiskConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigDiskConfig) []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigDiskConfig { @@ -2704,23 +2743,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfigMan if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigManagedGroupConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigManagedGroupConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigWorkerConfigManagedGroupConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfigManagedGroupConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfigManagedGroupConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigManagedGroupConfig) []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigManagedGroupConfig { @@ -2825,23 +2867,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfigAcc if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigAccelerators + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigAccelerators for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigWorkerConfigAcceleratorsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfigAccelerators(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfigAcceleratorsSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigAccelerators) []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigAccelerators { @@ -2977,23 +3022,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorker if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfig) []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfig { @@ -3104,23 +3152,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorker if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigDiskConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigDiskConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigDiskConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigDiskConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigDiskConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigDiskConfig) []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigDiskConfig { @@ -3216,23 +3267,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorker if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigManagedGroupConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigManagedGroupConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigManagedGroupConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigManagedGroupConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigManagedGroupConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigManagedGroupConfig) []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigManagedGroupConfig { @@ -3337,23 +3391,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorker if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigAccelerators + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigAccelerators for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigAcceleratorsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigAccelerators(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigAcceleratorsSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigAccelerators) []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigAccelerators { @@ -3464,23 +3521,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSoftwareConfigS if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigSoftwareConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigSoftwareConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigSoftwareConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSoftwareConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSoftwareConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigSoftwareConfig) []WorkflowTemplatePlacementManagedClusterConfigSoftwareConfig { @@ -3587,23 +3647,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigInitializationA if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigInitializationActions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigInitializationActions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigInitializationActionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigInitializationActions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigInitializationActionsSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigInitializationActions) []WorkflowTemplatePlacementManagedClusterConfigInitializationActions { @@ -3699,23 +3762,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigEncryptionConfi if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigEncryptionConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigEncryptionConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigEncryptionConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigEncryptionConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigEncryptionConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigEncryptionConfig) []WorkflowTemplatePlacementManagedClusterConfigEncryptionConfig { @@ -3811,23 +3877,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigAutoscalingConf if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigAutoscalingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigAutoscalingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigAutoscalingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigAutoscalingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigAutoscalingConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigAutoscalingConfig) []WorkflowTemplatePlacementManagedClusterConfigAutoscalingConfig { @@ -3920,23 +3989,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecurityConfigS if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigSecurityConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigSecurityConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigSecurityConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecurityConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecurityConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigSecurityConfig) []WorkflowTemplatePlacementManagedClusterConfigSecurityConfig { @@ -4143,23 +4215,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecurityConfigK if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigSecurityConfigKerberosConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigSecurityConfigKerberosConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigSecurityConfigKerberosConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecurityConfigKerberosConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecurityConfigKerberosConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigSecurityConfigKerberosConfig) []WorkflowTemplatePlacementManagedClusterConfigSecurityConfigKerberosConfig { @@ -4272,23 +4347,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigLifecycleConfig if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigLifecycleConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigLifecycleConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigLifecycleConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigLifecycleConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigLifecycleConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigLifecycleConfig) []WorkflowTemplatePlacementManagedClusterConfigLifecycleConfig { @@ -4387,23 +4465,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigEndpointConfigS if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigEndpointConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigEndpointConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigEndpointConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigEndpointConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigEndpointConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigEndpointConfig) []WorkflowTemplatePlacementManagedClusterConfigEndpointConfig { @@ -4496,23 +4577,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGkeClusterConfi if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigGkeClusterConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigGkeClusterConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigGkeClusterConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGkeClusterConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGkeClusterConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigGkeClusterConfig) []WorkflowTemplatePlacementManagedClusterConfigGkeClusterConfig { @@ -4617,23 +4701,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGkeClusterConfi if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigGkeClusterConfigNamespacedGkeDeploymentTarget + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigGkeClusterConfigNamespacedGkeDeploymentTarget for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigGkeClusterConfigNamespacedGkeDeploymentTargetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGkeClusterConfigNamespacedGkeDeploymentTarget(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGkeClusterConfigNamespacedGkeDeploymentTargetSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigGkeClusterConfigNamespacedGkeDeploymentTarget) []WorkflowTemplatePlacementManagedClusterConfigGkeClusterConfigNamespacedGkeDeploymentTarget { @@ -4729,23 +4816,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMetastoreConfig if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigMetastoreConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigMetastoreConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigMetastoreConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMetastoreConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMetastoreConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigMetastoreConfig) []WorkflowTemplatePlacementManagedClusterConfigMetastoreConfig { @@ -4850,23 +4940,26 @@ func canonicalizeNewWorkflowTemplatePlacementClusterSelectorSet(c *Client, des, if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementClusterSelector + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementClusterSelector for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementClusterSelectorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementClusterSelector(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementClusterSelectorSlice(c *Client, des, nw []WorkflowTemplatePlacementClusterSelector) []WorkflowTemplatePlacementClusterSelector { @@ -4997,23 +5090,26 @@ func canonicalizeNewWorkflowTemplateJobsSet(c *Client, des, nw []WorkflowTemplat if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsSlice(c *Client, des, nw []WorkflowTemplateJobs) []WorkflowTemplateJobs { @@ -5160,23 +5256,26 @@ func canonicalizeNewWorkflowTemplateJobsHadoopJobSet(c *Client, des, nw []Workfl if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsHadoopJob + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsHadoopJob for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsHadoopJobNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsHadoopJob(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsHadoopJobSlice(c *Client, des, nw []WorkflowTemplateJobsHadoopJob) []WorkflowTemplateJobsHadoopJob { @@ -5272,23 +5371,26 @@ func canonicalizeNewWorkflowTemplateJobsHadoopJobLoggingConfigSet(c *Client, des if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsHadoopJobLoggingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsHadoopJobLoggingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsHadoopJobLoggingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsHadoopJobLoggingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsHadoopJobLoggingConfigSlice(c *Client, des, nw []WorkflowTemplateJobsHadoopJobLoggingConfig) []WorkflowTemplateJobsHadoopJobLoggingConfig { @@ -5435,23 +5537,26 @@ func canonicalizeNewWorkflowTemplateJobsSparkJobSet(c *Client, des, nw []Workflo if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsSparkJob + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsSparkJob for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsSparkJobNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsSparkJob(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsSparkJobSlice(c *Client, des, nw []WorkflowTemplateJobsSparkJob) []WorkflowTemplateJobsSparkJob { @@ -5547,23 +5652,26 @@ func canonicalizeNewWorkflowTemplateJobsSparkJobLoggingConfigSet(c *Client, des, if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsSparkJobLoggingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsSparkJobLoggingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsSparkJobLoggingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsSparkJobLoggingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsSparkJobLoggingConfigSlice(c *Client, des, nw []WorkflowTemplateJobsSparkJobLoggingConfig) []WorkflowTemplateJobsSparkJobLoggingConfig { @@ -5710,23 +5818,26 @@ func canonicalizeNewWorkflowTemplateJobsPysparkJobSet(c *Client, des, nw []Workf if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsPysparkJob + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsPysparkJob for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsPysparkJobNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsPysparkJob(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsPysparkJobSlice(c *Client, des, nw []WorkflowTemplateJobsPysparkJob) []WorkflowTemplateJobsPysparkJob { @@ -5822,23 +5933,26 @@ func canonicalizeNewWorkflowTemplateJobsPysparkJobLoggingConfigSet(c *Client, de if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsPysparkJobLoggingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsPysparkJobLoggingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsPysparkJobLoggingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsPysparkJobLoggingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsPysparkJobLoggingConfigSlice(c *Client, des, nw []WorkflowTemplateJobsPysparkJobLoggingConfig) []WorkflowTemplateJobsPysparkJobLoggingConfig { @@ -5967,23 +6081,26 @@ func canonicalizeNewWorkflowTemplateJobsHiveJobSet(c *Client, des, nw []Workflow if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsHiveJob + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsHiveJob for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsHiveJobNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsHiveJob(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsHiveJobSlice(c *Client, des, nw []WorkflowTemplateJobsHiveJob) []WorkflowTemplateJobsHiveJob { @@ -6082,23 +6199,26 @@ func canonicalizeNewWorkflowTemplateJobsHiveJobQueryListSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsHiveJobQueryList + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsHiveJobQueryList for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsHiveJobQueryListNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsHiveJobQueryList(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsHiveJobQueryListSlice(c *Client, des, nw []WorkflowTemplateJobsHiveJobQueryList) []WorkflowTemplateJobsHiveJobQueryList { @@ -6229,23 +6349,26 @@ func canonicalizeNewWorkflowTemplateJobsPigJobSet(c *Client, des, nw []WorkflowT if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsPigJob + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsPigJob for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsPigJobNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsPigJob(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsPigJobSlice(c *Client, des, nw []WorkflowTemplateJobsPigJob) []WorkflowTemplateJobsPigJob { @@ -6344,23 +6467,26 @@ func canonicalizeNewWorkflowTemplateJobsPigJobQueryListSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsPigJobQueryList + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsPigJobQueryList for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsPigJobQueryListNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsPigJobQueryList(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsPigJobQueryListSlice(c *Client, des, nw []WorkflowTemplateJobsPigJobQueryList) []WorkflowTemplateJobsPigJobQueryList { @@ -6456,23 +6582,26 @@ func canonicalizeNewWorkflowTemplateJobsPigJobLoggingConfigSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsPigJobLoggingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsPigJobLoggingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsPigJobLoggingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsPigJobLoggingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsPigJobLoggingConfigSlice(c *Client, des, nw []WorkflowTemplateJobsPigJobLoggingConfig) []WorkflowTemplateJobsPigJobLoggingConfig { @@ -6603,23 +6732,26 @@ func canonicalizeNewWorkflowTemplateJobsSparkRJobSet(c *Client, des, nw []Workfl if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsSparkRJob + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsSparkRJob for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsSparkRJobNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsSparkRJob(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsSparkRJobSlice(c *Client, des, nw []WorkflowTemplateJobsSparkRJob) []WorkflowTemplateJobsSparkRJob { @@ -6715,23 +6847,26 @@ func canonicalizeNewWorkflowTemplateJobsSparkRJobLoggingConfigSet(c *Client, des if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsSparkRJobLoggingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsSparkRJobLoggingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsSparkRJobLoggingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsSparkRJobLoggingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsSparkRJobLoggingConfigSlice(c *Client, des, nw []WorkflowTemplateJobsSparkRJobLoggingConfig) []WorkflowTemplateJobsSparkRJobLoggingConfig { @@ -6854,23 +6989,26 @@ func canonicalizeNewWorkflowTemplateJobsSparkSqlJobSet(c *Client, des, nw []Work if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsSparkSqlJob + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsSparkSqlJob for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsSparkSqlJobNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsSparkSqlJob(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsSparkSqlJobSlice(c *Client, des, nw []WorkflowTemplateJobsSparkSqlJob) []WorkflowTemplateJobsSparkSqlJob { @@ -6969,23 +7107,26 @@ func canonicalizeNewWorkflowTemplateJobsSparkSqlJobQueryListSet(c *Client, des, if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsSparkSqlJobQueryList + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsSparkSqlJobQueryList for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsSparkSqlJobQueryListNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsSparkSqlJobQueryList(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsSparkSqlJobQueryListSlice(c *Client, des, nw []WorkflowTemplateJobsSparkSqlJobQueryList) []WorkflowTemplateJobsSparkSqlJobQueryList { @@ -7081,23 +7222,26 @@ func canonicalizeNewWorkflowTemplateJobsSparkSqlJobLoggingConfigSet(c *Client, d if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsSparkSqlJobLoggingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsSparkSqlJobLoggingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsSparkSqlJobLoggingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsSparkSqlJobLoggingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsSparkSqlJobLoggingConfigSlice(c *Client, des, nw []WorkflowTemplateJobsSparkSqlJobLoggingConfig) []WorkflowTemplateJobsSparkSqlJobLoggingConfig { @@ -7230,23 +7374,26 @@ func canonicalizeNewWorkflowTemplateJobsPrestoJobSet(c *Client, des, nw []Workfl if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsPrestoJob + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsPrestoJob for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsPrestoJobNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsPrestoJob(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsPrestoJobSlice(c *Client, des, nw []WorkflowTemplateJobsPrestoJob) []WorkflowTemplateJobsPrestoJob { @@ -7345,23 +7492,26 @@ func canonicalizeNewWorkflowTemplateJobsPrestoJobQueryListSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsPrestoJobQueryList + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsPrestoJobQueryList for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsPrestoJobQueryListNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsPrestoJobQueryList(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsPrestoJobQueryListSlice(c *Client, des, nw []WorkflowTemplateJobsPrestoJobQueryList) []WorkflowTemplateJobsPrestoJobQueryList { @@ -7457,23 +7607,26 @@ func canonicalizeNewWorkflowTemplateJobsPrestoJobLoggingConfigSet(c *Client, des if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsPrestoJobLoggingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsPrestoJobLoggingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsPrestoJobLoggingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsPrestoJobLoggingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsPrestoJobLoggingConfigSlice(c *Client, des, nw []WorkflowTemplateJobsPrestoJobLoggingConfig) []WorkflowTemplateJobsPrestoJobLoggingConfig { @@ -7575,23 +7728,26 @@ func canonicalizeNewWorkflowTemplateJobsSchedulingSet(c *Client, des, nw []Workf if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsScheduling + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsScheduling for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsSchedulingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsScheduling(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsSchedulingSlice(c *Client, des, nw []WorkflowTemplateJobsScheduling) []WorkflowTemplateJobsScheduling { @@ -7708,23 +7864,26 @@ func canonicalizeNewWorkflowTemplateParametersSet(c *Client, des, nw []WorkflowT if des == nil { return nw } - var reorderedNew []WorkflowTemplateParameters + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateParameters for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateParametersNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateParameters(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateParametersSlice(c *Client, des, nw []WorkflowTemplateParameters) []WorkflowTemplateParameters { @@ -7819,23 +7978,26 @@ func canonicalizeNewWorkflowTemplateParametersValidationSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []WorkflowTemplateParametersValidation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateParametersValidation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateParametersValidationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateParametersValidation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateParametersValidationSlice(c *Client, des, nw []WorkflowTemplateParametersValidation) []WorkflowTemplateParametersValidation { @@ -7934,23 +8096,26 @@ func canonicalizeNewWorkflowTemplateParametersValidationRegexSet(c *Client, des, if des == nil { return nw } - var reorderedNew []WorkflowTemplateParametersValidationRegex + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateParametersValidationRegex for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateParametersValidationRegexNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateParametersValidationRegex(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateParametersValidationRegexSlice(c *Client, des, nw []WorkflowTemplateParametersValidationRegex) []WorkflowTemplateParametersValidationRegex { @@ -8049,23 +8214,26 @@ func canonicalizeNewWorkflowTemplateParametersValidationValuesSet(c *Client, des if des == nil { return nw } - var reorderedNew []WorkflowTemplateParametersValidationValues + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateParametersValidationValues for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateParametersValidationValuesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateParametersValidationValues(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateParametersValidationValuesSlice(c *Client, des, nw []WorkflowTemplateParametersValidationValues) []WorkflowTemplateParametersValidationValues { diff --git a/services/google/dataproc/autoscaling_policy_internal.go b/services/google/dataproc/autoscaling_policy_internal.go index c39e428dc5..4319277dc8 100755 --- a/services/google/dataproc/autoscaling_policy_internal.go +++ b/services/google/dataproc/autoscaling_policy_internal.go @@ -611,23 +611,26 @@ func canonicalizeNewAutoscalingPolicyBasicAlgorithmSet(c *Client, des, nw []Auto if des == nil { return nw } - var reorderedNew []AutoscalingPolicyBasicAlgorithm + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AutoscalingPolicyBasicAlgorithm for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAutoscalingPolicyBasicAlgorithmNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAutoscalingPolicyBasicAlgorithm(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAutoscalingPolicyBasicAlgorithmSlice(c *Client, des, nw []AutoscalingPolicyBasicAlgorithm) []AutoscalingPolicyBasicAlgorithm { @@ -750,23 +753,26 @@ func canonicalizeNewAutoscalingPolicyBasicAlgorithmYarnConfigSet(c *Client, des, if des == nil { return nw } - var reorderedNew []AutoscalingPolicyBasicAlgorithmYarnConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AutoscalingPolicyBasicAlgorithmYarnConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAutoscalingPolicyBasicAlgorithmYarnConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAutoscalingPolicyBasicAlgorithmYarnConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAutoscalingPolicyBasicAlgorithmYarnConfigSlice(c *Client, des, nw []AutoscalingPolicyBasicAlgorithmYarnConfig) []AutoscalingPolicyBasicAlgorithmYarnConfig { @@ -874,23 +880,26 @@ func canonicalizeNewAutoscalingPolicyWorkerConfigSet(c *Client, des, nw []Autosc if des == nil { return nw } - var reorderedNew []AutoscalingPolicyWorkerConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AutoscalingPolicyWorkerConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAutoscalingPolicyWorkerConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAutoscalingPolicyWorkerConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAutoscalingPolicyWorkerConfigSlice(c *Client, des, nw []AutoscalingPolicyWorkerConfig) []AutoscalingPolicyWorkerConfig { @@ -998,23 +1007,26 @@ func canonicalizeNewAutoscalingPolicySecondaryWorkerConfigSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []AutoscalingPolicySecondaryWorkerConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AutoscalingPolicySecondaryWorkerConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAutoscalingPolicySecondaryWorkerConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAutoscalingPolicySecondaryWorkerConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAutoscalingPolicySecondaryWorkerConfigSlice(c *Client, des, nw []AutoscalingPolicySecondaryWorkerConfig) []AutoscalingPolicySecondaryWorkerConfig { diff --git a/services/google/dataproc/beta/autoscaling_policy_internal.go b/services/google/dataproc/beta/autoscaling_policy_internal.go index cdd8e96ae7..70d7f429bd 100755 --- a/services/google/dataproc/beta/autoscaling_policy_internal.go +++ b/services/google/dataproc/beta/autoscaling_policy_internal.go @@ -611,23 +611,26 @@ func canonicalizeNewAutoscalingPolicyBasicAlgorithmSet(c *Client, des, nw []Auto if des == nil { return nw } - var reorderedNew []AutoscalingPolicyBasicAlgorithm + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AutoscalingPolicyBasicAlgorithm for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAutoscalingPolicyBasicAlgorithmNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAutoscalingPolicyBasicAlgorithm(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAutoscalingPolicyBasicAlgorithmSlice(c *Client, des, nw []AutoscalingPolicyBasicAlgorithm) []AutoscalingPolicyBasicAlgorithm { @@ -750,23 +753,26 @@ func canonicalizeNewAutoscalingPolicyBasicAlgorithmYarnConfigSet(c *Client, des, if des == nil { return nw } - var reorderedNew []AutoscalingPolicyBasicAlgorithmYarnConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AutoscalingPolicyBasicAlgorithmYarnConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAutoscalingPolicyBasicAlgorithmYarnConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAutoscalingPolicyBasicAlgorithmYarnConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAutoscalingPolicyBasicAlgorithmYarnConfigSlice(c *Client, des, nw []AutoscalingPolicyBasicAlgorithmYarnConfig) []AutoscalingPolicyBasicAlgorithmYarnConfig { @@ -874,23 +880,26 @@ func canonicalizeNewAutoscalingPolicyWorkerConfigSet(c *Client, des, nw []Autosc if des == nil { return nw } - var reorderedNew []AutoscalingPolicyWorkerConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AutoscalingPolicyWorkerConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAutoscalingPolicyWorkerConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAutoscalingPolicyWorkerConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAutoscalingPolicyWorkerConfigSlice(c *Client, des, nw []AutoscalingPolicyWorkerConfig) []AutoscalingPolicyWorkerConfig { @@ -998,23 +1007,26 @@ func canonicalizeNewAutoscalingPolicySecondaryWorkerConfigSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []AutoscalingPolicySecondaryWorkerConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AutoscalingPolicySecondaryWorkerConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAutoscalingPolicySecondaryWorkerConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAutoscalingPolicySecondaryWorkerConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAutoscalingPolicySecondaryWorkerConfigSlice(c *Client, des, nw []AutoscalingPolicySecondaryWorkerConfig) []AutoscalingPolicySecondaryWorkerConfig { diff --git a/services/google/dataproc/beta/cluster_internal.go b/services/google/dataproc/beta/cluster_internal.go index 7fdea5c3fd..c13a551699 100755 --- a/services/google/dataproc/beta/cluster_internal.go +++ b/services/google/dataproc/beta/cluster_internal.go @@ -1045,23 +1045,26 @@ func canonicalizeNewClusterConfigSet(c *Client, des, nw []ClusterConfig) []Clust if des == nil { return nw } - var reorderedNew []ClusterConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigSlice(c *Client, des, nw []ClusterConfig) []ClusterConfig { @@ -1222,23 +1225,26 @@ func canonicalizeNewClusterConfigGceClusterConfigSet(c *Client, des, nw []Cluste if des == nil { return nw } - var reorderedNew []ClusterConfigGceClusterConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigGceClusterConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigGceClusterConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigGceClusterConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigGceClusterConfigSlice(c *Client, des, nw []ClusterConfigGceClusterConfig) []ClusterConfigGceClusterConfig { @@ -1351,23 +1357,26 @@ func canonicalizeNewClusterConfigGceClusterConfigReservationAffinitySet(c *Clien if des == nil { return nw } - var reorderedNew []ClusterConfigGceClusterConfigReservationAffinity + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigGceClusterConfigReservationAffinity for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigGceClusterConfigReservationAffinityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigGceClusterConfigReservationAffinity(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigGceClusterConfigReservationAffinitySlice(c *Client, des, nw []ClusterConfigGceClusterConfigReservationAffinity) []ClusterConfigGceClusterConfigReservationAffinity { @@ -1463,23 +1472,26 @@ func canonicalizeNewClusterConfigGceClusterConfigNodeGroupAffinitySet(c *Client, if des == nil { return nw } - var reorderedNew []ClusterConfigGceClusterConfigNodeGroupAffinity + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigGceClusterConfigNodeGroupAffinity for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigGceClusterConfigNodeGroupAffinityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigGceClusterConfigNodeGroupAffinity(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigGceClusterConfigNodeGroupAffinitySlice(c *Client, des, nw []ClusterConfigGceClusterConfigNodeGroupAffinity) []ClusterConfigGceClusterConfigNodeGroupAffinity { @@ -1594,23 +1606,26 @@ func canonicalizeNewClusterConfigGceClusterConfigShieldedInstanceConfigSet(c *Cl if des == nil { return nw } - var reorderedNew []ClusterConfigGceClusterConfigShieldedInstanceConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigGceClusterConfigShieldedInstanceConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigGceClusterConfigShieldedInstanceConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigGceClusterConfigShieldedInstanceConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigGceClusterConfigShieldedInstanceConfigSlice(c *Client, des, nw []ClusterConfigGceClusterConfigShieldedInstanceConfig) []ClusterConfigGceClusterConfigShieldedInstanceConfig { @@ -1709,23 +1724,26 @@ func canonicalizeNewClusterConfigGceClusterConfigConfidentialInstanceConfigSet(c if des == nil { return nw } - var reorderedNew []ClusterConfigGceClusterConfigConfidentialInstanceConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigGceClusterConfigConfidentialInstanceConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigGceClusterConfigConfidentialInstanceConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigGceClusterConfigConfidentialInstanceConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigGceClusterConfigConfidentialInstanceConfigSlice(c *Client, des, nw []ClusterConfigGceClusterConfigConfidentialInstanceConfig) []ClusterConfigGceClusterConfigConfidentialInstanceConfig { @@ -1862,23 +1880,26 @@ func canonicalizeNewClusterConfigMasterConfigSet(c *Client, des, nw []ClusterCon if des == nil { return nw } - var reorderedNew []ClusterConfigMasterConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigMasterConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigMasterConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigMasterConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigMasterConfigSlice(c *Client, des, nw []ClusterConfigMasterConfig) []ClusterConfigMasterConfig { @@ -1997,23 +2018,26 @@ func canonicalizeNewClusterConfigMasterConfigDiskConfigSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []ClusterConfigMasterConfigDiskConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigMasterConfigDiskConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigMasterConfigDiskConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigMasterConfigDiskConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigMasterConfigDiskConfigSlice(c *Client, des, nw []ClusterConfigMasterConfigDiskConfig) []ClusterConfigMasterConfigDiskConfig { @@ -2109,23 +2133,26 @@ func canonicalizeNewClusterConfigMasterConfigManagedGroupConfigSet(c *Client, de if des == nil { return nw } - var reorderedNew []ClusterConfigMasterConfigManagedGroupConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigMasterConfigManagedGroupConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigMasterConfigManagedGroupConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigMasterConfigManagedGroupConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigMasterConfigManagedGroupConfigSlice(c *Client, des, nw []ClusterConfigMasterConfigManagedGroupConfig) []ClusterConfigMasterConfigManagedGroupConfig { @@ -2230,23 +2257,26 @@ func canonicalizeNewClusterConfigMasterConfigAcceleratorsSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []ClusterConfigMasterConfigAccelerators + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigMasterConfigAccelerators for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigMasterConfigAcceleratorsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigMasterConfigAccelerators(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigMasterConfigAcceleratorsSlice(c *Client, des, nw []ClusterConfigMasterConfigAccelerators) []ClusterConfigMasterConfigAccelerators { @@ -2369,23 +2399,26 @@ func canonicalizeNewClusterConfigMasterConfigInstanceReferencesSet(c *Client, de if des == nil { return nw } - var reorderedNew []ClusterConfigMasterConfigInstanceReferences + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigMasterConfigInstanceReferences for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigMasterConfigInstanceReferencesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigMasterConfigInstanceReferences(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigMasterConfigInstanceReferencesSlice(c *Client, des, nw []ClusterConfigMasterConfigInstanceReferences) []ClusterConfigMasterConfigInstanceReferences { @@ -2522,23 +2555,26 @@ func canonicalizeNewClusterConfigWorkerConfigSet(c *Client, des, nw []ClusterCon if des == nil { return nw } - var reorderedNew []ClusterConfigWorkerConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigWorkerConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigWorkerConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigWorkerConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigWorkerConfigSlice(c *Client, des, nw []ClusterConfigWorkerConfig) []ClusterConfigWorkerConfig { @@ -2657,23 +2693,26 @@ func canonicalizeNewClusterConfigWorkerConfigDiskConfigSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []ClusterConfigWorkerConfigDiskConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigWorkerConfigDiskConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigWorkerConfigDiskConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigWorkerConfigDiskConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigWorkerConfigDiskConfigSlice(c *Client, des, nw []ClusterConfigWorkerConfigDiskConfig) []ClusterConfigWorkerConfigDiskConfig { @@ -2769,23 +2808,26 @@ func canonicalizeNewClusterConfigWorkerConfigManagedGroupConfigSet(c *Client, de if des == nil { return nw } - var reorderedNew []ClusterConfigWorkerConfigManagedGroupConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigWorkerConfigManagedGroupConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigWorkerConfigManagedGroupConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigWorkerConfigManagedGroupConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigWorkerConfigManagedGroupConfigSlice(c *Client, des, nw []ClusterConfigWorkerConfigManagedGroupConfig) []ClusterConfigWorkerConfigManagedGroupConfig { @@ -2890,23 +2932,26 @@ func canonicalizeNewClusterConfigWorkerConfigAcceleratorsSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []ClusterConfigWorkerConfigAccelerators + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigWorkerConfigAccelerators for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigWorkerConfigAcceleratorsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigWorkerConfigAccelerators(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigWorkerConfigAcceleratorsSlice(c *Client, des, nw []ClusterConfigWorkerConfigAccelerators) []ClusterConfigWorkerConfigAccelerators { @@ -3029,23 +3074,26 @@ func canonicalizeNewClusterConfigWorkerConfigInstanceReferencesSet(c *Client, de if des == nil { return nw } - var reorderedNew []ClusterConfigWorkerConfigInstanceReferences + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigWorkerConfigInstanceReferences for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigWorkerConfigInstanceReferencesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigWorkerConfigInstanceReferences(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigWorkerConfigInstanceReferencesSlice(c *Client, des, nw []ClusterConfigWorkerConfigInstanceReferences) []ClusterConfigWorkerConfigInstanceReferences { @@ -3182,23 +3230,26 @@ func canonicalizeNewClusterConfigSecondaryWorkerConfigSet(c *Client, des, nw []C if des == nil { return nw } - var reorderedNew []ClusterConfigSecondaryWorkerConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigSecondaryWorkerConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigSecondaryWorkerConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigSecondaryWorkerConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigSecondaryWorkerConfigSlice(c *Client, des, nw []ClusterConfigSecondaryWorkerConfig) []ClusterConfigSecondaryWorkerConfig { @@ -3317,23 +3368,26 @@ func canonicalizeNewClusterConfigSecondaryWorkerConfigDiskConfigSet(c *Client, d if des == nil { return nw } - var reorderedNew []ClusterConfigSecondaryWorkerConfigDiskConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigSecondaryWorkerConfigDiskConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigSecondaryWorkerConfigDiskConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigSecondaryWorkerConfigDiskConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigSecondaryWorkerConfigDiskConfigSlice(c *Client, des, nw []ClusterConfigSecondaryWorkerConfigDiskConfig) []ClusterConfigSecondaryWorkerConfigDiskConfig { @@ -3429,23 +3483,26 @@ func canonicalizeNewClusterConfigSecondaryWorkerConfigManagedGroupConfigSet(c *C if des == nil { return nw } - var reorderedNew []ClusterConfigSecondaryWorkerConfigManagedGroupConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigSecondaryWorkerConfigManagedGroupConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigSecondaryWorkerConfigManagedGroupConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigSecondaryWorkerConfigManagedGroupConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigSecondaryWorkerConfigManagedGroupConfigSlice(c *Client, des, nw []ClusterConfigSecondaryWorkerConfigManagedGroupConfig) []ClusterConfigSecondaryWorkerConfigManagedGroupConfig { @@ -3550,23 +3607,26 @@ func canonicalizeNewClusterConfigSecondaryWorkerConfigAcceleratorsSet(c *Client, if des == nil { return nw } - var reorderedNew []ClusterConfigSecondaryWorkerConfigAccelerators + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigSecondaryWorkerConfigAccelerators for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigSecondaryWorkerConfigAcceleratorsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigSecondaryWorkerConfigAccelerators(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigSecondaryWorkerConfigAcceleratorsSlice(c *Client, des, nw []ClusterConfigSecondaryWorkerConfigAccelerators) []ClusterConfigSecondaryWorkerConfigAccelerators { @@ -3689,23 +3749,26 @@ func canonicalizeNewClusterConfigSecondaryWorkerConfigInstanceReferencesSet(c *C if des == nil { return nw } - var reorderedNew []ClusterConfigSecondaryWorkerConfigInstanceReferences + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigSecondaryWorkerConfigInstanceReferences for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigSecondaryWorkerConfigInstanceReferencesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigSecondaryWorkerConfigInstanceReferences(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigSecondaryWorkerConfigInstanceReferencesSlice(c *Client, des, nw []ClusterConfigSecondaryWorkerConfigInstanceReferences) []ClusterConfigSecondaryWorkerConfigInstanceReferences { @@ -3818,23 +3881,26 @@ func canonicalizeNewClusterConfigSoftwareConfigSet(c *Client, des, nw []ClusterC if des == nil { return nw } - var reorderedNew []ClusterConfigSoftwareConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigSoftwareConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigSoftwareConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigSoftwareConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigSoftwareConfigSlice(c *Client, des, nw []ClusterConfigSoftwareConfig) []ClusterConfigSoftwareConfig { @@ -3941,23 +4007,26 @@ func canonicalizeNewClusterConfigInitializationActionsSet(c *Client, des, nw []C if des == nil { return nw } - var reorderedNew []ClusterConfigInitializationActions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigInitializationActions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigInitializationActionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigInitializationActions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigInitializationActionsSlice(c *Client, des, nw []ClusterConfigInitializationActions) []ClusterConfigInitializationActions { @@ -4053,23 +4122,26 @@ func canonicalizeNewClusterConfigEncryptionConfigSet(c *Client, des, nw []Cluste if des == nil { return nw } - var reorderedNew []ClusterConfigEncryptionConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigEncryptionConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigEncryptionConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigEncryptionConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigEncryptionConfigSlice(c *Client, des, nw []ClusterConfigEncryptionConfig) []ClusterConfigEncryptionConfig { @@ -4165,23 +4237,26 @@ func canonicalizeNewClusterConfigAutoscalingConfigSet(c *Client, des, nw []Clust if des == nil { return nw } - var reorderedNew []ClusterConfigAutoscalingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigAutoscalingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigAutoscalingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigAutoscalingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigAutoscalingConfigSlice(c *Client, des, nw []ClusterConfigAutoscalingConfig) []ClusterConfigAutoscalingConfig { @@ -4276,23 +4351,26 @@ func canonicalizeNewClusterConfigSecurityConfigSet(c *Client, des, nw []ClusterC if des == nil { return nw } - var reorderedNew []ClusterConfigSecurityConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigSecurityConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigSecurityConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigSecurityConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigSecurityConfigSlice(c *Client, des, nw []ClusterConfigSecurityConfig) []ClusterConfigSecurityConfig { @@ -4499,23 +4577,26 @@ func canonicalizeNewClusterConfigSecurityConfigKerberosConfigSet(c *Client, des, if des == nil { return nw } - var reorderedNew []ClusterConfigSecurityConfigKerberosConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigSecurityConfigKerberosConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigSecurityConfigKerberosConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigSecurityConfigKerberosConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigSecurityConfigKerberosConfigSlice(c *Client, des, nw []ClusterConfigSecurityConfigKerberosConfig) []ClusterConfigSecurityConfigKerberosConfig { @@ -4611,23 +4692,26 @@ func canonicalizeNewClusterConfigSecurityConfigIdentityConfigSet(c *Client, des, if des == nil { return nw } - var reorderedNew []ClusterConfigSecurityConfigIdentityConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigSecurityConfigIdentityConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigSecurityConfigIdentityConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigSecurityConfigIdentityConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigSecurityConfigIdentityConfigSlice(c *Client, des, nw []ClusterConfigSecurityConfigIdentityConfig) []ClusterConfigSecurityConfigIdentityConfig { @@ -4740,23 +4824,26 @@ func canonicalizeNewClusterConfigLifecycleConfigSet(c *Client, des, nw []Cluster if des == nil { return nw } - var reorderedNew []ClusterConfigLifecycleConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigLifecycleConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigLifecycleConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigLifecycleConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigLifecycleConfigSlice(c *Client, des, nw []ClusterConfigLifecycleConfig) []ClusterConfigLifecycleConfig { @@ -4855,23 +4942,26 @@ func canonicalizeNewClusterConfigEndpointConfigSet(c *Client, des, nw []ClusterC if des == nil { return nw } - var reorderedNew []ClusterConfigEndpointConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigEndpointConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigEndpointConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigEndpointConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigEndpointConfigSlice(c *Client, des, nw []ClusterConfigEndpointConfig) []ClusterConfigEndpointConfig { @@ -4964,23 +5054,26 @@ func canonicalizeNewClusterConfigGkeClusterConfigSet(c *Client, des, nw []Cluste if des == nil { return nw } - var reorderedNew []ClusterConfigGkeClusterConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigGkeClusterConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigGkeClusterConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigGkeClusterConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigGkeClusterConfigSlice(c *Client, des, nw []ClusterConfigGkeClusterConfig) []ClusterConfigGkeClusterConfig { @@ -5085,23 +5178,26 @@ func canonicalizeNewClusterConfigGkeClusterConfigNamespacedGkeDeploymentTargetSe if des == nil { return nw } - var reorderedNew []ClusterConfigGkeClusterConfigNamespacedGkeDeploymentTarget + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigGkeClusterConfigNamespacedGkeDeploymentTarget for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigGkeClusterConfigNamespacedGkeDeploymentTargetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigGkeClusterConfigNamespacedGkeDeploymentTarget(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigGkeClusterConfigNamespacedGkeDeploymentTargetSlice(c *Client, des, nw []ClusterConfigGkeClusterConfigNamespacedGkeDeploymentTarget) []ClusterConfigGkeClusterConfigNamespacedGkeDeploymentTarget { @@ -5197,23 +5293,26 @@ func canonicalizeNewClusterConfigMetastoreConfigSet(c *Client, des, nw []Cluster if des == nil { return nw } - var reorderedNew []ClusterConfigMetastoreConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigMetastoreConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigMetastoreConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigMetastoreConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigMetastoreConfigSlice(c *Client, des, nw []ClusterConfigMetastoreConfig) []ClusterConfigMetastoreConfig { @@ -5306,23 +5405,26 @@ func canonicalizeNewClusterConfigDataprocMetricConfigSet(c *Client, des, nw []Cl if des == nil { return nw } - var reorderedNew []ClusterConfigDataprocMetricConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigDataprocMetricConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigDataprocMetricConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigDataprocMetricConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigDataprocMetricConfigSlice(c *Client, des, nw []ClusterConfigDataprocMetricConfig) []ClusterConfigDataprocMetricConfig { @@ -5427,23 +5529,26 @@ func canonicalizeNewClusterConfigDataprocMetricConfigMetricsSet(c *Client, des, if des == nil { return nw } - var reorderedNew []ClusterConfigDataprocMetricConfigMetrics + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigDataprocMetricConfigMetrics for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigDataprocMetricConfigMetricsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigDataprocMetricConfigMetrics(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigDataprocMetricConfigMetricsSlice(c *Client, des, nw []ClusterConfigDataprocMetricConfigMetrics) []ClusterConfigDataprocMetricConfigMetrics { @@ -5536,23 +5641,26 @@ func canonicalizeNewClusterStatusSet(c *Client, des, nw []ClusterStatus) []Clust if des == nil { return nw } - var reorderedNew []ClusterStatus + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterStatus for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterStatusNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterStatus(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterStatusSlice(c *Client, des, nw []ClusterStatus) []ClusterStatus { @@ -5645,23 +5753,26 @@ func canonicalizeNewClusterStatusHistorySet(c *Client, des, nw []ClusterStatusHi if des == nil { return nw } - var reorderedNew []ClusterStatusHistory + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterStatusHistory for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterStatusHistoryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterStatusHistory(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterStatusHistorySlice(c *Client, des, nw []ClusterStatusHistory) []ClusterStatusHistory { @@ -5763,23 +5874,26 @@ func canonicalizeNewClusterMetricsSet(c *Client, des, nw []ClusterMetrics) []Clu if des == nil { return nw } - var reorderedNew []ClusterMetrics + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterMetrics for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterMetricsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterMetrics(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterMetricsSlice(c *Client, des, nw []ClusterMetrics) []ClusterMetrics { @@ -5880,23 +5994,26 @@ func canonicalizeNewClusterVirtualClusterConfigSet(c *Client, des, nw []ClusterV if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigSlice(c *Client, des, nw []ClusterVirtualClusterConfig) []ClusterVirtualClusterConfig { @@ -5999,23 +6116,26 @@ func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigSet(c *Cli if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigKubernetesClusterConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigKubernetesClusterConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigKubernetesClusterConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigSlice(c *Client, des, nw []ClusterVirtualClusterConfigKubernetesClusterConfig) []ClusterVirtualClusterConfigKubernetesClusterConfig { @@ -6114,23 +6234,26 @@ func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeCluster if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigSlice(c *Client, des, nw []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfig) []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfig { @@ -6235,23 +6358,26 @@ func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeCluster if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTarget + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTarget for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTarget(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetSlice(c *Client, des, nw []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTarget) []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTarget { @@ -6354,23 +6480,26 @@ func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeCluster if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigSlice(c *Client, des, nw []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfig) []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfig { @@ -6511,23 +6640,26 @@ func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeCluster if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigSlice(c *Client, des, nw []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfig) []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfig { @@ -6640,23 +6772,26 @@ func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeCluster if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigAccelerators + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigAccelerators for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigAcceleratorsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigAccelerators(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigAcceleratorsSlice(c *Client, des, nw []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigAccelerators) []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigAccelerators { @@ -6752,23 +6887,26 @@ func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeCluster if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigEphemeralStorageConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigEphemeralStorageConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigEphemeralStorageConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigEphemeralStorageConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigEphemeralStorageConfigSlice(c *Client, des, nw []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigEphemeralStorageConfig) []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigEphemeralStorageConfig { @@ -6870,23 +7008,26 @@ func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeCluster if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigAutoscaling + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigAutoscaling for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigAutoscalingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigAutoscaling(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigAutoscalingSlice(c *Client, des, nw []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigAutoscaling) []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigAutoscaling { @@ -6988,23 +7129,26 @@ func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigKubernetes if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigKubernetesClusterConfigKubernetesSoftwareConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigKubernetesClusterConfigKubernetesSoftwareConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigKubernetesClusterConfigKubernetesSoftwareConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigKubernetesSoftwareConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigKubernetesSoftwareConfigSlice(c *Client, des, nw []ClusterVirtualClusterConfigKubernetesClusterConfigKubernetesSoftwareConfig) []ClusterVirtualClusterConfigKubernetesClusterConfigKubernetesSoftwareConfig { @@ -7099,23 +7243,26 @@ func canonicalizeNewClusterVirtualClusterConfigAuxiliaryServicesConfigSet(c *Cli if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigAuxiliaryServicesConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigAuxiliaryServicesConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigAuxiliaryServicesConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigAuxiliaryServicesConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigAuxiliaryServicesConfigSlice(c *Client, des, nw []ClusterVirtualClusterConfigAuxiliaryServicesConfig) []ClusterVirtualClusterConfigAuxiliaryServicesConfig { @@ -7211,23 +7358,26 @@ func canonicalizeNewClusterVirtualClusterConfigAuxiliaryServicesConfigMetastoreC if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigAuxiliaryServicesConfigMetastoreConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigAuxiliaryServicesConfigMetastoreConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigAuxiliaryServicesConfigMetastoreConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigAuxiliaryServicesConfigMetastoreConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigAuxiliaryServicesConfigMetastoreConfigSlice(c *Client, des, nw []ClusterVirtualClusterConfigAuxiliaryServicesConfigMetastoreConfig) []ClusterVirtualClusterConfigAuxiliaryServicesConfigMetastoreConfig { @@ -7323,23 +7473,26 @@ func canonicalizeNewClusterVirtualClusterConfigAuxiliaryServicesConfigSparkHisto if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigAuxiliaryServicesConfigSparkHistoryServerConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigAuxiliaryServicesConfigSparkHistoryServerConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigAuxiliaryServicesConfigSparkHistoryServerConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigAuxiliaryServicesConfigSparkHistoryServerConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigAuxiliaryServicesConfigSparkHistoryServerConfigSlice(c *Client, des, nw []ClusterVirtualClusterConfigAuxiliaryServicesConfigSparkHistoryServerConfig) []ClusterVirtualClusterConfigAuxiliaryServicesConfigSparkHistoryServerConfig { diff --git a/services/google/dataproc/beta/workflow_template_internal.go b/services/google/dataproc/beta/workflow_template_internal.go index 1c0f395488..44a7f8f073 100755 --- a/services/google/dataproc/beta/workflow_template_internal.go +++ b/services/google/dataproc/beta/workflow_template_internal.go @@ -986,23 +986,26 @@ func canonicalizeNewWorkflowTemplatePlacementSet(c *Client, des, nw []WorkflowTe if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacement + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacement for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacement(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementSlice(c *Client, des, nw []WorkflowTemplatePlacement) []WorkflowTemplatePlacement { @@ -1109,23 +1112,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedCluster + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedCluster for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedCluster(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedCluster) []WorkflowTemplatePlacementManagedCluster { @@ -1254,23 +1260,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSet(c *Client, if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfig) []WorkflowTemplatePlacementManagedClusterConfig { @@ -1429,23 +1438,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfi if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfig) []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfig { @@ -1558,23 +1570,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfi if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigReservationAffinity + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigReservationAffinity for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigReservationAffinityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigReservationAffinity(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigReservationAffinitySlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigReservationAffinity) []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigReservationAffinity { @@ -1670,23 +1685,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfi if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigNodeGroupAffinity + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigNodeGroupAffinity for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigNodeGroupAffinityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigNodeGroupAffinity(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigNodeGroupAffinitySlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigNodeGroupAffinity) []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigNodeGroupAffinity { @@ -1801,23 +1819,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfi if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigShieldedInstanceConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigShieldedInstanceConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigShieldedInstanceConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigShieldedInstanceConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigShieldedInstanceConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigShieldedInstanceConfig) []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigShieldedInstanceConfig { @@ -1953,23 +1974,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfigSet if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigMasterConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigMasterConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigMasterConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigMasterConfig) []WorkflowTemplatePlacementManagedClusterConfigMasterConfig { @@ -2080,23 +2104,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfigDis if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigMasterConfigDiskConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigMasterConfigDiskConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigMasterConfigDiskConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfigDiskConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfigDiskConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigMasterConfigDiskConfig) []WorkflowTemplatePlacementManagedClusterConfigMasterConfigDiskConfig { @@ -2192,23 +2219,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfigMan if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigMasterConfigManagedGroupConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigMasterConfigManagedGroupConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigMasterConfigManagedGroupConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfigManagedGroupConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfigManagedGroupConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigMasterConfigManagedGroupConfig) []WorkflowTemplatePlacementManagedClusterConfigMasterConfigManagedGroupConfig { @@ -2313,23 +2343,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfigAcc if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigMasterConfigAccelerators + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigMasterConfigAccelerators for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigMasterConfigAcceleratorsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfigAccelerators(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfigAcceleratorsSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigMasterConfigAccelerators) []WorkflowTemplatePlacementManagedClusterConfigMasterConfigAccelerators { @@ -2465,23 +2498,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfigSet if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigWorkerConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigWorkerConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigWorkerConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigWorkerConfig) []WorkflowTemplatePlacementManagedClusterConfigWorkerConfig { @@ -2592,23 +2628,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfigDis if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigDiskConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigDiskConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigWorkerConfigDiskConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfigDiskConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfigDiskConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigDiskConfig) []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigDiskConfig { @@ -2704,23 +2743,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfigMan if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigManagedGroupConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigManagedGroupConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigWorkerConfigManagedGroupConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfigManagedGroupConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfigManagedGroupConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigManagedGroupConfig) []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigManagedGroupConfig { @@ -2825,23 +2867,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfigAcc if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigAccelerators + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigAccelerators for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigWorkerConfigAcceleratorsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfigAccelerators(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfigAcceleratorsSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigAccelerators) []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigAccelerators { @@ -2977,23 +3022,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorker if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfig) []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfig { @@ -3104,23 +3152,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorker if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigDiskConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigDiskConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigDiskConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigDiskConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigDiskConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigDiskConfig) []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigDiskConfig { @@ -3216,23 +3267,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorker if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigManagedGroupConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigManagedGroupConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigManagedGroupConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigManagedGroupConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigManagedGroupConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigManagedGroupConfig) []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigManagedGroupConfig { @@ -3337,23 +3391,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorker if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigAccelerators + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigAccelerators for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigAcceleratorsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigAccelerators(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigAcceleratorsSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigAccelerators) []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigAccelerators { @@ -3464,23 +3521,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSoftwareConfigS if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigSoftwareConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigSoftwareConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigSoftwareConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSoftwareConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSoftwareConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigSoftwareConfig) []WorkflowTemplatePlacementManagedClusterConfigSoftwareConfig { @@ -3587,23 +3647,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigInitializationA if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigInitializationActions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigInitializationActions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigInitializationActionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigInitializationActions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigInitializationActionsSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigInitializationActions) []WorkflowTemplatePlacementManagedClusterConfigInitializationActions { @@ -3699,23 +3762,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigEncryptionConfi if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigEncryptionConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigEncryptionConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigEncryptionConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigEncryptionConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigEncryptionConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigEncryptionConfig) []WorkflowTemplatePlacementManagedClusterConfigEncryptionConfig { @@ -3811,23 +3877,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigAutoscalingConf if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigAutoscalingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigAutoscalingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigAutoscalingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigAutoscalingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigAutoscalingConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigAutoscalingConfig) []WorkflowTemplatePlacementManagedClusterConfigAutoscalingConfig { @@ -3920,23 +3989,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecurityConfigS if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigSecurityConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigSecurityConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigSecurityConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecurityConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecurityConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigSecurityConfig) []WorkflowTemplatePlacementManagedClusterConfigSecurityConfig { @@ -4143,23 +4215,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecurityConfigK if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigSecurityConfigKerberosConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigSecurityConfigKerberosConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigSecurityConfigKerberosConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecurityConfigKerberosConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecurityConfigKerberosConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigSecurityConfigKerberosConfig) []WorkflowTemplatePlacementManagedClusterConfigSecurityConfigKerberosConfig { @@ -4272,23 +4347,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigLifecycleConfig if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigLifecycleConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigLifecycleConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigLifecycleConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigLifecycleConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigLifecycleConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigLifecycleConfig) []WorkflowTemplatePlacementManagedClusterConfigLifecycleConfig { @@ -4387,23 +4465,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigEndpointConfigS if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigEndpointConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigEndpointConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigEndpointConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigEndpointConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigEndpointConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigEndpointConfig) []WorkflowTemplatePlacementManagedClusterConfigEndpointConfig { @@ -4496,23 +4577,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGkeClusterConfi if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigGkeClusterConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigGkeClusterConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigGkeClusterConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGkeClusterConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGkeClusterConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigGkeClusterConfig) []WorkflowTemplatePlacementManagedClusterConfigGkeClusterConfig { @@ -4617,23 +4701,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGkeClusterConfi if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigGkeClusterConfigNamespacedGkeDeploymentTarget + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigGkeClusterConfigNamespacedGkeDeploymentTarget for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigGkeClusterConfigNamespacedGkeDeploymentTargetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGkeClusterConfigNamespacedGkeDeploymentTarget(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGkeClusterConfigNamespacedGkeDeploymentTargetSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigGkeClusterConfigNamespacedGkeDeploymentTarget) []WorkflowTemplatePlacementManagedClusterConfigGkeClusterConfigNamespacedGkeDeploymentTarget { @@ -4729,23 +4816,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMetastoreConfig if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigMetastoreConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigMetastoreConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigMetastoreConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMetastoreConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMetastoreConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigMetastoreConfig) []WorkflowTemplatePlacementManagedClusterConfigMetastoreConfig { @@ -4850,23 +4940,26 @@ func canonicalizeNewWorkflowTemplatePlacementClusterSelectorSet(c *Client, des, if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementClusterSelector + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementClusterSelector for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementClusterSelectorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementClusterSelector(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementClusterSelectorSlice(c *Client, des, nw []WorkflowTemplatePlacementClusterSelector) []WorkflowTemplatePlacementClusterSelector { @@ -4997,23 +5090,26 @@ func canonicalizeNewWorkflowTemplateJobsSet(c *Client, des, nw []WorkflowTemplat if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsSlice(c *Client, des, nw []WorkflowTemplateJobs) []WorkflowTemplateJobs { @@ -5160,23 +5256,26 @@ func canonicalizeNewWorkflowTemplateJobsHadoopJobSet(c *Client, des, nw []Workfl if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsHadoopJob + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsHadoopJob for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsHadoopJobNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsHadoopJob(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsHadoopJobSlice(c *Client, des, nw []WorkflowTemplateJobsHadoopJob) []WorkflowTemplateJobsHadoopJob { @@ -5272,23 +5371,26 @@ func canonicalizeNewWorkflowTemplateJobsHadoopJobLoggingConfigSet(c *Client, des if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsHadoopJobLoggingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsHadoopJobLoggingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsHadoopJobLoggingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsHadoopJobLoggingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsHadoopJobLoggingConfigSlice(c *Client, des, nw []WorkflowTemplateJobsHadoopJobLoggingConfig) []WorkflowTemplateJobsHadoopJobLoggingConfig { @@ -5435,23 +5537,26 @@ func canonicalizeNewWorkflowTemplateJobsSparkJobSet(c *Client, des, nw []Workflo if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsSparkJob + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsSparkJob for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsSparkJobNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsSparkJob(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsSparkJobSlice(c *Client, des, nw []WorkflowTemplateJobsSparkJob) []WorkflowTemplateJobsSparkJob { @@ -5547,23 +5652,26 @@ func canonicalizeNewWorkflowTemplateJobsSparkJobLoggingConfigSet(c *Client, des, if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsSparkJobLoggingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsSparkJobLoggingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsSparkJobLoggingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsSparkJobLoggingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsSparkJobLoggingConfigSlice(c *Client, des, nw []WorkflowTemplateJobsSparkJobLoggingConfig) []WorkflowTemplateJobsSparkJobLoggingConfig { @@ -5710,23 +5818,26 @@ func canonicalizeNewWorkflowTemplateJobsPysparkJobSet(c *Client, des, nw []Workf if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsPysparkJob + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsPysparkJob for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsPysparkJobNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsPysparkJob(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsPysparkJobSlice(c *Client, des, nw []WorkflowTemplateJobsPysparkJob) []WorkflowTemplateJobsPysparkJob { @@ -5822,23 +5933,26 @@ func canonicalizeNewWorkflowTemplateJobsPysparkJobLoggingConfigSet(c *Client, de if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsPysparkJobLoggingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsPysparkJobLoggingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsPysparkJobLoggingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsPysparkJobLoggingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsPysparkJobLoggingConfigSlice(c *Client, des, nw []WorkflowTemplateJobsPysparkJobLoggingConfig) []WorkflowTemplateJobsPysparkJobLoggingConfig { @@ -5967,23 +6081,26 @@ func canonicalizeNewWorkflowTemplateJobsHiveJobSet(c *Client, des, nw []Workflow if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsHiveJob + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsHiveJob for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsHiveJobNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsHiveJob(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsHiveJobSlice(c *Client, des, nw []WorkflowTemplateJobsHiveJob) []WorkflowTemplateJobsHiveJob { @@ -6082,23 +6199,26 @@ func canonicalizeNewWorkflowTemplateJobsHiveJobQueryListSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsHiveJobQueryList + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsHiveJobQueryList for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsHiveJobQueryListNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsHiveJobQueryList(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsHiveJobQueryListSlice(c *Client, des, nw []WorkflowTemplateJobsHiveJobQueryList) []WorkflowTemplateJobsHiveJobQueryList { @@ -6229,23 +6349,26 @@ func canonicalizeNewWorkflowTemplateJobsPigJobSet(c *Client, des, nw []WorkflowT if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsPigJob + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsPigJob for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsPigJobNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsPigJob(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsPigJobSlice(c *Client, des, nw []WorkflowTemplateJobsPigJob) []WorkflowTemplateJobsPigJob { @@ -6344,23 +6467,26 @@ func canonicalizeNewWorkflowTemplateJobsPigJobQueryListSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsPigJobQueryList + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsPigJobQueryList for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsPigJobQueryListNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsPigJobQueryList(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsPigJobQueryListSlice(c *Client, des, nw []WorkflowTemplateJobsPigJobQueryList) []WorkflowTemplateJobsPigJobQueryList { @@ -6456,23 +6582,26 @@ func canonicalizeNewWorkflowTemplateJobsPigJobLoggingConfigSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsPigJobLoggingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsPigJobLoggingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsPigJobLoggingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsPigJobLoggingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsPigJobLoggingConfigSlice(c *Client, des, nw []WorkflowTemplateJobsPigJobLoggingConfig) []WorkflowTemplateJobsPigJobLoggingConfig { @@ -6603,23 +6732,26 @@ func canonicalizeNewWorkflowTemplateJobsSparkRJobSet(c *Client, des, nw []Workfl if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsSparkRJob + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsSparkRJob for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsSparkRJobNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsSparkRJob(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsSparkRJobSlice(c *Client, des, nw []WorkflowTemplateJobsSparkRJob) []WorkflowTemplateJobsSparkRJob { @@ -6715,23 +6847,26 @@ func canonicalizeNewWorkflowTemplateJobsSparkRJobLoggingConfigSet(c *Client, des if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsSparkRJobLoggingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsSparkRJobLoggingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsSparkRJobLoggingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsSparkRJobLoggingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsSparkRJobLoggingConfigSlice(c *Client, des, nw []WorkflowTemplateJobsSparkRJobLoggingConfig) []WorkflowTemplateJobsSparkRJobLoggingConfig { @@ -6854,23 +6989,26 @@ func canonicalizeNewWorkflowTemplateJobsSparkSqlJobSet(c *Client, des, nw []Work if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsSparkSqlJob + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsSparkSqlJob for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsSparkSqlJobNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsSparkSqlJob(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsSparkSqlJobSlice(c *Client, des, nw []WorkflowTemplateJobsSparkSqlJob) []WorkflowTemplateJobsSparkSqlJob { @@ -6969,23 +7107,26 @@ func canonicalizeNewWorkflowTemplateJobsSparkSqlJobQueryListSet(c *Client, des, if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsSparkSqlJobQueryList + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsSparkSqlJobQueryList for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsSparkSqlJobQueryListNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsSparkSqlJobQueryList(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsSparkSqlJobQueryListSlice(c *Client, des, nw []WorkflowTemplateJobsSparkSqlJobQueryList) []WorkflowTemplateJobsSparkSqlJobQueryList { @@ -7081,23 +7222,26 @@ func canonicalizeNewWorkflowTemplateJobsSparkSqlJobLoggingConfigSet(c *Client, d if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsSparkSqlJobLoggingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsSparkSqlJobLoggingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsSparkSqlJobLoggingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsSparkSqlJobLoggingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsSparkSqlJobLoggingConfigSlice(c *Client, des, nw []WorkflowTemplateJobsSparkSqlJobLoggingConfig) []WorkflowTemplateJobsSparkSqlJobLoggingConfig { @@ -7230,23 +7374,26 @@ func canonicalizeNewWorkflowTemplateJobsPrestoJobSet(c *Client, des, nw []Workfl if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsPrestoJob + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsPrestoJob for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsPrestoJobNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsPrestoJob(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsPrestoJobSlice(c *Client, des, nw []WorkflowTemplateJobsPrestoJob) []WorkflowTemplateJobsPrestoJob { @@ -7345,23 +7492,26 @@ func canonicalizeNewWorkflowTemplateJobsPrestoJobQueryListSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsPrestoJobQueryList + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsPrestoJobQueryList for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsPrestoJobQueryListNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsPrestoJobQueryList(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsPrestoJobQueryListSlice(c *Client, des, nw []WorkflowTemplateJobsPrestoJobQueryList) []WorkflowTemplateJobsPrestoJobQueryList { @@ -7457,23 +7607,26 @@ func canonicalizeNewWorkflowTemplateJobsPrestoJobLoggingConfigSet(c *Client, des if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsPrestoJobLoggingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsPrestoJobLoggingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsPrestoJobLoggingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsPrestoJobLoggingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsPrestoJobLoggingConfigSlice(c *Client, des, nw []WorkflowTemplateJobsPrestoJobLoggingConfig) []WorkflowTemplateJobsPrestoJobLoggingConfig { @@ -7575,23 +7728,26 @@ func canonicalizeNewWorkflowTemplateJobsSchedulingSet(c *Client, des, nw []Workf if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsScheduling + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsScheduling for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsSchedulingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsScheduling(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsSchedulingSlice(c *Client, des, nw []WorkflowTemplateJobsScheduling) []WorkflowTemplateJobsScheduling { @@ -7708,23 +7864,26 @@ func canonicalizeNewWorkflowTemplateParametersSet(c *Client, des, nw []WorkflowT if des == nil { return nw } - var reorderedNew []WorkflowTemplateParameters + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateParameters for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateParametersNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateParameters(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateParametersSlice(c *Client, des, nw []WorkflowTemplateParameters) []WorkflowTemplateParameters { @@ -7819,23 +7978,26 @@ func canonicalizeNewWorkflowTemplateParametersValidationSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []WorkflowTemplateParametersValidation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateParametersValidation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateParametersValidationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateParametersValidation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateParametersValidationSlice(c *Client, des, nw []WorkflowTemplateParametersValidation) []WorkflowTemplateParametersValidation { @@ -7934,23 +8096,26 @@ func canonicalizeNewWorkflowTemplateParametersValidationRegexSet(c *Client, des, if des == nil { return nw } - var reorderedNew []WorkflowTemplateParametersValidationRegex + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateParametersValidationRegex for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateParametersValidationRegexNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateParametersValidationRegex(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateParametersValidationRegexSlice(c *Client, des, nw []WorkflowTemplateParametersValidationRegex) []WorkflowTemplateParametersValidationRegex { @@ -8049,23 +8214,26 @@ func canonicalizeNewWorkflowTemplateParametersValidationValuesSet(c *Client, des if des == nil { return nw } - var reorderedNew []WorkflowTemplateParametersValidationValues + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateParametersValidationValues for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateParametersValidationValuesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateParametersValidationValues(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateParametersValidationValuesSlice(c *Client, des, nw []WorkflowTemplateParametersValidationValues) []WorkflowTemplateParametersValidationValues { diff --git a/services/google/dataproc/cluster_internal.go b/services/google/dataproc/cluster_internal.go index 23159253c5..02e8ea00b2 100755 --- a/services/google/dataproc/cluster_internal.go +++ b/services/google/dataproc/cluster_internal.go @@ -1027,23 +1027,26 @@ func canonicalizeNewClusterConfigSet(c *Client, des, nw []ClusterConfig) []Clust if des == nil { return nw } - var reorderedNew []ClusterConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigSlice(c *Client, des, nw []ClusterConfig) []ClusterConfig { @@ -1204,23 +1207,26 @@ func canonicalizeNewClusterConfigGceClusterConfigSet(c *Client, des, nw []Cluste if des == nil { return nw } - var reorderedNew []ClusterConfigGceClusterConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigGceClusterConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigGceClusterConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigGceClusterConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigGceClusterConfigSlice(c *Client, des, nw []ClusterConfigGceClusterConfig) []ClusterConfigGceClusterConfig { @@ -1333,23 +1339,26 @@ func canonicalizeNewClusterConfigGceClusterConfigReservationAffinitySet(c *Clien if des == nil { return nw } - var reorderedNew []ClusterConfigGceClusterConfigReservationAffinity + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigGceClusterConfigReservationAffinity for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigGceClusterConfigReservationAffinityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigGceClusterConfigReservationAffinity(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigGceClusterConfigReservationAffinitySlice(c *Client, des, nw []ClusterConfigGceClusterConfigReservationAffinity) []ClusterConfigGceClusterConfigReservationAffinity { @@ -1445,23 +1454,26 @@ func canonicalizeNewClusterConfigGceClusterConfigNodeGroupAffinitySet(c *Client, if des == nil { return nw } - var reorderedNew []ClusterConfigGceClusterConfigNodeGroupAffinity + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigGceClusterConfigNodeGroupAffinity for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigGceClusterConfigNodeGroupAffinityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigGceClusterConfigNodeGroupAffinity(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigGceClusterConfigNodeGroupAffinitySlice(c *Client, des, nw []ClusterConfigGceClusterConfigNodeGroupAffinity) []ClusterConfigGceClusterConfigNodeGroupAffinity { @@ -1576,23 +1588,26 @@ func canonicalizeNewClusterConfigGceClusterConfigShieldedInstanceConfigSet(c *Cl if des == nil { return nw } - var reorderedNew []ClusterConfigGceClusterConfigShieldedInstanceConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigGceClusterConfigShieldedInstanceConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigGceClusterConfigShieldedInstanceConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigGceClusterConfigShieldedInstanceConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigGceClusterConfigShieldedInstanceConfigSlice(c *Client, des, nw []ClusterConfigGceClusterConfigShieldedInstanceConfig) []ClusterConfigGceClusterConfigShieldedInstanceConfig { @@ -1691,23 +1706,26 @@ func canonicalizeNewClusterConfigGceClusterConfigConfidentialInstanceConfigSet(c if des == nil { return nw } - var reorderedNew []ClusterConfigGceClusterConfigConfidentialInstanceConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigGceClusterConfigConfidentialInstanceConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigGceClusterConfigConfidentialInstanceConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigGceClusterConfigConfidentialInstanceConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigGceClusterConfigConfidentialInstanceConfigSlice(c *Client, des, nw []ClusterConfigGceClusterConfigConfidentialInstanceConfig) []ClusterConfigGceClusterConfigConfidentialInstanceConfig { @@ -1844,23 +1862,26 @@ func canonicalizeNewClusterConfigMasterConfigSet(c *Client, des, nw []ClusterCon if des == nil { return nw } - var reorderedNew []ClusterConfigMasterConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigMasterConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigMasterConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigMasterConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigMasterConfigSlice(c *Client, des, nw []ClusterConfigMasterConfig) []ClusterConfigMasterConfig { @@ -1979,23 +2000,26 @@ func canonicalizeNewClusterConfigMasterConfigDiskConfigSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []ClusterConfigMasterConfigDiskConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigMasterConfigDiskConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigMasterConfigDiskConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigMasterConfigDiskConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigMasterConfigDiskConfigSlice(c *Client, des, nw []ClusterConfigMasterConfigDiskConfig) []ClusterConfigMasterConfigDiskConfig { @@ -2091,23 +2115,26 @@ func canonicalizeNewClusterConfigMasterConfigManagedGroupConfigSet(c *Client, de if des == nil { return nw } - var reorderedNew []ClusterConfigMasterConfigManagedGroupConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigMasterConfigManagedGroupConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigMasterConfigManagedGroupConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigMasterConfigManagedGroupConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigMasterConfigManagedGroupConfigSlice(c *Client, des, nw []ClusterConfigMasterConfigManagedGroupConfig) []ClusterConfigMasterConfigManagedGroupConfig { @@ -2212,23 +2239,26 @@ func canonicalizeNewClusterConfigMasterConfigAcceleratorsSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []ClusterConfigMasterConfigAccelerators + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigMasterConfigAccelerators for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigMasterConfigAcceleratorsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigMasterConfigAccelerators(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigMasterConfigAcceleratorsSlice(c *Client, des, nw []ClusterConfigMasterConfigAccelerators) []ClusterConfigMasterConfigAccelerators { @@ -2351,23 +2381,26 @@ func canonicalizeNewClusterConfigMasterConfigInstanceReferencesSet(c *Client, de if des == nil { return nw } - var reorderedNew []ClusterConfigMasterConfigInstanceReferences + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigMasterConfigInstanceReferences for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigMasterConfigInstanceReferencesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigMasterConfigInstanceReferences(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigMasterConfigInstanceReferencesSlice(c *Client, des, nw []ClusterConfigMasterConfigInstanceReferences) []ClusterConfigMasterConfigInstanceReferences { @@ -2504,23 +2537,26 @@ func canonicalizeNewClusterConfigWorkerConfigSet(c *Client, des, nw []ClusterCon if des == nil { return nw } - var reorderedNew []ClusterConfigWorkerConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigWorkerConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigWorkerConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigWorkerConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigWorkerConfigSlice(c *Client, des, nw []ClusterConfigWorkerConfig) []ClusterConfigWorkerConfig { @@ -2639,23 +2675,26 @@ func canonicalizeNewClusterConfigWorkerConfigDiskConfigSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []ClusterConfigWorkerConfigDiskConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigWorkerConfigDiskConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigWorkerConfigDiskConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigWorkerConfigDiskConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigWorkerConfigDiskConfigSlice(c *Client, des, nw []ClusterConfigWorkerConfigDiskConfig) []ClusterConfigWorkerConfigDiskConfig { @@ -2751,23 +2790,26 @@ func canonicalizeNewClusterConfigWorkerConfigManagedGroupConfigSet(c *Client, de if des == nil { return nw } - var reorderedNew []ClusterConfigWorkerConfigManagedGroupConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigWorkerConfigManagedGroupConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigWorkerConfigManagedGroupConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigWorkerConfigManagedGroupConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigWorkerConfigManagedGroupConfigSlice(c *Client, des, nw []ClusterConfigWorkerConfigManagedGroupConfig) []ClusterConfigWorkerConfigManagedGroupConfig { @@ -2872,23 +2914,26 @@ func canonicalizeNewClusterConfigWorkerConfigAcceleratorsSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []ClusterConfigWorkerConfigAccelerators + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigWorkerConfigAccelerators for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigWorkerConfigAcceleratorsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigWorkerConfigAccelerators(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigWorkerConfigAcceleratorsSlice(c *Client, des, nw []ClusterConfigWorkerConfigAccelerators) []ClusterConfigWorkerConfigAccelerators { @@ -3011,23 +3056,26 @@ func canonicalizeNewClusterConfigWorkerConfigInstanceReferencesSet(c *Client, de if des == nil { return nw } - var reorderedNew []ClusterConfigWorkerConfigInstanceReferences + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigWorkerConfigInstanceReferences for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigWorkerConfigInstanceReferencesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigWorkerConfigInstanceReferences(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigWorkerConfigInstanceReferencesSlice(c *Client, des, nw []ClusterConfigWorkerConfigInstanceReferences) []ClusterConfigWorkerConfigInstanceReferences { @@ -3164,23 +3212,26 @@ func canonicalizeNewClusterConfigSecondaryWorkerConfigSet(c *Client, des, nw []C if des == nil { return nw } - var reorderedNew []ClusterConfigSecondaryWorkerConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigSecondaryWorkerConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigSecondaryWorkerConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigSecondaryWorkerConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigSecondaryWorkerConfigSlice(c *Client, des, nw []ClusterConfigSecondaryWorkerConfig) []ClusterConfigSecondaryWorkerConfig { @@ -3299,23 +3350,26 @@ func canonicalizeNewClusterConfigSecondaryWorkerConfigDiskConfigSet(c *Client, d if des == nil { return nw } - var reorderedNew []ClusterConfigSecondaryWorkerConfigDiskConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigSecondaryWorkerConfigDiskConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigSecondaryWorkerConfigDiskConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigSecondaryWorkerConfigDiskConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigSecondaryWorkerConfigDiskConfigSlice(c *Client, des, nw []ClusterConfigSecondaryWorkerConfigDiskConfig) []ClusterConfigSecondaryWorkerConfigDiskConfig { @@ -3411,23 +3465,26 @@ func canonicalizeNewClusterConfigSecondaryWorkerConfigManagedGroupConfigSet(c *C if des == nil { return nw } - var reorderedNew []ClusterConfigSecondaryWorkerConfigManagedGroupConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigSecondaryWorkerConfigManagedGroupConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigSecondaryWorkerConfigManagedGroupConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigSecondaryWorkerConfigManagedGroupConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigSecondaryWorkerConfigManagedGroupConfigSlice(c *Client, des, nw []ClusterConfigSecondaryWorkerConfigManagedGroupConfig) []ClusterConfigSecondaryWorkerConfigManagedGroupConfig { @@ -3532,23 +3589,26 @@ func canonicalizeNewClusterConfigSecondaryWorkerConfigAcceleratorsSet(c *Client, if des == nil { return nw } - var reorderedNew []ClusterConfigSecondaryWorkerConfigAccelerators + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigSecondaryWorkerConfigAccelerators for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigSecondaryWorkerConfigAcceleratorsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigSecondaryWorkerConfigAccelerators(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigSecondaryWorkerConfigAcceleratorsSlice(c *Client, des, nw []ClusterConfigSecondaryWorkerConfigAccelerators) []ClusterConfigSecondaryWorkerConfigAccelerators { @@ -3671,23 +3731,26 @@ func canonicalizeNewClusterConfigSecondaryWorkerConfigInstanceReferencesSet(c *C if des == nil { return nw } - var reorderedNew []ClusterConfigSecondaryWorkerConfigInstanceReferences + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigSecondaryWorkerConfigInstanceReferences for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigSecondaryWorkerConfigInstanceReferencesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigSecondaryWorkerConfigInstanceReferences(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigSecondaryWorkerConfigInstanceReferencesSlice(c *Client, des, nw []ClusterConfigSecondaryWorkerConfigInstanceReferences) []ClusterConfigSecondaryWorkerConfigInstanceReferences { @@ -3800,23 +3863,26 @@ func canonicalizeNewClusterConfigSoftwareConfigSet(c *Client, des, nw []ClusterC if des == nil { return nw } - var reorderedNew []ClusterConfigSoftwareConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigSoftwareConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigSoftwareConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigSoftwareConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigSoftwareConfigSlice(c *Client, des, nw []ClusterConfigSoftwareConfig) []ClusterConfigSoftwareConfig { @@ -3923,23 +3989,26 @@ func canonicalizeNewClusterConfigInitializationActionsSet(c *Client, des, nw []C if des == nil { return nw } - var reorderedNew []ClusterConfigInitializationActions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigInitializationActions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigInitializationActionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigInitializationActions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigInitializationActionsSlice(c *Client, des, nw []ClusterConfigInitializationActions) []ClusterConfigInitializationActions { @@ -4035,23 +4104,26 @@ func canonicalizeNewClusterConfigEncryptionConfigSet(c *Client, des, nw []Cluste if des == nil { return nw } - var reorderedNew []ClusterConfigEncryptionConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigEncryptionConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigEncryptionConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigEncryptionConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigEncryptionConfigSlice(c *Client, des, nw []ClusterConfigEncryptionConfig) []ClusterConfigEncryptionConfig { @@ -4147,23 +4219,26 @@ func canonicalizeNewClusterConfigAutoscalingConfigSet(c *Client, des, nw []Clust if des == nil { return nw } - var reorderedNew []ClusterConfigAutoscalingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigAutoscalingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigAutoscalingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigAutoscalingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigAutoscalingConfigSlice(c *Client, des, nw []ClusterConfigAutoscalingConfig) []ClusterConfigAutoscalingConfig { @@ -4258,23 +4333,26 @@ func canonicalizeNewClusterConfigSecurityConfigSet(c *Client, des, nw []ClusterC if des == nil { return nw } - var reorderedNew []ClusterConfigSecurityConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigSecurityConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigSecurityConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigSecurityConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigSecurityConfigSlice(c *Client, des, nw []ClusterConfigSecurityConfig) []ClusterConfigSecurityConfig { @@ -4481,23 +4559,26 @@ func canonicalizeNewClusterConfigSecurityConfigKerberosConfigSet(c *Client, des, if des == nil { return nw } - var reorderedNew []ClusterConfigSecurityConfigKerberosConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigSecurityConfigKerberosConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigSecurityConfigKerberosConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigSecurityConfigKerberosConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigSecurityConfigKerberosConfigSlice(c *Client, des, nw []ClusterConfigSecurityConfigKerberosConfig) []ClusterConfigSecurityConfigKerberosConfig { @@ -4593,23 +4674,26 @@ func canonicalizeNewClusterConfigSecurityConfigIdentityConfigSet(c *Client, des, if des == nil { return nw } - var reorderedNew []ClusterConfigSecurityConfigIdentityConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigSecurityConfigIdentityConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigSecurityConfigIdentityConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigSecurityConfigIdentityConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigSecurityConfigIdentityConfigSlice(c *Client, des, nw []ClusterConfigSecurityConfigIdentityConfig) []ClusterConfigSecurityConfigIdentityConfig { @@ -4722,23 +4806,26 @@ func canonicalizeNewClusterConfigLifecycleConfigSet(c *Client, des, nw []Cluster if des == nil { return nw } - var reorderedNew []ClusterConfigLifecycleConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigLifecycleConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigLifecycleConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigLifecycleConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigLifecycleConfigSlice(c *Client, des, nw []ClusterConfigLifecycleConfig) []ClusterConfigLifecycleConfig { @@ -4837,23 +4924,26 @@ func canonicalizeNewClusterConfigEndpointConfigSet(c *Client, des, nw []ClusterC if des == nil { return nw } - var reorderedNew []ClusterConfigEndpointConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigEndpointConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigEndpointConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigEndpointConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigEndpointConfigSlice(c *Client, des, nw []ClusterConfigEndpointConfig) []ClusterConfigEndpointConfig { @@ -4949,23 +5039,26 @@ func canonicalizeNewClusterConfigMetastoreConfigSet(c *Client, des, nw []Cluster if des == nil { return nw } - var reorderedNew []ClusterConfigMetastoreConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigMetastoreConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigMetastoreConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigMetastoreConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigMetastoreConfigSlice(c *Client, des, nw []ClusterConfigMetastoreConfig) []ClusterConfigMetastoreConfig { @@ -5058,23 +5151,26 @@ func canonicalizeNewClusterConfigDataprocMetricConfigSet(c *Client, des, nw []Cl if des == nil { return nw } - var reorderedNew []ClusterConfigDataprocMetricConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigDataprocMetricConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigDataprocMetricConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigDataprocMetricConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigDataprocMetricConfigSlice(c *Client, des, nw []ClusterConfigDataprocMetricConfig) []ClusterConfigDataprocMetricConfig { @@ -5179,23 +5275,26 @@ func canonicalizeNewClusterConfigDataprocMetricConfigMetricsSet(c *Client, des, if des == nil { return nw } - var reorderedNew []ClusterConfigDataprocMetricConfigMetrics + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterConfigDataprocMetricConfigMetrics for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterConfigDataprocMetricConfigMetricsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterConfigDataprocMetricConfigMetrics(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterConfigDataprocMetricConfigMetricsSlice(c *Client, des, nw []ClusterConfigDataprocMetricConfigMetrics) []ClusterConfigDataprocMetricConfigMetrics { @@ -5288,23 +5387,26 @@ func canonicalizeNewClusterStatusSet(c *Client, des, nw []ClusterStatus) []Clust if des == nil { return nw } - var reorderedNew []ClusterStatus + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterStatus for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterStatusNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterStatus(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterStatusSlice(c *Client, des, nw []ClusterStatus) []ClusterStatus { @@ -5397,23 +5499,26 @@ func canonicalizeNewClusterStatusHistorySet(c *Client, des, nw []ClusterStatusHi if des == nil { return nw } - var reorderedNew []ClusterStatusHistory + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterStatusHistory for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterStatusHistoryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterStatusHistory(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterStatusHistorySlice(c *Client, des, nw []ClusterStatusHistory) []ClusterStatusHistory { @@ -5515,23 +5620,26 @@ func canonicalizeNewClusterMetricsSet(c *Client, des, nw []ClusterMetrics) []Clu if des == nil { return nw } - var reorderedNew []ClusterMetrics + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterMetrics for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterMetricsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterMetrics(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterMetricsSlice(c *Client, des, nw []ClusterMetrics) []ClusterMetrics { @@ -5632,23 +5740,26 @@ func canonicalizeNewClusterVirtualClusterConfigSet(c *Client, des, nw []ClusterV if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigSlice(c *Client, des, nw []ClusterVirtualClusterConfig) []ClusterVirtualClusterConfig { @@ -5751,23 +5862,26 @@ func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigSet(c *Cli if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigKubernetesClusterConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigKubernetesClusterConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigKubernetesClusterConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigSlice(c *Client, des, nw []ClusterVirtualClusterConfigKubernetesClusterConfig) []ClusterVirtualClusterConfigKubernetesClusterConfig { @@ -5866,23 +5980,26 @@ func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeCluster if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigSlice(c *Client, des, nw []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfig) []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfig { @@ -5987,23 +6104,26 @@ func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeCluster if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTarget + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTarget for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTarget(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetSlice(c *Client, des, nw []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTarget) []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTarget { @@ -6106,23 +6226,26 @@ func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeCluster if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigSlice(c *Client, des, nw []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfig) []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfig { @@ -6263,23 +6386,26 @@ func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeCluster if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigSlice(c *Client, des, nw []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfig) []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfig { @@ -6392,23 +6518,26 @@ func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeCluster if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigAccelerators + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigAccelerators for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigAcceleratorsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigAccelerators(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigAcceleratorsSlice(c *Client, des, nw []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigAccelerators) []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigAccelerators { @@ -6504,23 +6633,26 @@ func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeCluster if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigEphemeralStorageConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigEphemeralStorageConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigEphemeralStorageConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigEphemeralStorageConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigEphemeralStorageConfigSlice(c *Client, des, nw []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigEphemeralStorageConfig) []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigConfigEphemeralStorageConfig { @@ -6622,23 +6754,26 @@ func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeCluster if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigAutoscaling + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigAutoscaling for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigAutoscalingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigAutoscaling(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigAutoscalingSlice(c *Client, des, nw []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigAutoscaling) []ClusterVirtualClusterConfigKubernetesClusterConfigGkeClusterConfigNodePoolTargetNodePoolConfigAutoscaling { @@ -6740,23 +6875,26 @@ func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigKubernetes if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigKubernetesClusterConfigKubernetesSoftwareConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigKubernetesClusterConfigKubernetesSoftwareConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigKubernetesClusterConfigKubernetesSoftwareConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigKubernetesSoftwareConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigKubernetesClusterConfigKubernetesSoftwareConfigSlice(c *Client, des, nw []ClusterVirtualClusterConfigKubernetesClusterConfigKubernetesSoftwareConfig) []ClusterVirtualClusterConfigKubernetesClusterConfigKubernetesSoftwareConfig { @@ -6851,23 +6989,26 @@ func canonicalizeNewClusterVirtualClusterConfigAuxiliaryServicesConfigSet(c *Cli if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigAuxiliaryServicesConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigAuxiliaryServicesConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigAuxiliaryServicesConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigAuxiliaryServicesConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigAuxiliaryServicesConfigSlice(c *Client, des, nw []ClusterVirtualClusterConfigAuxiliaryServicesConfig) []ClusterVirtualClusterConfigAuxiliaryServicesConfig { @@ -6963,23 +7104,26 @@ func canonicalizeNewClusterVirtualClusterConfigAuxiliaryServicesConfigMetastoreC if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigAuxiliaryServicesConfigMetastoreConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigAuxiliaryServicesConfigMetastoreConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigAuxiliaryServicesConfigMetastoreConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigAuxiliaryServicesConfigMetastoreConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigAuxiliaryServicesConfigMetastoreConfigSlice(c *Client, des, nw []ClusterVirtualClusterConfigAuxiliaryServicesConfigMetastoreConfig) []ClusterVirtualClusterConfigAuxiliaryServicesConfigMetastoreConfig { @@ -7075,23 +7219,26 @@ func canonicalizeNewClusterVirtualClusterConfigAuxiliaryServicesConfigSparkHisto if des == nil { return nw } - var reorderedNew []ClusterVirtualClusterConfigAuxiliaryServicesConfigSparkHistoryServerConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClusterVirtualClusterConfigAuxiliaryServicesConfigSparkHistoryServerConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClusterVirtualClusterConfigAuxiliaryServicesConfigSparkHistoryServerConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClusterVirtualClusterConfigAuxiliaryServicesConfigSparkHistoryServerConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClusterVirtualClusterConfigAuxiliaryServicesConfigSparkHistoryServerConfigSlice(c *Client, des, nw []ClusterVirtualClusterConfigAuxiliaryServicesConfigSparkHistoryServerConfig) []ClusterVirtualClusterConfigAuxiliaryServicesConfigSparkHistoryServerConfig { diff --git a/services/google/dataproc/workflow_template_internal.go b/services/google/dataproc/workflow_template_internal.go index bdd9ed0a61..7b2a49932e 100755 --- a/services/google/dataproc/workflow_template_internal.go +++ b/services/google/dataproc/workflow_template_internal.go @@ -959,23 +959,26 @@ func canonicalizeNewWorkflowTemplatePlacementSet(c *Client, des, nw []WorkflowTe if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacement + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacement for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacement(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementSlice(c *Client, des, nw []WorkflowTemplatePlacement) []WorkflowTemplatePlacement { @@ -1082,23 +1085,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedCluster + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedCluster for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedCluster(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedCluster) []WorkflowTemplatePlacementManagedCluster { @@ -1223,23 +1229,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSet(c *Client, if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfig) []WorkflowTemplatePlacementManagedClusterConfig { @@ -1398,23 +1407,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfi if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfig) []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfig { @@ -1527,23 +1539,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfi if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigReservationAffinity + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigReservationAffinity for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigReservationAffinityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigReservationAffinity(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigReservationAffinitySlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigReservationAffinity) []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigReservationAffinity { @@ -1639,23 +1654,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfi if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigNodeGroupAffinity + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigNodeGroupAffinity for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigNodeGroupAffinityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigNodeGroupAffinity(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigNodeGroupAffinitySlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigNodeGroupAffinity) []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigNodeGroupAffinity { @@ -1770,23 +1788,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfi if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigShieldedInstanceConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigShieldedInstanceConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigShieldedInstanceConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigShieldedInstanceConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigGceClusterConfigShieldedInstanceConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigShieldedInstanceConfig) []WorkflowTemplatePlacementManagedClusterConfigGceClusterConfigShieldedInstanceConfig { @@ -1922,23 +1943,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfigSet if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigMasterConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigMasterConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigMasterConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigMasterConfig) []WorkflowTemplatePlacementManagedClusterConfigMasterConfig { @@ -2049,23 +2073,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfigDis if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigMasterConfigDiskConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigMasterConfigDiskConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigMasterConfigDiskConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfigDiskConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfigDiskConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigMasterConfigDiskConfig) []WorkflowTemplatePlacementManagedClusterConfigMasterConfigDiskConfig { @@ -2161,23 +2188,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfigMan if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigMasterConfigManagedGroupConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigMasterConfigManagedGroupConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigMasterConfigManagedGroupConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfigManagedGroupConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfigManagedGroupConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigMasterConfigManagedGroupConfig) []WorkflowTemplatePlacementManagedClusterConfigMasterConfigManagedGroupConfig { @@ -2282,23 +2312,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfigAcc if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigMasterConfigAccelerators + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigMasterConfigAccelerators for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigMasterConfigAcceleratorsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfigAccelerators(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigMasterConfigAcceleratorsSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigMasterConfigAccelerators) []WorkflowTemplatePlacementManagedClusterConfigMasterConfigAccelerators { @@ -2434,23 +2467,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfigSet if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigWorkerConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigWorkerConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigWorkerConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigWorkerConfig) []WorkflowTemplatePlacementManagedClusterConfigWorkerConfig { @@ -2561,23 +2597,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfigDis if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigDiskConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigDiskConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigWorkerConfigDiskConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfigDiskConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfigDiskConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigDiskConfig) []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigDiskConfig { @@ -2673,23 +2712,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfigMan if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigManagedGroupConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigManagedGroupConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigWorkerConfigManagedGroupConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfigManagedGroupConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfigManagedGroupConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigManagedGroupConfig) []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigManagedGroupConfig { @@ -2794,23 +2836,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfigAcc if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigAccelerators + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigAccelerators for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigWorkerConfigAcceleratorsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfigAccelerators(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigWorkerConfigAcceleratorsSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigAccelerators) []WorkflowTemplatePlacementManagedClusterConfigWorkerConfigAccelerators { @@ -2946,23 +2991,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorker if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfig) []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfig { @@ -3073,23 +3121,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorker if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigDiskConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigDiskConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigDiskConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigDiskConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigDiskConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigDiskConfig) []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigDiskConfig { @@ -3185,23 +3236,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorker if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigManagedGroupConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigManagedGroupConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigManagedGroupConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigManagedGroupConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigManagedGroupConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigManagedGroupConfig) []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigManagedGroupConfig { @@ -3306,23 +3360,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorker if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigAccelerators + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigAccelerators for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigAcceleratorsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigAccelerators(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigAcceleratorsSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigAccelerators) []WorkflowTemplatePlacementManagedClusterConfigSecondaryWorkerConfigAccelerators { @@ -3433,23 +3490,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSoftwareConfigS if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigSoftwareConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigSoftwareConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigSoftwareConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSoftwareConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSoftwareConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigSoftwareConfig) []WorkflowTemplatePlacementManagedClusterConfigSoftwareConfig { @@ -3556,23 +3616,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigInitializationA if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigInitializationActions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigInitializationActions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigInitializationActionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigInitializationActions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigInitializationActionsSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigInitializationActions) []WorkflowTemplatePlacementManagedClusterConfigInitializationActions { @@ -3668,23 +3731,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigEncryptionConfi if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigEncryptionConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigEncryptionConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigEncryptionConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigEncryptionConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigEncryptionConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigEncryptionConfig) []WorkflowTemplatePlacementManagedClusterConfigEncryptionConfig { @@ -3780,23 +3846,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigAutoscalingConf if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigAutoscalingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigAutoscalingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigAutoscalingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigAutoscalingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigAutoscalingConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigAutoscalingConfig) []WorkflowTemplatePlacementManagedClusterConfigAutoscalingConfig { @@ -3889,23 +3958,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecurityConfigS if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigSecurityConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigSecurityConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigSecurityConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecurityConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecurityConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigSecurityConfig) []WorkflowTemplatePlacementManagedClusterConfigSecurityConfig { @@ -4112,23 +4184,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecurityConfigK if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigSecurityConfigKerberosConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigSecurityConfigKerberosConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigSecurityConfigKerberosConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecurityConfigKerberosConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigSecurityConfigKerberosConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigSecurityConfigKerberosConfig) []WorkflowTemplatePlacementManagedClusterConfigSecurityConfigKerberosConfig { @@ -4241,23 +4316,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigLifecycleConfig if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigLifecycleConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigLifecycleConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigLifecycleConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigLifecycleConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigLifecycleConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigLifecycleConfig) []WorkflowTemplatePlacementManagedClusterConfigLifecycleConfig { @@ -4356,23 +4434,26 @@ func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigEndpointConfigS if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementManagedClusterConfigEndpointConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementManagedClusterConfigEndpointConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementManagedClusterConfigEndpointConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigEndpointConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementManagedClusterConfigEndpointConfigSlice(c *Client, des, nw []WorkflowTemplatePlacementManagedClusterConfigEndpointConfig) []WorkflowTemplatePlacementManagedClusterConfigEndpointConfig { @@ -4477,23 +4558,26 @@ func canonicalizeNewWorkflowTemplatePlacementClusterSelectorSet(c *Client, des, if des == nil { return nw } - var reorderedNew []WorkflowTemplatePlacementClusterSelector + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplatePlacementClusterSelector for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplatePlacementClusterSelectorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplatePlacementClusterSelector(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplatePlacementClusterSelectorSlice(c *Client, des, nw []WorkflowTemplatePlacementClusterSelector) []WorkflowTemplatePlacementClusterSelector { @@ -4624,23 +4708,26 @@ func canonicalizeNewWorkflowTemplateJobsSet(c *Client, des, nw []WorkflowTemplat if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsSlice(c *Client, des, nw []WorkflowTemplateJobs) []WorkflowTemplateJobs { @@ -4787,23 +4874,26 @@ func canonicalizeNewWorkflowTemplateJobsHadoopJobSet(c *Client, des, nw []Workfl if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsHadoopJob + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsHadoopJob for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsHadoopJobNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsHadoopJob(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsHadoopJobSlice(c *Client, des, nw []WorkflowTemplateJobsHadoopJob) []WorkflowTemplateJobsHadoopJob { @@ -4899,23 +4989,26 @@ func canonicalizeNewWorkflowTemplateJobsHadoopJobLoggingConfigSet(c *Client, des if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsHadoopJobLoggingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsHadoopJobLoggingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsHadoopJobLoggingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsHadoopJobLoggingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsHadoopJobLoggingConfigSlice(c *Client, des, nw []WorkflowTemplateJobsHadoopJobLoggingConfig) []WorkflowTemplateJobsHadoopJobLoggingConfig { @@ -5062,23 +5155,26 @@ func canonicalizeNewWorkflowTemplateJobsSparkJobSet(c *Client, des, nw []Workflo if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsSparkJob + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsSparkJob for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsSparkJobNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsSparkJob(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsSparkJobSlice(c *Client, des, nw []WorkflowTemplateJobsSparkJob) []WorkflowTemplateJobsSparkJob { @@ -5174,23 +5270,26 @@ func canonicalizeNewWorkflowTemplateJobsSparkJobLoggingConfigSet(c *Client, des, if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsSparkJobLoggingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsSparkJobLoggingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsSparkJobLoggingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsSparkJobLoggingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsSparkJobLoggingConfigSlice(c *Client, des, nw []WorkflowTemplateJobsSparkJobLoggingConfig) []WorkflowTemplateJobsSparkJobLoggingConfig { @@ -5337,23 +5436,26 @@ func canonicalizeNewWorkflowTemplateJobsPysparkJobSet(c *Client, des, nw []Workf if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsPysparkJob + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsPysparkJob for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsPysparkJobNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsPysparkJob(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsPysparkJobSlice(c *Client, des, nw []WorkflowTemplateJobsPysparkJob) []WorkflowTemplateJobsPysparkJob { @@ -5449,23 +5551,26 @@ func canonicalizeNewWorkflowTemplateJobsPysparkJobLoggingConfigSet(c *Client, de if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsPysparkJobLoggingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsPysparkJobLoggingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsPysparkJobLoggingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsPysparkJobLoggingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsPysparkJobLoggingConfigSlice(c *Client, des, nw []WorkflowTemplateJobsPysparkJobLoggingConfig) []WorkflowTemplateJobsPysparkJobLoggingConfig { @@ -5594,23 +5699,26 @@ func canonicalizeNewWorkflowTemplateJobsHiveJobSet(c *Client, des, nw []Workflow if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsHiveJob + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsHiveJob for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsHiveJobNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsHiveJob(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsHiveJobSlice(c *Client, des, nw []WorkflowTemplateJobsHiveJob) []WorkflowTemplateJobsHiveJob { @@ -5709,23 +5817,26 @@ func canonicalizeNewWorkflowTemplateJobsHiveJobQueryListSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsHiveJobQueryList + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsHiveJobQueryList for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsHiveJobQueryListNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsHiveJobQueryList(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsHiveJobQueryListSlice(c *Client, des, nw []WorkflowTemplateJobsHiveJobQueryList) []WorkflowTemplateJobsHiveJobQueryList { @@ -5856,23 +5967,26 @@ func canonicalizeNewWorkflowTemplateJobsPigJobSet(c *Client, des, nw []WorkflowT if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsPigJob + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsPigJob for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsPigJobNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsPigJob(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsPigJobSlice(c *Client, des, nw []WorkflowTemplateJobsPigJob) []WorkflowTemplateJobsPigJob { @@ -5971,23 +6085,26 @@ func canonicalizeNewWorkflowTemplateJobsPigJobQueryListSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsPigJobQueryList + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsPigJobQueryList for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsPigJobQueryListNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsPigJobQueryList(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsPigJobQueryListSlice(c *Client, des, nw []WorkflowTemplateJobsPigJobQueryList) []WorkflowTemplateJobsPigJobQueryList { @@ -6083,23 +6200,26 @@ func canonicalizeNewWorkflowTemplateJobsPigJobLoggingConfigSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsPigJobLoggingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsPigJobLoggingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsPigJobLoggingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsPigJobLoggingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsPigJobLoggingConfigSlice(c *Client, des, nw []WorkflowTemplateJobsPigJobLoggingConfig) []WorkflowTemplateJobsPigJobLoggingConfig { @@ -6230,23 +6350,26 @@ func canonicalizeNewWorkflowTemplateJobsSparkRJobSet(c *Client, des, nw []Workfl if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsSparkRJob + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsSparkRJob for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsSparkRJobNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsSparkRJob(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsSparkRJobSlice(c *Client, des, nw []WorkflowTemplateJobsSparkRJob) []WorkflowTemplateJobsSparkRJob { @@ -6342,23 +6465,26 @@ func canonicalizeNewWorkflowTemplateJobsSparkRJobLoggingConfigSet(c *Client, des if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsSparkRJobLoggingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsSparkRJobLoggingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsSparkRJobLoggingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsSparkRJobLoggingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsSparkRJobLoggingConfigSlice(c *Client, des, nw []WorkflowTemplateJobsSparkRJobLoggingConfig) []WorkflowTemplateJobsSparkRJobLoggingConfig { @@ -6481,23 +6607,26 @@ func canonicalizeNewWorkflowTemplateJobsSparkSqlJobSet(c *Client, des, nw []Work if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsSparkSqlJob + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsSparkSqlJob for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsSparkSqlJobNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsSparkSqlJob(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsSparkSqlJobSlice(c *Client, des, nw []WorkflowTemplateJobsSparkSqlJob) []WorkflowTemplateJobsSparkSqlJob { @@ -6596,23 +6725,26 @@ func canonicalizeNewWorkflowTemplateJobsSparkSqlJobQueryListSet(c *Client, des, if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsSparkSqlJobQueryList + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsSparkSqlJobQueryList for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsSparkSqlJobQueryListNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsSparkSqlJobQueryList(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsSparkSqlJobQueryListSlice(c *Client, des, nw []WorkflowTemplateJobsSparkSqlJobQueryList) []WorkflowTemplateJobsSparkSqlJobQueryList { @@ -6708,23 +6840,26 @@ func canonicalizeNewWorkflowTemplateJobsSparkSqlJobLoggingConfigSet(c *Client, d if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsSparkSqlJobLoggingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsSparkSqlJobLoggingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsSparkSqlJobLoggingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsSparkSqlJobLoggingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsSparkSqlJobLoggingConfigSlice(c *Client, des, nw []WorkflowTemplateJobsSparkSqlJobLoggingConfig) []WorkflowTemplateJobsSparkSqlJobLoggingConfig { @@ -6857,23 +6992,26 @@ func canonicalizeNewWorkflowTemplateJobsPrestoJobSet(c *Client, des, nw []Workfl if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsPrestoJob + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsPrestoJob for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsPrestoJobNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsPrestoJob(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsPrestoJobSlice(c *Client, des, nw []WorkflowTemplateJobsPrestoJob) []WorkflowTemplateJobsPrestoJob { @@ -6972,23 +7110,26 @@ func canonicalizeNewWorkflowTemplateJobsPrestoJobQueryListSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsPrestoJobQueryList + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsPrestoJobQueryList for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsPrestoJobQueryListNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsPrestoJobQueryList(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsPrestoJobQueryListSlice(c *Client, des, nw []WorkflowTemplateJobsPrestoJobQueryList) []WorkflowTemplateJobsPrestoJobQueryList { @@ -7084,23 +7225,26 @@ func canonicalizeNewWorkflowTemplateJobsPrestoJobLoggingConfigSet(c *Client, des if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsPrestoJobLoggingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsPrestoJobLoggingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsPrestoJobLoggingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsPrestoJobLoggingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsPrestoJobLoggingConfigSlice(c *Client, des, nw []WorkflowTemplateJobsPrestoJobLoggingConfig) []WorkflowTemplateJobsPrestoJobLoggingConfig { @@ -7202,23 +7346,26 @@ func canonicalizeNewWorkflowTemplateJobsSchedulingSet(c *Client, des, nw []Workf if des == nil { return nw } - var reorderedNew []WorkflowTemplateJobsScheduling + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateJobsScheduling for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateJobsSchedulingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateJobsScheduling(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateJobsSchedulingSlice(c *Client, des, nw []WorkflowTemplateJobsScheduling) []WorkflowTemplateJobsScheduling { @@ -7335,23 +7482,26 @@ func canonicalizeNewWorkflowTemplateParametersSet(c *Client, des, nw []WorkflowT if des == nil { return nw } - var reorderedNew []WorkflowTemplateParameters + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateParameters for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateParametersNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateParameters(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateParametersSlice(c *Client, des, nw []WorkflowTemplateParameters) []WorkflowTemplateParameters { @@ -7446,23 +7596,26 @@ func canonicalizeNewWorkflowTemplateParametersValidationSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []WorkflowTemplateParametersValidation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateParametersValidation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateParametersValidationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateParametersValidation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateParametersValidationSlice(c *Client, des, nw []WorkflowTemplateParametersValidation) []WorkflowTemplateParametersValidation { @@ -7561,23 +7714,26 @@ func canonicalizeNewWorkflowTemplateParametersValidationRegexSet(c *Client, des, if des == nil { return nw } - var reorderedNew []WorkflowTemplateParametersValidationRegex + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateParametersValidationRegex for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateParametersValidationRegexNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateParametersValidationRegex(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateParametersValidationRegexSlice(c *Client, des, nw []WorkflowTemplateParametersValidationRegex) []WorkflowTemplateParametersValidationRegex { @@ -7676,23 +7832,26 @@ func canonicalizeNewWorkflowTemplateParametersValidationValuesSet(c *Client, des if des == nil { return nw } - var reorderedNew []WorkflowTemplateParametersValidationValues + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkflowTemplateParametersValidationValues for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkflowTemplateParametersValidationValuesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkflowTemplateParametersValidationValues(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkflowTemplateParametersValidationValuesSlice(c *Client, des, nw []WorkflowTemplateParametersValidationValues) []WorkflowTemplateParametersValidationValues { diff --git a/services/google/dlp/alpha/deidentify_template_internal.go b/services/google/dlp/alpha/deidentify_template_internal.go index 655671cda3..5c69b64fed 100755 --- a/services/google/dlp/alpha/deidentify_template_internal.go +++ b/services/google/dlp/alpha/deidentify_template_internal.go @@ -2388,23 +2388,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigSet(c *Client, des, nw []D if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfig) []DeidentifyTemplateDeidentifyConfig { @@ -2497,23 +2500,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsSet if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformations) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformations { @@ -2608,23 +2614,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformations) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformations { @@ -2723,23 +2732,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsInfoTypesSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsInfoTypes) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsInfoTypes { @@ -2962,23 +2974,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformation) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformation { @@ -3071,23 +3086,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfig) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfig { @@ -3302,23 +3320,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValue { @@ -3432,23 +3453,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue { @@ -3556,23 +3580,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue { @@ -3660,23 +3687,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfig) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfig { @@ -3791,23 +3821,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfig) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfig { @@ -3932,23 +3965,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnoreNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnoreSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore { @@ -4095,23 +4131,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig { @@ -4238,23 +4277,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey { @@ -4353,23 +4395,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient { @@ -4468,23 +4513,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped { @@ -4589,23 +4637,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped { @@ -4704,23 +4755,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContextSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext { @@ -4819,23 +4873,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoTypeSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType { @@ -4936,23 +4993,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfig) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfig { @@ -5167,23 +5227,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound { @@ -5297,23 +5360,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue { @@ -5421,23 +5487,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue { @@ -5652,23 +5721,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound { @@ -5782,23 +5854,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue { @@ -5906,23 +5981,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue { @@ -6015,23 +6093,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfig) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfig { @@ -6128,23 +6209,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBuckets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBuckets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBuckets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBuckets) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBuckets { @@ -6359,23 +6443,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMin + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMin for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMin(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMin) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMin { @@ -6489,23 +6576,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue { @@ -6613,23 +6703,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue { @@ -6844,23 +6937,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMax + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMax for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMax(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMax) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMax { @@ -6974,23 +7070,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue { @@ -7098,23 +7197,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue { @@ -7329,23 +7431,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue { @@ -7459,23 +7564,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue { @@ -7583,23 +7691,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue { @@ -7687,23 +7798,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig { @@ -7799,23 +7913,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfig) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfig { @@ -7908,23 +8025,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfig) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfig { @@ -8051,23 +8171,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey { @@ -8166,23 +8289,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient { @@ -8281,23 +8407,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped { @@ -8402,23 +8531,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped { @@ -8535,23 +8667,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfig) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfig { @@ -8650,23 +8785,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContext + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContext for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContext(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContextSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContext) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContext { @@ -8793,23 +8931,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKey { @@ -8908,23 +9049,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient { @@ -9023,23 +9167,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped { @@ -9144,23 +9291,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped { @@ -9257,23 +9407,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfig) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfig { @@ -9400,23 +9553,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey { @@ -9515,23 +9671,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient { @@ -9630,23 +9789,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped { @@ -9751,23 +9913,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped { @@ -9866,23 +10031,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoTypeSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType { @@ -9981,23 +10149,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContext + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContext for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContext(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContextSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContext) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContext { @@ -10092,23 +10263,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsSet(c if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformations) []DeidentifyTemplateDeidentifyConfigRecordTransformations { @@ -10227,23 +10401,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformations) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformations { @@ -10342,23 +10519,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsFields + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsFields for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsFieldsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsFields(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsFieldsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsFields) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsFields { @@ -10451,23 +10631,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsCondition + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsCondition for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsCondition(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsCondition) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsCondition { @@ -10576,23 +10759,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressions) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressions { @@ -10685,23 +10871,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditions) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditions { @@ -10802,23 +10991,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditions) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditions { @@ -10917,23 +11109,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsField + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsField for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsFieldNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsField(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsFieldSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsField) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsField { @@ -11148,23 +11343,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValue { @@ -11278,23 +11476,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueTimeValue { @@ -11402,23 +11603,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueDateValue { @@ -11641,23 +11845,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformation) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformation { @@ -11750,23 +11957,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfig { @@ -11981,23 +12191,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValue { @@ -12111,23 +12324,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue { @@ -12235,23 +12451,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue { @@ -12339,23 +12558,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationRedactConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationRedactConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationRedactConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationRedactConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationRedactConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationRedactConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationRedactConfig { @@ -12470,23 +12692,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfig { @@ -12611,23 +12836,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnoreNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnoreSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore { @@ -12774,23 +13002,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig { @@ -12917,23 +13148,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey { @@ -13032,23 +13266,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient { @@ -13147,23 +13384,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped { @@ -13268,23 +13508,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped { @@ -13383,23 +13626,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContextSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext { @@ -13498,23 +13744,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoTypeSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType { @@ -13615,23 +13864,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfig { @@ -13846,23 +14098,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound { @@ -13976,23 +14231,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue - for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue + for _, d := range des { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue { @@ -14100,23 +14358,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue { @@ -14331,23 +14592,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound { @@ -14461,23 +14725,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue { @@ -14585,23 +14852,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue { @@ -14694,23 +14964,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfig { @@ -14807,23 +15080,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBuckets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBuckets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBuckets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBuckets) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBuckets { @@ -15038,23 +15314,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMin + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMin for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMin(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMin) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMin { @@ -15168,23 +15447,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue { @@ -15292,23 +15574,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue { @@ -15523,23 +15808,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMax + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMax for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMax(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMax) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMax { @@ -15653,23 +15941,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue { @@ -15777,23 +16068,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue { @@ -16008,23 +16302,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue { @@ -16138,23 +16435,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue { @@ -16262,23 +16562,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue { @@ -16366,23 +16669,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceWithInfoTypeConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceWithInfoTypeConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig { @@ -16478,23 +16784,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationTimePartConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationTimePartConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationTimePartConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationTimePartConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationTimePartConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationTimePartConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationTimePartConfig { @@ -16587,23 +16896,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfig { @@ -16730,23 +17042,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey { @@ -16845,23 +17160,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient { @@ -16960,23 +17278,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped { @@ -17081,23 +17402,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped { @@ -17214,23 +17538,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfig { @@ -17329,23 +17656,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigContext + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigContext for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigContextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigContext(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigContextSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigContext) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigContext { @@ -17472,23 +17802,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKey { @@ -17587,23 +17920,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient { @@ -17702,23 +18038,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped { @@ -17823,23 +18162,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped { @@ -17936,23 +18278,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfig { @@ -18079,23 +18424,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey { @@ -18194,23 +18542,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient { @@ -18309,23 +18660,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped { @@ -18430,23 +18784,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped { @@ -18545,23 +18902,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoTypeSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType { @@ -18660,23 +19020,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigContext + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigContext for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigContextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigContext(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigContextSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigContext) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigContext { @@ -18769,23 +19132,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformations) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformations { @@ -18880,23 +19246,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformations) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformations { @@ -18995,23 +19364,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsInfoTypesSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsInfoTypes) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsInfoTypes { @@ -19234,23 +19606,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformation) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformation { @@ -19343,23 +19718,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfig { @@ -19574,23 +19952,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValue { @@ -19704,23 +20085,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue { @@ -19828,23 +20212,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue { @@ -19932,23 +20319,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfig { @@ -20063,23 +20453,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfig { @@ -20204,23 +20597,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnoreNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnoreSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore { @@ -20367,23 +20763,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig { @@ -20510,23 +20909,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey { @@ -20625,23 +21027,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient { @@ -20740,23 +21145,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped { @@ -20861,23 +21269,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped { @@ -20976,23 +21387,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContextSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext { @@ -21091,23 +21505,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoTypeSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType { @@ -21208,23 +21625,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfig { @@ -21439,23 +21859,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound { @@ -21569,23 +21992,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue { @@ -21693,23 +22119,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue { @@ -21924,23 +22353,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound { @@ -22054,23 +22486,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue { @@ -22178,23 +22613,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue { @@ -22287,23 +22725,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfig { @@ -22400,23 +22841,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBuckets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBuckets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBuckets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBuckets) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBuckets { @@ -22631,23 +23075,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMin + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMin for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMin(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMin) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMin { @@ -22761,23 +23208,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue { @@ -22885,23 +23335,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue { @@ -23116,23 +23569,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMax + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMax for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMax(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMax) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMax { @@ -23246,23 +23702,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue { @@ -23370,23 +23829,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue { @@ -23601,23 +24063,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue { @@ -23731,23 +24196,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue { @@ -23855,23 +24323,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue { @@ -23959,23 +24430,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig { @@ -24071,23 +24545,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfig { @@ -24180,23 +24657,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfig { @@ -24323,23 +24803,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey { @@ -24438,23 +24921,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient { @@ -24553,23 +25039,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped { @@ -24674,23 +25163,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped { @@ -24807,23 +25299,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfig { @@ -24922,23 +25417,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContext + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContext for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContext(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContextSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContext) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContext { @@ -25065,23 +25563,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKey { @@ -25180,23 +25681,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient { @@ -25295,23 +25799,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped { @@ -25416,23 +25923,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped { @@ -25529,23 +26039,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfig { @@ -25672,23 +26185,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey { @@ -25787,23 +26303,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient { @@ -25902,23 +26421,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped { @@ -26023,23 +26545,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped { @@ -26138,23 +26663,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoTypeSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType { @@ -26253,23 +26781,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContext + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContext for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContext(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContextSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContext) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContext { @@ -26362,23 +26893,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecor if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressions) []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressions { @@ -26471,23 +27005,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecor if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsCondition + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsCondition for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsCondition(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsCondition) []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsCondition { @@ -26596,23 +27133,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecor if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressions) []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressions { @@ -26705,23 +27245,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecor if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditions) []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditions { @@ -26822,23 +27365,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecor if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditions) []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditions { @@ -26937,23 +27483,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecor if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsField + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsField for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsFieldNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsField(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsFieldSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsField) []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsField { @@ -27168,23 +27717,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecor if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValue { @@ -27298,23 +27850,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecor if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueTimeValue { @@ -27422,23 +27977,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecor if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueDateValue { @@ -27553,23 +28111,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigTransformationErrorHandlin if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigTransformationErrorHandling + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigTransformationErrorHandling for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigTransformationErrorHandlingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigTransformationErrorHandling(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigTransformationErrorHandlingSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigTransformationErrorHandling) []DeidentifyTemplateDeidentifyConfigTransformationErrorHandling { @@ -27657,23 +28218,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigTransformationErrorHandlin if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigTransformationErrorHandlingThrowError + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigTransformationErrorHandlingThrowError for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigTransformationErrorHandlingThrowErrorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigTransformationErrorHandlingThrowError(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigTransformationErrorHandlingThrowErrorSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigTransformationErrorHandlingThrowError) []DeidentifyTemplateDeidentifyConfigTransformationErrorHandlingThrowError { @@ -27761,23 +28325,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigTransformationErrorHandlin if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigTransformationErrorHandlingLeaveUntransformed + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigTransformationErrorHandlingLeaveUntransformed for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigTransformationErrorHandlingLeaveUntransformedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigTransformationErrorHandlingLeaveUntransformed(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigTransformationErrorHandlingLeaveUntransformedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigTransformationErrorHandlingLeaveUntransformed) []DeidentifyTemplateDeidentifyConfigTransformationErrorHandlingLeaveUntransformed { diff --git a/services/google/dlp/alpha/inspect_template_internal.go b/services/google/dlp/alpha/inspect_template_internal.go index 5a6837f640..2e8e33a9b4 100755 --- a/services/google/dlp/alpha/inspect_template_internal.go +++ b/services/google/dlp/alpha/inspect_template_internal.go @@ -794,23 +794,26 @@ func canonicalizeNewInspectTemplateInspectConfigSet(c *Client, des, nw []Inspect if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigSlice(c *Client, des, nw []InspectTemplateInspectConfig) []InspectTemplateInspectConfig { @@ -909,23 +912,26 @@ func canonicalizeNewInspectTemplateInspectConfigInfoTypesSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigInfoTypesSlice(c *Client, des, nw []InspectTemplateInspectConfigInfoTypes) []InspectTemplateInspectConfigInfoTypes { @@ -1030,23 +1036,26 @@ func canonicalizeNewInspectTemplateInspectConfigLimitsSet(c *Client, des, nw []I if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigLimits + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigLimits for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigLimitsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigLimits(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigLimitsSlice(c *Client, des, nw []InspectTemplateInspectConfigLimits) []InspectTemplateInspectConfigLimits { @@ -1145,23 +1154,26 @@ func canonicalizeNewInspectTemplateInspectConfigLimitsMaxFindingsPerInfoTypeSet( if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigLimitsMaxFindingsPerInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigLimitsMaxFindingsPerInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigLimitsMaxFindingsPerInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigLimitsMaxFindingsPerInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigLimitsMaxFindingsPerInfoTypeSlice(c *Client, des, nw []InspectTemplateInspectConfigLimitsMaxFindingsPerInfoType) []InspectTemplateInspectConfigLimitsMaxFindingsPerInfoType { @@ -1260,23 +1272,26 @@ func canonicalizeNewInspectTemplateInspectConfigLimitsMaxFindingsPerInfoTypeInfo if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigLimitsMaxFindingsPerInfoTypeInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigLimitsMaxFindingsPerInfoTypeInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigLimitsMaxFindingsPerInfoTypeInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigLimitsMaxFindingsPerInfoTypeInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigLimitsMaxFindingsPerInfoTypeInfoTypeSlice(c *Client, des, nw []InspectTemplateInspectConfigLimitsMaxFindingsPerInfoTypeInfoType) []InspectTemplateInspectConfigLimitsMaxFindingsPerInfoTypeInfoType { @@ -1429,23 +1444,26 @@ func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesSet(c *Client, de if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigCustomInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigCustomInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigCustomInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigCustomInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesSlice(c *Client, des, nw []InspectTemplateInspectConfigCustomInfoTypes) []InspectTemplateInspectConfigCustomInfoTypes { @@ -1544,23 +1562,26 @@ func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesInfoTypeSet(c *Cl if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigCustomInfoTypesInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigCustomInfoTypesInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigCustomInfoTypesInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesInfoTypeSlice(c *Client, des, nw []InspectTemplateInspectConfigCustomInfoTypesInfoType) []InspectTemplateInspectConfigCustomInfoTypesInfoType { @@ -1675,23 +1696,26 @@ func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesDictionarySet(c * if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigCustomInfoTypesDictionary + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigCustomInfoTypesDictionary for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigCustomInfoTypesDictionaryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesDictionary(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesDictionarySlice(c *Client, des, nw []InspectTemplateInspectConfigCustomInfoTypesDictionary) []InspectTemplateInspectConfigCustomInfoTypesDictionary { @@ -1790,23 +1814,26 @@ func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesDictionaryWordLis if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigCustomInfoTypesDictionaryWordList + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigCustomInfoTypesDictionaryWordList for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigCustomInfoTypesDictionaryWordListNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesDictionaryWordList(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesDictionaryWordListSlice(c *Client, des, nw []InspectTemplateInspectConfigCustomInfoTypesDictionaryWordList) []InspectTemplateInspectConfigCustomInfoTypesDictionaryWordList { @@ -1905,23 +1932,26 @@ func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesDictionaryCloudSt if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigCustomInfoTypesDictionaryCloudStoragePath + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigCustomInfoTypesDictionaryCloudStoragePath for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigCustomInfoTypesDictionaryCloudStoragePathNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesDictionaryCloudStoragePath(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesDictionaryCloudStoragePathSlice(c *Client, des, nw []InspectTemplateInspectConfigCustomInfoTypesDictionaryCloudStoragePath) []InspectTemplateInspectConfigCustomInfoTypesDictionaryCloudStoragePath { @@ -2026,23 +2056,26 @@ func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesRegexSet(c *Clien if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigCustomInfoTypesRegex + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigCustomInfoTypesRegex for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigCustomInfoTypesRegexNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesRegex(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesRegexSlice(c *Client, des, nw []InspectTemplateInspectConfigCustomInfoTypesRegex) []InspectTemplateInspectConfigCustomInfoTypesRegex { @@ -2130,23 +2163,26 @@ func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesSurrogateTypeSet( if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigCustomInfoTypesSurrogateType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigCustomInfoTypesSurrogateType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigCustomInfoTypesSurrogateTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesSurrogateType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesSurrogateTypeSlice(c *Client, des, nw []InspectTemplateInspectConfigCustomInfoTypesSurrogateType) []InspectTemplateInspectConfigCustomInfoTypesSurrogateType { @@ -2242,23 +2278,26 @@ func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesStoredTypeSet(c * if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigCustomInfoTypesStoredType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigCustomInfoTypesStoredType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigCustomInfoTypesStoredTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesStoredType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesStoredTypeSlice(c *Client, des, nw []InspectTemplateInspectConfigCustomInfoTypesStoredType) []InspectTemplateInspectConfigCustomInfoTypesStoredType { @@ -2353,23 +2392,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSet + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSet for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSet(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSet) []InspectTemplateInspectConfigRuleSet { @@ -2468,23 +2510,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetInfoTypesSet(c *Client, d if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetInfoTypesSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetInfoTypes) []InspectTemplateInspectConfigRuleSetInfoTypes { @@ -2599,23 +2644,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesSet(c *Client, des, if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRules) []InspectTemplateInspectConfigRuleSetRules { @@ -2712,23 +2760,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRuleSet(c *Cl if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRulesHotwordRule + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRulesHotwordRule for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesHotwordRuleNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRule(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRuleSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRulesHotwordRule) []InspectTemplateInspectConfigRuleSetRulesHotwordRule { @@ -2833,23 +2884,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRuleHotwordRe if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRulesHotwordRuleHotwordRegex + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRulesHotwordRuleHotwordRegex for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesHotwordRuleHotwordRegexNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRuleHotwordRegex(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRuleHotwordRegexSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRulesHotwordRuleHotwordRegex) []InspectTemplateInspectConfigRuleSetRulesHotwordRuleHotwordRegex { @@ -2951,23 +3005,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRuleProximity if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRulesHotwordRuleProximity + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRulesHotwordRuleProximity for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesHotwordRuleProximityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRuleProximity(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRuleProximitySlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRulesHotwordRuleProximity) []InspectTemplateInspectConfigRuleSetRulesHotwordRuleProximity { @@ -3089,23 +3146,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRuleLikelihoo if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustmentNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustmentSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment) []InspectTemplateInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment { @@ -3238,23 +3298,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleSet(c * if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRulesExclusionRule + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRulesExclusionRule for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesExclusionRuleNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRule(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRulesExclusionRule) []InspectTemplateInspectConfigRuleSetRulesExclusionRule { @@ -3369,23 +3432,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleDiction if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionary + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionary for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionary(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionarySlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionary) []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionary { @@ -3484,23 +3550,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleDiction if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryWordList + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryWordList for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryWordListNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryWordList(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryWordListSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryWordList) []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryWordList { @@ -3599,23 +3668,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleDiction if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePath + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePath for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePathNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePath(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePathSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePath) []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePath { @@ -3720,23 +3792,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleRegexSe if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRulesExclusionRuleRegex + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRulesExclusionRuleRegex for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesExclusionRuleRegexNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleRegex(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleRegexSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRulesExclusionRuleRegex) []InspectTemplateInspectConfigRuleSetRulesExclusionRuleRegex { @@ -3829,23 +3904,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleExclude if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypes) []InspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypes { @@ -3944,23 +4022,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleExclude if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypesSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes) []InspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes { diff --git a/services/google/dlp/alpha/job_trigger_internal.go b/services/google/dlp/alpha/job_trigger_internal.go index 5d7b825ffb..fbe573af1e 100755 --- a/services/google/dlp/alpha/job_trigger_internal.go +++ b/services/google/dlp/alpha/job_trigger_internal.go @@ -1107,23 +1107,26 @@ func canonicalizeNewJobTriggerInspectJobSet(c *Client, des, nw []JobTriggerInspe if des == nil { return nw } - var reorderedNew []JobTriggerInspectJob + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJob for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJob(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobSlice(c *Client, des, nw []JobTriggerInspectJob) []JobTriggerInspectJob { @@ -1304,23 +1307,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigSet(c *Client, des, nw []Jo if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfig) []JobTriggerInspectJobStorageConfig { @@ -1415,23 +1421,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigDatastoreOptionsSet(c *Clie if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigDatastoreOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigDatastoreOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigDatastoreOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigDatastoreOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigDatastoreOptionsSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigDatastoreOptions) []JobTriggerInspectJobStorageConfigDatastoreOptions { @@ -1536,23 +1545,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigDatastoreOptionsPartitionId if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigDatastoreOptionsPartitionId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigDatastoreOptionsPartitionId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigDatastoreOptionsPartitionIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigDatastoreOptionsPartitionId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigDatastoreOptionsPartitionIdSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigDatastoreOptionsPartitionId) []JobTriggerInspectJobStorageConfigDatastoreOptionsPartitionId { @@ -1651,23 +1663,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigDatastoreOptionsKindSet(c * if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigDatastoreOptionsKind + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigDatastoreOptionsKind for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigDatastoreOptionsKindNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigDatastoreOptionsKind(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigDatastoreOptionsKindSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigDatastoreOptionsKind) []JobTriggerInspectJobStorageConfigDatastoreOptionsKind { @@ -1810,23 +1825,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigCloudStorageOptionsSet(c *C if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigCloudStorageOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigCloudStorageOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigCloudStorageOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigCloudStorageOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigCloudStorageOptionsSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigCloudStorageOptions) []JobTriggerInspectJobStorageConfigCloudStorageOptions { @@ -1947,23 +1965,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigCloudStorageOptionsFileSetS if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigCloudStorageOptionsFileSet + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigCloudStorageOptionsFileSet for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigCloudStorageOptionsFileSetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigCloudStorageOptionsFileSet(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigCloudStorageOptionsFileSetSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigCloudStorageOptionsFileSet) []JobTriggerInspectJobStorageConfigCloudStorageOptionsFileSet { @@ -2076,23 +2097,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigCloudStorageOptionsFileSetR if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigCloudStorageOptionsFileSetRegexFileSet + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigCloudStorageOptionsFileSetRegexFileSet for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigCloudStorageOptionsFileSetRegexFileSetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigCloudStorageOptionsFileSetRegexFileSet(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigCloudStorageOptionsFileSetRegexFileSetSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigCloudStorageOptionsFileSetRegexFileSet) []JobTriggerInspectJobStorageConfigCloudStorageOptionsFileSetRegexFileSet { @@ -2249,23 +2273,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsSet(c *Clien if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigBigQueryOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigBigQueryOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigBigQueryOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigBigQueryOptions) []JobTriggerInspectJobStorageConfigBigQueryOptions { @@ -2373,23 +2400,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsTableReferen if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigBigQueryOptionsTableReference + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigBigQueryOptionsTableReference for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigBigQueryOptionsTableReferenceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsTableReference(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsTableReferenceSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigBigQueryOptionsTableReference) []JobTriggerInspectJobStorageConfigBigQueryOptionsTableReference { @@ -2488,23 +2518,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsIdentifyingF if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigBigQueryOptionsIdentifyingFields + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigBigQueryOptionsIdentifyingFields for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigBigQueryOptionsIdentifyingFieldsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsIdentifyingFields(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsIdentifyingFieldsSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigBigQueryOptionsIdentifyingFields) []JobTriggerInspectJobStorageConfigBigQueryOptionsIdentifyingFields { @@ -2603,23 +2636,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsExcludedFiel if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigBigQueryOptionsExcludedFields + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigBigQueryOptionsExcludedFields for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigBigQueryOptionsExcludedFieldsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsExcludedFields(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsExcludedFieldsSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigBigQueryOptionsExcludedFields) []JobTriggerInspectJobStorageConfigBigQueryOptionsExcludedFields { @@ -2718,23 +2754,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsIncludedFiel if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigBigQueryOptionsIncludedFields + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigBigQueryOptionsIncludedFields for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigBigQueryOptionsIncludedFieldsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsIncludedFields(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsIncludedFieldsSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigBigQueryOptionsIncludedFields) []JobTriggerInspectJobStorageConfigBigQueryOptionsIncludedFields { @@ -2849,23 +2888,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigHybridOptionsSet(c *Client, if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigHybridOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigHybridOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigHybridOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigHybridOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigHybridOptionsSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigHybridOptions) []JobTriggerInspectJobStorageConfigHybridOptions { @@ -2958,23 +3000,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigHybridOptionsTableOptionsSe if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigHybridOptionsTableOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigHybridOptionsTableOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigHybridOptionsTableOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigHybridOptionsTableOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigHybridOptionsTableOptionsSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigHybridOptionsTableOptions) []JobTriggerInspectJobStorageConfigHybridOptionsTableOptions { @@ -3073,23 +3118,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigHybridOptionsTableOptionsId if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigHybridOptionsTableOptionsIdentifyingFields + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigHybridOptionsTableOptionsIdentifyingFields for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigHybridOptionsTableOptionsIdentifyingFieldsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigHybridOptionsTableOptionsIdentifyingFields(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigHybridOptionsTableOptionsIdentifyingFieldsSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigHybridOptionsTableOptionsIdentifyingFields) []JobTriggerInspectJobStorageConfigHybridOptionsTableOptionsIdentifyingFields { @@ -3202,23 +3250,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigTimespanConfigSet(c *Client if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigTimespanConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigTimespanConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigTimespanConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigTimespanConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigTimespanConfigSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigTimespanConfig) []JobTriggerInspectJobStorageConfigTimespanConfig { @@ -3317,23 +3368,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigTimespanConfigTimestampFiel if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigTimespanConfigTimestampField + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigTimespanConfigTimestampField for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigTimespanConfigTimestampFieldNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigTimespanConfigTimestampField(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigTimespanConfigTimestampFieldSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigTimespanConfigTimestampField) []JobTriggerInspectJobStorageConfigTimespanConfigTimestampField { @@ -3454,23 +3508,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigSet(c *Client, des, nw []Jo if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfig) []JobTriggerInspectJobInspectConfig { @@ -3569,23 +3626,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigInfoTypesSet(c *Client, des if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigInfoTypesSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigInfoTypes) []JobTriggerInspectJobInspectConfigInfoTypes { @@ -3690,23 +3750,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigLimitsSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigLimits + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigLimits for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigLimitsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigLimits(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigLimitsSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigLimits) []JobTriggerInspectJobInspectConfigLimits { @@ -3805,23 +3868,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoTyp if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoTypeSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoType) []JobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoType { @@ -3928,23 +3994,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoTyp if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoTypeInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoTypeInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoTypeInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoTypeInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoTypeInfoTypeSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoTypeInfoType) []JobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoTypeInfoType { @@ -4099,23 +4168,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesSet(c *Clien if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypes) []JobTriggerInspectJobInspectConfigCustomInfoTypes { @@ -4222,23 +4294,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesInfoTypeSet( if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesInfoTypeSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesInfoType) []JobTriggerInspectJobInspectConfigCustomInfoTypesInfoType { @@ -4353,23 +4428,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDictionarySe if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionary + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionary for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDictionary(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDictionarySlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionary) []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionary { @@ -4468,23 +4546,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryWo if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryWordList + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryWordList for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryWordListNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryWordList(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryWordListSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryWordList) []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryWordList { @@ -4583,23 +4664,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryCl if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryCloudStoragePath + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryCloudStoragePath for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryCloudStoragePathNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryCloudStoragePath(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryCloudStoragePathSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryCloudStoragePath) []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryCloudStoragePath { @@ -4704,23 +4788,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesRegexSet(c * if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesRegex + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesRegex for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesRegexNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesRegex(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesRegexSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesRegex) []JobTriggerInspectJobInspectConfigCustomInfoTypesRegex { @@ -4808,23 +4895,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesSurrogateTyp if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesSurrogateType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesSurrogateType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesSurrogateTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesSurrogateType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesSurrogateTypeSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesSurrogateType) []JobTriggerInspectJobInspectConfigCustomInfoTypesSurrogateType { @@ -4920,23 +5010,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesStoredTypeSe if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesStoredType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesStoredType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesStoredTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesStoredType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesStoredTypeSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesStoredType) []JobTriggerInspectJobInspectConfigCustomInfoTypesStoredType { @@ -5039,23 +5132,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRul if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRules) []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRules { @@ -5152,23 +5248,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRul if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRule + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRule for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRule(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRule) []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRule { @@ -5273,23 +5372,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRul if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleHotwordRegex + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleHotwordRegex for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleHotwordRegexNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleHotwordRegex(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleHotwordRegexSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleHotwordRegex) []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleHotwordRegex { @@ -5391,23 +5493,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRul if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleProximity + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleProximity for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleProximityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleProximity(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleProximitySlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleProximity) []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleProximity { @@ -5529,23 +5634,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRul if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleLikelihoodAdjustment + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleLikelihoodAdjustment for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleLikelihoodAdjustmentNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleLikelihoodAdjustment(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleLikelihoodAdjustmentSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleLikelihoodAdjustment) []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleLikelihoodAdjustment { @@ -5640,23 +5748,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetSet(c *Client, des, if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSet + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSet for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSet(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSet) []JobTriggerInspectJobInspectConfigRuleSet { @@ -5763,23 +5874,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetInfoTypesSet(c *Clie if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetInfoTypesSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetInfoTypes) []JobTriggerInspectJobInspectConfigRuleSetInfoTypes { @@ -5894,23 +6008,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesSet(c *Client, if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRules) []JobTriggerInspectJobInspectConfigRuleSetRules { @@ -6007,23 +6124,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleSet( if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRule + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRule for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRule(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRule) []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRule { @@ -6128,23 +6248,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleHotw if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleHotwordRegex + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleHotwordRegex for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleHotwordRegexNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleHotwordRegex(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleHotwordRegexSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleHotwordRegex) []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleHotwordRegex { @@ -6246,23 +6369,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleProx if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleProximity + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleProximity for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleProximityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleProximity(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleProximitySlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleProximity) []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleProximity { @@ -6384,23 +6510,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleLike if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustmentNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustmentSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment) []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment { @@ -6533,23 +6662,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleSe if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRule + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRule for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRule(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRule) []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRule { @@ -6664,23 +6796,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDi if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionary + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionary for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionary(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionarySlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionary) []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionary { @@ -6779,23 +6914,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDi if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryWordList + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryWordList for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryWordListNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryWordList(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryWordListSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryWordList) []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryWordList { @@ -6894,23 +7032,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDi if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePath + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePath for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePathNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePath(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePathSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePath) []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePath { @@ -7015,23 +7156,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleRe if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleRegex + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleRegex for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleRegexNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleRegex(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleRegexSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleRegex) []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleRegex { @@ -7124,23 +7268,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleEx if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypes) []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypes { @@ -7247,23 +7394,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleEx if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypesSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes) []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes { @@ -7426,23 +7576,26 @@ func canonicalizeNewJobTriggerInspectJobActionsSet(c *Client, des, nw []JobTrigg if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobActions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobActions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobActionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobActions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobActionsSlice(c *Client, des, nw []JobTriggerInspectJobActions) []JobTriggerInspectJobActions { @@ -7535,23 +7688,26 @@ func canonicalizeNewJobTriggerInspectJobActionsSaveFindingsSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobActionsSaveFindings + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobActionsSaveFindings for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobActionsSaveFindingsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobActionsSaveFindings(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobActionsSaveFindingsSlice(c *Client, des, nw []JobTriggerInspectJobActionsSaveFindings) []JobTriggerInspectJobActionsSaveFindings { @@ -7672,23 +7828,26 @@ func canonicalizeNewJobTriggerInspectJobActionsSaveFindingsOutputConfigSet(c *Cl if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobActionsSaveFindingsOutputConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobActionsSaveFindingsOutputConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobActionsSaveFindingsOutputConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobActionsSaveFindingsOutputConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobActionsSaveFindingsOutputConfigSlice(c *Client, des, nw []JobTriggerInspectJobActionsSaveFindingsOutputConfig) []JobTriggerInspectJobActionsSaveFindingsOutputConfig { @@ -7796,23 +7955,26 @@ func canonicalizeNewJobTriggerInspectJobActionsSaveFindingsOutputConfigTableSet( if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobActionsSaveFindingsOutputConfigTable + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobActionsSaveFindingsOutputConfigTable for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobActionsSaveFindingsOutputConfigTableNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobActionsSaveFindingsOutputConfigTable(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobActionsSaveFindingsOutputConfigTableSlice(c *Client, des, nw []JobTriggerInspectJobActionsSaveFindingsOutputConfigTable) []JobTriggerInspectJobActionsSaveFindingsOutputConfigTable { @@ -7900,23 +8062,26 @@ func canonicalizeNewJobTriggerInspectJobActionsSaveFindingsOutputConfigDlpStorag if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobActionsSaveFindingsOutputConfigDlpStorage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobActionsSaveFindingsOutputConfigDlpStorage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobActionsSaveFindingsOutputConfigDlpStorageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobActionsSaveFindingsOutputConfigDlpStorage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobActionsSaveFindingsOutputConfigDlpStorageSlice(c *Client, des, nw []JobTriggerInspectJobActionsSaveFindingsOutputConfigDlpStorage) []JobTriggerInspectJobActionsSaveFindingsOutputConfigDlpStorage { @@ -8012,23 +8177,26 @@ func canonicalizeNewJobTriggerInspectJobActionsPubSubSet(c *Client, des, nw []Jo if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobActionsPubSub + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobActionsPubSub for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobActionsPubSubNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobActionsPubSub(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobActionsPubSubSlice(c *Client, des, nw []JobTriggerInspectJobActionsPubSub) []JobTriggerInspectJobActionsPubSub { @@ -8116,23 +8284,26 @@ func canonicalizeNewJobTriggerInspectJobActionsPublishSummaryToCsccSet(c *Client if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobActionsPublishSummaryToCscc + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobActionsPublishSummaryToCscc for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobActionsPublishSummaryToCsccNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobActionsPublishSummaryToCscc(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobActionsPublishSummaryToCsccSlice(c *Client, des, nw []JobTriggerInspectJobActionsPublishSummaryToCscc) []JobTriggerInspectJobActionsPublishSummaryToCscc { @@ -8220,23 +8391,26 @@ func canonicalizeNewJobTriggerInspectJobActionsPublishFindingsToCloudDataCatalog if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobActionsPublishFindingsToCloudDataCatalog + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobActionsPublishFindingsToCloudDataCatalog for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobActionsPublishFindingsToCloudDataCatalogNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobActionsPublishFindingsToCloudDataCatalog(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobActionsPublishFindingsToCloudDataCatalogSlice(c *Client, des, nw []JobTriggerInspectJobActionsPublishFindingsToCloudDataCatalog) []JobTriggerInspectJobActionsPublishFindingsToCloudDataCatalog { @@ -8324,23 +8498,26 @@ func canonicalizeNewJobTriggerInspectJobActionsJobNotificationEmailsSet(c *Clien if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobActionsJobNotificationEmails + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobActionsJobNotificationEmails for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobActionsJobNotificationEmailsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobActionsJobNotificationEmails(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobActionsJobNotificationEmailsSlice(c *Client, des, nw []JobTriggerInspectJobActionsJobNotificationEmails) []JobTriggerInspectJobActionsJobNotificationEmails { @@ -8428,23 +8605,26 @@ func canonicalizeNewJobTriggerInspectJobActionsPublishToStackdriverSet(c *Client if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobActionsPublishToStackdriver + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobActionsPublishToStackdriver for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobActionsPublishToStackdriverNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobActionsPublishToStackdriver(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobActionsPublishToStackdriverSlice(c *Client, des, nw []JobTriggerInspectJobActionsPublishToStackdriver) []JobTriggerInspectJobActionsPublishToStackdriver { @@ -8559,23 +8739,26 @@ func canonicalizeNewJobTriggerTriggersSet(c *Client, des, nw []JobTriggerTrigger if des == nil { return nw } - var reorderedNew []JobTriggerTriggers + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerTriggers for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerTriggersNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerTriggers(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerTriggersSlice(c *Client, des, nw []JobTriggerTriggers) []JobTriggerTriggers { @@ -8674,23 +8857,26 @@ func canonicalizeNewJobTriggerTriggersScheduleSet(c *Client, des, nw []JobTrigge if des == nil { return nw } - var reorderedNew []JobTriggerTriggersSchedule + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerTriggersSchedule for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerTriggersScheduleNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerTriggersSchedule(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerTriggersScheduleSlice(c *Client, des, nw []JobTriggerTriggersSchedule) []JobTriggerTriggersSchedule { @@ -8778,23 +8964,26 @@ func canonicalizeNewJobTriggerTriggersManualSet(c *Client, des, nw []JobTriggerT if des == nil { return nw } - var reorderedNew []JobTriggerTriggersManual + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerTriggersManual for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerTriggersManualNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerTriggersManual(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerTriggersManualSlice(c *Client, des, nw []JobTriggerTriggersManual) []JobTriggerTriggersManual { @@ -8893,23 +9082,26 @@ func canonicalizeNewJobTriggerErrorsSet(c *Client, des, nw []JobTriggerErrors) [ if des == nil { return nw } - var reorderedNew []JobTriggerErrors + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerErrors for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerErrorsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerErrors(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerErrorsSlice(c *Client, des, nw []JobTriggerErrors) []JobTriggerErrors { @@ -9016,23 +9208,26 @@ func canonicalizeNewJobTriggerErrorsDetailsSet(c *Client, des, nw []JobTriggerEr if des == nil { return nw } - var reorderedNew []JobTriggerErrorsDetails + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerErrorsDetails for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerErrorsDetailsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerErrorsDetails(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerErrorsDetailsSlice(c *Client, des, nw []JobTriggerErrorsDetails) []JobTriggerErrorsDetails { @@ -9139,23 +9334,26 @@ func canonicalizeNewJobTriggerErrorsDetailsDetailsSet(c *Client, des, nw []JobTr if des == nil { return nw } - var reorderedNew []JobTriggerErrorsDetailsDetails + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerErrorsDetailsDetails for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerErrorsDetailsDetailsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerErrorsDetailsDetails(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerErrorsDetailsDetailsSlice(c *Client, des, nw []JobTriggerErrorsDetailsDetails) []JobTriggerErrorsDetailsDetails { diff --git a/services/google/dlp/alpha/stored_info_type_internal.go b/services/google/dlp/alpha/stored_info_type_internal.go index e5e71b055d..fecde9653f 100755 --- a/services/google/dlp/alpha/stored_info_type_internal.go +++ b/services/google/dlp/alpha/stored_info_type_internal.go @@ -743,23 +743,26 @@ func canonicalizeNewStoredInfoTypeLargeCustomDictionarySet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []StoredInfoTypeLargeCustomDictionary + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []StoredInfoTypeLargeCustomDictionary for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareStoredInfoTypeLargeCustomDictionaryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewStoredInfoTypeLargeCustomDictionary(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewStoredInfoTypeLargeCustomDictionarySlice(c *Client, des, nw []StoredInfoTypeLargeCustomDictionary) []StoredInfoTypeLargeCustomDictionary { @@ -858,23 +861,26 @@ func canonicalizeNewStoredInfoTypeLargeCustomDictionaryOutputPathSet(c *Client, if des == nil { return nw } - var reorderedNew []StoredInfoTypeLargeCustomDictionaryOutputPath + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []StoredInfoTypeLargeCustomDictionaryOutputPath for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareStoredInfoTypeLargeCustomDictionaryOutputPathNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewStoredInfoTypeLargeCustomDictionaryOutputPath(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewStoredInfoTypeLargeCustomDictionaryOutputPathSlice(c *Client, des, nw []StoredInfoTypeLargeCustomDictionaryOutputPath) []StoredInfoTypeLargeCustomDictionaryOutputPath { @@ -973,23 +979,26 @@ func canonicalizeNewStoredInfoTypeLargeCustomDictionaryCloudStorageFileSetSet(c if des == nil { return nw } - var reorderedNew []StoredInfoTypeLargeCustomDictionaryCloudStorageFileSet + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []StoredInfoTypeLargeCustomDictionaryCloudStorageFileSet for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareStoredInfoTypeLargeCustomDictionaryCloudStorageFileSetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewStoredInfoTypeLargeCustomDictionaryCloudStorageFileSet(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewStoredInfoTypeLargeCustomDictionaryCloudStorageFileSetSlice(c *Client, des, nw []StoredInfoTypeLargeCustomDictionaryCloudStorageFileSet) []StoredInfoTypeLargeCustomDictionaryCloudStorageFileSet { @@ -1084,23 +1093,26 @@ func canonicalizeNewStoredInfoTypeLargeCustomDictionaryBigQueryFieldSet(c *Clien if des == nil { return nw } - var reorderedNew []StoredInfoTypeLargeCustomDictionaryBigQueryField + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []StoredInfoTypeLargeCustomDictionaryBigQueryField for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareStoredInfoTypeLargeCustomDictionaryBigQueryFieldNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewStoredInfoTypeLargeCustomDictionaryBigQueryField(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewStoredInfoTypeLargeCustomDictionaryBigQueryFieldSlice(c *Client, des, nw []StoredInfoTypeLargeCustomDictionaryBigQueryField) []StoredInfoTypeLargeCustomDictionaryBigQueryField { @@ -1208,23 +1220,26 @@ func canonicalizeNewStoredInfoTypeLargeCustomDictionaryBigQueryFieldTableSet(c * if des == nil { return nw } - var reorderedNew []StoredInfoTypeLargeCustomDictionaryBigQueryFieldTable + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []StoredInfoTypeLargeCustomDictionaryBigQueryFieldTable for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareStoredInfoTypeLargeCustomDictionaryBigQueryFieldTableNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewStoredInfoTypeLargeCustomDictionaryBigQueryFieldTable(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewStoredInfoTypeLargeCustomDictionaryBigQueryFieldTableSlice(c *Client, des, nw []StoredInfoTypeLargeCustomDictionaryBigQueryFieldTable) []StoredInfoTypeLargeCustomDictionaryBigQueryFieldTable { @@ -1323,23 +1338,26 @@ func canonicalizeNewStoredInfoTypeLargeCustomDictionaryBigQueryFieldFieldSet(c * if des == nil { return nw } - var reorderedNew []StoredInfoTypeLargeCustomDictionaryBigQueryFieldField + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []StoredInfoTypeLargeCustomDictionaryBigQueryFieldField for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareStoredInfoTypeLargeCustomDictionaryBigQueryFieldFieldNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewStoredInfoTypeLargeCustomDictionaryBigQueryFieldField(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewStoredInfoTypeLargeCustomDictionaryBigQueryFieldFieldSlice(c *Client, des, nw []StoredInfoTypeLargeCustomDictionaryBigQueryFieldField) []StoredInfoTypeLargeCustomDictionaryBigQueryFieldField { @@ -1454,23 +1472,26 @@ func canonicalizeNewStoredInfoTypeDictionarySet(c *Client, des, nw []StoredInfoT if des == nil { return nw } - var reorderedNew []StoredInfoTypeDictionary + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []StoredInfoTypeDictionary for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareStoredInfoTypeDictionaryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewStoredInfoTypeDictionary(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewStoredInfoTypeDictionarySlice(c *Client, des, nw []StoredInfoTypeDictionary) []StoredInfoTypeDictionary { @@ -1569,23 +1590,26 @@ func canonicalizeNewStoredInfoTypeDictionaryWordListSet(c *Client, des, nw []Sto if des == nil { return nw } - var reorderedNew []StoredInfoTypeDictionaryWordList + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []StoredInfoTypeDictionaryWordList for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareStoredInfoTypeDictionaryWordListNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewStoredInfoTypeDictionaryWordList(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewStoredInfoTypeDictionaryWordListSlice(c *Client, des, nw []StoredInfoTypeDictionaryWordList) []StoredInfoTypeDictionaryWordList { @@ -1684,23 +1708,26 @@ func canonicalizeNewStoredInfoTypeDictionaryCloudStoragePathSet(c *Client, des, if des == nil { return nw } - var reorderedNew []StoredInfoTypeDictionaryCloudStoragePath + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []StoredInfoTypeDictionaryCloudStoragePath for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareStoredInfoTypeDictionaryCloudStoragePathNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewStoredInfoTypeDictionaryCloudStoragePath(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewStoredInfoTypeDictionaryCloudStoragePathSlice(c *Client, des, nw []StoredInfoTypeDictionaryCloudStoragePath) []StoredInfoTypeDictionaryCloudStoragePath { @@ -1805,23 +1832,26 @@ func canonicalizeNewStoredInfoTypeRegexSet(c *Client, des, nw []StoredInfoTypeRe if des == nil { return nw } - var reorderedNew []StoredInfoTypeRegex + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []StoredInfoTypeRegex for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareStoredInfoTypeRegexNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewStoredInfoTypeRegex(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewStoredInfoTypeRegexSlice(c *Client, des, nw []StoredInfoTypeRegex) []StoredInfoTypeRegex { diff --git a/services/google/dlp/beta/deidentify_template_internal.go b/services/google/dlp/beta/deidentify_template_internal.go index af44afc67f..90df89fe8e 100755 --- a/services/google/dlp/beta/deidentify_template_internal.go +++ b/services/google/dlp/beta/deidentify_template_internal.go @@ -2388,23 +2388,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigSet(c *Client, des, nw []D if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfig) []DeidentifyTemplateDeidentifyConfig { @@ -2497,23 +2500,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsSet if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformations) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformations { @@ -2608,23 +2614,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformations) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformations { @@ -2723,23 +2732,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsInfoTypesSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsInfoTypes) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsInfoTypes { @@ -2962,23 +2974,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformation) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformation { @@ -3071,23 +3086,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfig) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfig { @@ -3302,23 +3320,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValue { @@ -3432,23 +3453,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue { @@ -3556,23 +3580,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue { @@ -3660,23 +3687,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfig) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfig { @@ -3791,23 +3821,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfig) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfig { @@ -3932,23 +3965,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnoreNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnoreSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore { @@ -4095,23 +4131,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig { @@ -4238,23 +4277,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey { @@ -4353,23 +4395,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient { @@ -4468,23 +4513,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped { @@ -4589,23 +4637,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped { @@ -4704,23 +4755,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContextSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext { @@ -4819,23 +4873,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoTypeSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType { @@ -4936,23 +4993,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfig) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfig { @@ -5167,23 +5227,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound { @@ -5297,23 +5360,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue { @@ -5421,23 +5487,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue { @@ -5652,23 +5721,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound { @@ -5782,23 +5854,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue { @@ -5906,23 +5981,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue { @@ -6015,23 +6093,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfig) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfig { @@ -6128,23 +6209,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBuckets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBuckets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBuckets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBuckets) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBuckets { @@ -6359,23 +6443,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMin + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMin for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMin(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMin) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMin { @@ -6489,23 +6576,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue { @@ -6613,23 +6703,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue { @@ -6844,23 +6937,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMax + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMax for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMax(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMax) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMax { @@ -6974,23 +7070,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue { @@ -7098,23 +7197,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue { @@ -7329,23 +7431,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue { @@ -7459,23 +7564,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue { @@ -7583,23 +7691,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue { @@ -7687,23 +7798,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig { @@ -7799,23 +7913,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfig) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfig { @@ -7908,23 +8025,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfig) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfig { @@ -8051,23 +8171,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey { @@ -8166,23 +8289,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient { @@ -8281,23 +8407,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped { @@ -8402,23 +8531,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped { @@ -8535,23 +8667,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfig) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfig { @@ -8650,23 +8785,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContext + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContext for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContext(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContextSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContext) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContext { @@ -8793,23 +8931,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKey { @@ -8908,23 +9049,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient { @@ -9023,23 +9167,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped { @@ -9144,23 +9291,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped { @@ -9257,23 +9407,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfig) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfig { @@ -9400,23 +9553,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey { @@ -9515,23 +9671,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient { @@ -9630,23 +9789,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped { @@ -9751,23 +9913,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped { @@ -9866,23 +10031,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoTypeSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType { @@ -9981,23 +10149,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContext + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContext for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContext(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContextSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContext) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContext { @@ -10092,23 +10263,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsSet(c if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformations) []DeidentifyTemplateDeidentifyConfigRecordTransformations { @@ -10227,23 +10401,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformations) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformations { @@ -10342,23 +10519,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsFields + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsFields for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsFieldsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsFields(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsFieldsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsFields) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsFields { @@ -10451,23 +10631,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsCondition + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsCondition for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsCondition(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsCondition) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsCondition { @@ -10576,23 +10759,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressions) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressions { @@ -10685,23 +10871,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditions) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditions { @@ -10802,23 +10991,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditions) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditions { @@ -10917,23 +11109,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsField + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsField for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsFieldNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsField(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsFieldSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsField) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsField { @@ -11148,23 +11343,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValue { @@ -11278,23 +11476,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueTimeValue { @@ -11402,23 +11603,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueDateValue { @@ -11641,23 +11845,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformation) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformation { @@ -11750,23 +11957,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfig { @@ -11981,23 +12191,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValue { @@ -12111,23 +12324,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue { @@ -12235,23 +12451,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue { @@ -12339,23 +12558,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationRedactConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationRedactConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationRedactConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationRedactConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationRedactConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationRedactConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationRedactConfig { @@ -12470,23 +12692,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfig { @@ -12611,23 +12836,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnoreNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnoreSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore { @@ -12774,23 +13002,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig { @@ -12917,23 +13148,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey { @@ -13032,23 +13266,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient { @@ -13147,23 +13384,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped { @@ -13268,23 +13508,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped { @@ -13383,23 +13626,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContextSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext { @@ -13498,23 +13744,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoTypeSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType { @@ -13615,23 +13864,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfig { @@ -13846,23 +14098,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound { @@ -13976,23 +14231,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue - for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue + for _, d := range des { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue { @@ -14100,23 +14358,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue { @@ -14331,23 +14592,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound { @@ -14461,23 +14725,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue { @@ -14585,23 +14852,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue { @@ -14694,23 +14964,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfig { @@ -14807,23 +15080,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBuckets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBuckets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBuckets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBuckets) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBuckets { @@ -15038,23 +15314,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMin + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMin for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMin(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMin) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMin { @@ -15168,23 +15447,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue { @@ -15292,23 +15574,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue { @@ -15523,23 +15808,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMax + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMax for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMax(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMax) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMax { @@ -15653,23 +15941,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue { @@ -15777,23 +16068,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue { @@ -16008,23 +16302,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue { @@ -16138,23 +16435,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue { @@ -16262,23 +16562,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue { @@ -16366,23 +16669,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceWithInfoTypeConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceWithInfoTypeConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig { @@ -16478,23 +16784,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationTimePartConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationTimePartConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationTimePartConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationTimePartConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationTimePartConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationTimePartConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationTimePartConfig { @@ -16587,23 +16896,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfig { @@ -16730,23 +17042,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey { @@ -16845,23 +17160,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient { @@ -16960,23 +17278,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped { @@ -17081,23 +17402,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped { @@ -17214,23 +17538,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfig { @@ -17329,23 +17656,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigContext + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigContext for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigContextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigContext(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigContextSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigContext) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigContext { @@ -17472,23 +17802,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKey { @@ -17587,23 +17920,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient { @@ -17702,23 +18038,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped { @@ -17823,23 +18162,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped { @@ -17936,23 +18278,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfig { @@ -18079,23 +18424,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey { @@ -18194,23 +18542,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient { @@ -18309,23 +18660,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped { @@ -18430,23 +18784,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped { @@ -18545,23 +18902,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoTypeSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType { @@ -18660,23 +19020,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigContext + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigContext for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigContextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigContext(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigContextSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigContext) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigContext { @@ -18769,23 +19132,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformations) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformations { @@ -18880,23 +19246,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformations) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformations { @@ -18995,23 +19364,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsInfoTypesSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsInfoTypes) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsInfoTypes { @@ -19234,23 +19606,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformation) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformation { @@ -19343,23 +19718,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfig { @@ -19574,23 +19952,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValue { @@ -19704,23 +20085,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue { @@ -19828,23 +20212,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue { @@ -19932,23 +20319,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfig { @@ -20063,23 +20453,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfig { @@ -20204,23 +20597,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnoreNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnoreSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore { @@ -20367,23 +20763,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig { @@ -20510,23 +20909,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey { @@ -20625,23 +21027,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient { @@ -20740,23 +21145,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped { @@ -20861,23 +21269,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped { @@ -20976,23 +21387,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContextSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext { @@ -21091,23 +21505,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoTypeSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType { @@ -21208,23 +21625,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfig { @@ -21439,23 +21859,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound { @@ -21569,23 +21992,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue { @@ -21693,23 +22119,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue { @@ -21924,23 +22353,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound { @@ -22054,23 +22486,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue { @@ -22178,23 +22613,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue { @@ -22287,23 +22725,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfig { @@ -22400,23 +22841,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBuckets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBuckets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBuckets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBuckets) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBuckets { @@ -22631,23 +23075,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMin + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMin for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMin(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMin) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMin { @@ -22761,23 +23208,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue { @@ -22885,23 +23335,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue { @@ -23116,23 +23569,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMax + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMax for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMax(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMax) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMax { @@ -23246,23 +23702,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue { @@ -23370,23 +23829,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue { @@ -23601,23 +24063,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue { @@ -23731,23 +24196,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue { @@ -23855,23 +24323,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue { @@ -23959,23 +24430,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig { @@ -24071,23 +24545,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfig { @@ -24180,23 +24657,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfig { @@ -24323,23 +24803,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey { @@ -24438,23 +24921,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient { @@ -24553,23 +25039,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped { @@ -24674,23 +25163,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped { @@ -24807,23 +25299,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfig { @@ -24922,23 +25417,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContext + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContext for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContext(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContextSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContext) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContext { @@ -25065,23 +25563,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKey { @@ -25180,23 +25681,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient { @@ -25295,23 +25799,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped { @@ -25416,23 +25923,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped { @@ -25529,23 +26039,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfig { @@ -25672,23 +26185,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey { @@ -25787,23 +26303,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient { @@ -25902,23 +26421,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped { @@ -26023,23 +26545,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped { @@ -26138,23 +26663,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoTypeSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType { @@ -26253,23 +26781,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContext + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContext for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContext(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContextSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContext) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContext { @@ -26362,23 +26893,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecor if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressions) []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressions { @@ -26471,23 +27005,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecor if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsCondition + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsCondition for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsCondition(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsCondition) []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsCondition { @@ -26596,23 +27133,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecor if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressions) []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressions { @@ -26705,23 +27245,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecor if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditions) []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditions { @@ -26822,23 +27365,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecor if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditions) []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditions { @@ -26937,23 +27483,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecor if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsField + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsField for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsFieldNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsField(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsFieldSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsField) []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsField { @@ -27168,23 +27717,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecor if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValue { @@ -27298,23 +27850,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecor if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueTimeValue { @@ -27422,23 +27977,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecor if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueDateValue { @@ -27553,23 +28111,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigTransformationErrorHandlin if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigTransformationErrorHandling + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigTransformationErrorHandling for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigTransformationErrorHandlingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigTransformationErrorHandling(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigTransformationErrorHandlingSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigTransformationErrorHandling) []DeidentifyTemplateDeidentifyConfigTransformationErrorHandling { @@ -27657,23 +28218,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigTransformationErrorHandlin if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigTransformationErrorHandlingThrowError + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigTransformationErrorHandlingThrowError for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigTransformationErrorHandlingThrowErrorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigTransformationErrorHandlingThrowError(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigTransformationErrorHandlingThrowErrorSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigTransformationErrorHandlingThrowError) []DeidentifyTemplateDeidentifyConfigTransformationErrorHandlingThrowError { @@ -27761,23 +28325,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigTransformationErrorHandlin if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigTransformationErrorHandlingLeaveUntransformed + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigTransformationErrorHandlingLeaveUntransformed for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigTransformationErrorHandlingLeaveUntransformedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigTransformationErrorHandlingLeaveUntransformed(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigTransformationErrorHandlingLeaveUntransformedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigTransformationErrorHandlingLeaveUntransformed) []DeidentifyTemplateDeidentifyConfigTransformationErrorHandlingLeaveUntransformed { diff --git a/services/google/dlp/beta/inspect_template_internal.go b/services/google/dlp/beta/inspect_template_internal.go index 9e3fc18dda..01f81de95f 100755 --- a/services/google/dlp/beta/inspect_template_internal.go +++ b/services/google/dlp/beta/inspect_template_internal.go @@ -794,23 +794,26 @@ func canonicalizeNewInspectTemplateInspectConfigSet(c *Client, des, nw []Inspect if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigSlice(c *Client, des, nw []InspectTemplateInspectConfig) []InspectTemplateInspectConfig { @@ -909,23 +912,26 @@ func canonicalizeNewInspectTemplateInspectConfigInfoTypesSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigInfoTypesSlice(c *Client, des, nw []InspectTemplateInspectConfigInfoTypes) []InspectTemplateInspectConfigInfoTypes { @@ -1030,23 +1036,26 @@ func canonicalizeNewInspectTemplateInspectConfigLimitsSet(c *Client, des, nw []I if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigLimits + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigLimits for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigLimitsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigLimits(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigLimitsSlice(c *Client, des, nw []InspectTemplateInspectConfigLimits) []InspectTemplateInspectConfigLimits { @@ -1145,23 +1154,26 @@ func canonicalizeNewInspectTemplateInspectConfigLimitsMaxFindingsPerInfoTypeSet( if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigLimitsMaxFindingsPerInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigLimitsMaxFindingsPerInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigLimitsMaxFindingsPerInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigLimitsMaxFindingsPerInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigLimitsMaxFindingsPerInfoTypeSlice(c *Client, des, nw []InspectTemplateInspectConfigLimitsMaxFindingsPerInfoType) []InspectTemplateInspectConfigLimitsMaxFindingsPerInfoType { @@ -1260,23 +1272,26 @@ func canonicalizeNewInspectTemplateInspectConfigLimitsMaxFindingsPerInfoTypeInfo if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigLimitsMaxFindingsPerInfoTypeInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigLimitsMaxFindingsPerInfoTypeInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigLimitsMaxFindingsPerInfoTypeInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigLimitsMaxFindingsPerInfoTypeInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigLimitsMaxFindingsPerInfoTypeInfoTypeSlice(c *Client, des, nw []InspectTemplateInspectConfigLimitsMaxFindingsPerInfoTypeInfoType) []InspectTemplateInspectConfigLimitsMaxFindingsPerInfoTypeInfoType { @@ -1429,23 +1444,26 @@ func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesSet(c *Client, de if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigCustomInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigCustomInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigCustomInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigCustomInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesSlice(c *Client, des, nw []InspectTemplateInspectConfigCustomInfoTypes) []InspectTemplateInspectConfigCustomInfoTypes { @@ -1544,23 +1562,26 @@ func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesInfoTypeSet(c *Cl if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigCustomInfoTypesInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigCustomInfoTypesInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigCustomInfoTypesInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesInfoTypeSlice(c *Client, des, nw []InspectTemplateInspectConfigCustomInfoTypesInfoType) []InspectTemplateInspectConfigCustomInfoTypesInfoType { @@ -1675,23 +1696,26 @@ func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesDictionarySet(c * if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigCustomInfoTypesDictionary + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigCustomInfoTypesDictionary for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigCustomInfoTypesDictionaryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesDictionary(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesDictionarySlice(c *Client, des, nw []InspectTemplateInspectConfigCustomInfoTypesDictionary) []InspectTemplateInspectConfigCustomInfoTypesDictionary { @@ -1790,23 +1814,26 @@ func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesDictionaryWordLis if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigCustomInfoTypesDictionaryWordList + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigCustomInfoTypesDictionaryWordList for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigCustomInfoTypesDictionaryWordListNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesDictionaryWordList(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesDictionaryWordListSlice(c *Client, des, nw []InspectTemplateInspectConfigCustomInfoTypesDictionaryWordList) []InspectTemplateInspectConfigCustomInfoTypesDictionaryWordList { @@ -1905,23 +1932,26 @@ func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesDictionaryCloudSt if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigCustomInfoTypesDictionaryCloudStoragePath + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigCustomInfoTypesDictionaryCloudStoragePath for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigCustomInfoTypesDictionaryCloudStoragePathNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesDictionaryCloudStoragePath(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesDictionaryCloudStoragePathSlice(c *Client, des, nw []InspectTemplateInspectConfigCustomInfoTypesDictionaryCloudStoragePath) []InspectTemplateInspectConfigCustomInfoTypesDictionaryCloudStoragePath { @@ -2026,23 +2056,26 @@ func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesRegexSet(c *Clien if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigCustomInfoTypesRegex + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigCustomInfoTypesRegex for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigCustomInfoTypesRegexNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesRegex(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesRegexSlice(c *Client, des, nw []InspectTemplateInspectConfigCustomInfoTypesRegex) []InspectTemplateInspectConfigCustomInfoTypesRegex { @@ -2130,23 +2163,26 @@ func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesSurrogateTypeSet( if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigCustomInfoTypesSurrogateType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigCustomInfoTypesSurrogateType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigCustomInfoTypesSurrogateTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesSurrogateType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesSurrogateTypeSlice(c *Client, des, nw []InspectTemplateInspectConfigCustomInfoTypesSurrogateType) []InspectTemplateInspectConfigCustomInfoTypesSurrogateType { @@ -2242,23 +2278,26 @@ func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesStoredTypeSet(c * if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigCustomInfoTypesStoredType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigCustomInfoTypesStoredType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigCustomInfoTypesStoredTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesStoredType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesStoredTypeSlice(c *Client, des, nw []InspectTemplateInspectConfigCustomInfoTypesStoredType) []InspectTemplateInspectConfigCustomInfoTypesStoredType { @@ -2353,23 +2392,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSet + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSet for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSet(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSet) []InspectTemplateInspectConfigRuleSet { @@ -2468,23 +2510,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetInfoTypesSet(c *Client, d if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetInfoTypesSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetInfoTypes) []InspectTemplateInspectConfigRuleSetInfoTypes { @@ -2599,23 +2644,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesSet(c *Client, des, if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRules) []InspectTemplateInspectConfigRuleSetRules { @@ -2712,23 +2760,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRuleSet(c *Cl if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRulesHotwordRule + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRulesHotwordRule for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesHotwordRuleNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRule(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRuleSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRulesHotwordRule) []InspectTemplateInspectConfigRuleSetRulesHotwordRule { @@ -2833,23 +2884,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRuleHotwordRe if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRulesHotwordRuleHotwordRegex + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRulesHotwordRuleHotwordRegex for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesHotwordRuleHotwordRegexNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRuleHotwordRegex(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRuleHotwordRegexSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRulesHotwordRuleHotwordRegex) []InspectTemplateInspectConfigRuleSetRulesHotwordRuleHotwordRegex { @@ -2951,23 +3005,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRuleProximity if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRulesHotwordRuleProximity + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRulesHotwordRuleProximity for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesHotwordRuleProximityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRuleProximity(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRuleProximitySlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRulesHotwordRuleProximity) []InspectTemplateInspectConfigRuleSetRulesHotwordRuleProximity { @@ -3089,23 +3146,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRuleLikelihoo if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustmentNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustmentSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment) []InspectTemplateInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment { @@ -3238,23 +3298,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleSet(c * if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRulesExclusionRule + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRulesExclusionRule for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesExclusionRuleNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRule(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRulesExclusionRule) []InspectTemplateInspectConfigRuleSetRulesExclusionRule { @@ -3369,23 +3432,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleDiction if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionary + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionary for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionary(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionarySlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionary) []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionary { @@ -3484,23 +3550,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleDiction if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryWordList + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryWordList for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryWordListNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryWordList(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryWordListSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryWordList) []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryWordList { @@ -3599,23 +3668,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleDiction if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePath + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePath for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePathNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePath(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePathSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePath) []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePath { @@ -3720,23 +3792,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleRegexSe if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRulesExclusionRuleRegex + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRulesExclusionRuleRegex for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesExclusionRuleRegexNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleRegex(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleRegexSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRulesExclusionRuleRegex) []InspectTemplateInspectConfigRuleSetRulesExclusionRuleRegex { @@ -3829,23 +3904,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleExclude if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypes) []InspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypes { @@ -3944,23 +4022,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleExclude if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypesSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes) []InspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes { diff --git a/services/google/dlp/beta/job_trigger_internal.go b/services/google/dlp/beta/job_trigger_internal.go index 2234ba7fde..f40f8b773c 100755 --- a/services/google/dlp/beta/job_trigger_internal.go +++ b/services/google/dlp/beta/job_trigger_internal.go @@ -1107,23 +1107,26 @@ func canonicalizeNewJobTriggerInspectJobSet(c *Client, des, nw []JobTriggerInspe if des == nil { return nw } - var reorderedNew []JobTriggerInspectJob + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJob for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJob(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobSlice(c *Client, des, nw []JobTriggerInspectJob) []JobTriggerInspectJob { @@ -1304,23 +1307,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigSet(c *Client, des, nw []Jo if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfig) []JobTriggerInspectJobStorageConfig { @@ -1415,23 +1421,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigDatastoreOptionsSet(c *Clie if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigDatastoreOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigDatastoreOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigDatastoreOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigDatastoreOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigDatastoreOptionsSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigDatastoreOptions) []JobTriggerInspectJobStorageConfigDatastoreOptions { @@ -1536,23 +1545,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigDatastoreOptionsPartitionId if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigDatastoreOptionsPartitionId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigDatastoreOptionsPartitionId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigDatastoreOptionsPartitionIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigDatastoreOptionsPartitionId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigDatastoreOptionsPartitionIdSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigDatastoreOptionsPartitionId) []JobTriggerInspectJobStorageConfigDatastoreOptionsPartitionId { @@ -1651,23 +1663,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigDatastoreOptionsKindSet(c * if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigDatastoreOptionsKind + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigDatastoreOptionsKind for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigDatastoreOptionsKindNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigDatastoreOptionsKind(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigDatastoreOptionsKindSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigDatastoreOptionsKind) []JobTriggerInspectJobStorageConfigDatastoreOptionsKind { @@ -1810,23 +1825,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigCloudStorageOptionsSet(c *C if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigCloudStorageOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigCloudStorageOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigCloudStorageOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigCloudStorageOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigCloudStorageOptionsSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigCloudStorageOptions) []JobTriggerInspectJobStorageConfigCloudStorageOptions { @@ -1947,23 +1965,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigCloudStorageOptionsFileSetS if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigCloudStorageOptionsFileSet + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigCloudStorageOptionsFileSet for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigCloudStorageOptionsFileSetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigCloudStorageOptionsFileSet(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigCloudStorageOptionsFileSetSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigCloudStorageOptionsFileSet) []JobTriggerInspectJobStorageConfigCloudStorageOptionsFileSet { @@ -2076,23 +2097,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigCloudStorageOptionsFileSetR if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigCloudStorageOptionsFileSetRegexFileSet + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigCloudStorageOptionsFileSetRegexFileSet for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigCloudStorageOptionsFileSetRegexFileSetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigCloudStorageOptionsFileSetRegexFileSet(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigCloudStorageOptionsFileSetRegexFileSetSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigCloudStorageOptionsFileSetRegexFileSet) []JobTriggerInspectJobStorageConfigCloudStorageOptionsFileSetRegexFileSet { @@ -2249,23 +2273,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsSet(c *Clien if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigBigQueryOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigBigQueryOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigBigQueryOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigBigQueryOptions) []JobTriggerInspectJobStorageConfigBigQueryOptions { @@ -2373,23 +2400,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsTableReferen if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigBigQueryOptionsTableReference + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigBigQueryOptionsTableReference for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigBigQueryOptionsTableReferenceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsTableReference(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsTableReferenceSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigBigQueryOptionsTableReference) []JobTriggerInspectJobStorageConfigBigQueryOptionsTableReference { @@ -2488,23 +2518,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsIdentifyingF if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigBigQueryOptionsIdentifyingFields + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigBigQueryOptionsIdentifyingFields for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigBigQueryOptionsIdentifyingFieldsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsIdentifyingFields(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsIdentifyingFieldsSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigBigQueryOptionsIdentifyingFields) []JobTriggerInspectJobStorageConfigBigQueryOptionsIdentifyingFields { @@ -2603,23 +2636,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsExcludedFiel if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigBigQueryOptionsExcludedFields + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigBigQueryOptionsExcludedFields for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigBigQueryOptionsExcludedFieldsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsExcludedFields(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsExcludedFieldsSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigBigQueryOptionsExcludedFields) []JobTriggerInspectJobStorageConfigBigQueryOptionsExcludedFields { @@ -2718,23 +2754,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsIncludedFiel if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigBigQueryOptionsIncludedFields + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigBigQueryOptionsIncludedFields for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigBigQueryOptionsIncludedFieldsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsIncludedFields(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsIncludedFieldsSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigBigQueryOptionsIncludedFields) []JobTriggerInspectJobStorageConfigBigQueryOptionsIncludedFields { @@ -2849,23 +2888,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigHybridOptionsSet(c *Client, if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigHybridOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigHybridOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigHybridOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigHybridOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigHybridOptionsSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigHybridOptions) []JobTriggerInspectJobStorageConfigHybridOptions { @@ -2958,23 +3000,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigHybridOptionsTableOptionsSe if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigHybridOptionsTableOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigHybridOptionsTableOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigHybridOptionsTableOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigHybridOptionsTableOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigHybridOptionsTableOptionsSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigHybridOptionsTableOptions) []JobTriggerInspectJobStorageConfigHybridOptionsTableOptions { @@ -3073,23 +3118,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigHybridOptionsTableOptionsId if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigHybridOptionsTableOptionsIdentifyingFields + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigHybridOptionsTableOptionsIdentifyingFields for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigHybridOptionsTableOptionsIdentifyingFieldsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigHybridOptionsTableOptionsIdentifyingFields(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigHybridOptionsTableOptionsIdentifyingFieldsSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigHybridOptionsTableOptionsIdentifyingFields) []JobTriggerInspectJobStorageConfigHybridOptionsTableOptionsIdentifyingFields { @@ -3202,23 +3250,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigTimespanConfigSet(c *Client if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigTimespanConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigTimespanConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigTimespanConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigTimespanConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigTimespanConfigSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigTimespanConfig) []JobTriggerInspectJobStorageConfigTimespanConfig { @@ -3317,23 +3368,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigTimespanConfigTimestampFiel if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigTimespanConfigTimestampField + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigTimespanConfigTimestampField for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigTimespanConfigTimestampFieldNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigTimespanConfigTimestampField(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigTimespanConfigTimestampFieldSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigTimespanConfigTimestampField) []JobTriggerInspectJobStorageConfigTimespanConfigTimestampField { @@ -3454,23 +3508,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigSet(c *Client, des, nw []Jo if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfig) []JobTriggerInspectJobInspectConfig { @@ -3569,23 +3626,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigInfoTypesSet(c *Client, des if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigInfoTypesSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigInfoTypes) []JobTriggerInspectJobInspectConfigInfoTypes { @@ -3690,23 +3750,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigLimitsSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigLimits + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigLimits for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigLimitsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigLimits(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigLimitsSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigLimits) []JobTriggerInspectJobInspectConfigLimits { @@ -3805,23 +3868,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoTyp if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoTypeSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoType) []JobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoType { @@ -3928,23 +3994,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoTyp if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoTypeInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoTypeInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoTypeInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoTypeInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoTypeInfoTypeSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoTypeInfoType) []JobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoTypeInfoType { @@ -4099,23 +4168,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesSet(c *Clien if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypes) []JobTriggerInspectJobInspectConfigCustomInfoTypes { @@ -4222,23 +4294,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesInfoTypeSet( if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesInfoTypeSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesInfoType) []JobTriggerInspectJobInspectConfigCustomInfoTypesInfoType { @@ -4353,23 +4428,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDictionarySe if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionary + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionary for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDictionary(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDictionarySlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionary) []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionary { @@ -4468,23 +4546,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryWo if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryWordList + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryWordList for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryWordListNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryWordList(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryWordListSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryWordList) []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryWordList { @@ -4583,23 +4664,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryCl if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryCloudStoragePath + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryCloudStoragePath for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryCloudStoragePathNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryCloudStoragePath(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryCloudStoragePathSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryCloudStoragePath) []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryCloudStoragePath { @@ -4704,23 +4788,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesRegexSet(c * if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesRegex + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesRegex for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesRegexNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesRegex(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesRegexSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesRegex) []JobTriggerInspectJobInspectConfigCustomInfoTypesRegex { @@ -4808,23 +4895,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesSurrogateTyp if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesSurrogateType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesSurrogateType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesSurrogateTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesSurrogateType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesSurrogateTypeSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesSurrogateType) []JobTriggerInspectJobInspectConfigCustomInfoTypesSurrogateType { @@ -4920,23 +5010,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesStoredTypeSe if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesStoredType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesStoredType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesStoredTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesStoredType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesStoredTypeSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesStoredType) []JobTriggerInspectJobInspectConfigCustomInfoTypesStoredType { @@ -5039,23 +5132,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRul if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRules) []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRules { @@ -5152,23 +5248,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRul if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRule + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRule for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRule(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRule) []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRule { @@ -5273,23 +5372,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRul if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleHotwordRegex + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleHotwordRegex for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleHotwordRegexNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleHotwordRegex(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleHotwordRegexSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleHotwordRegex) []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleHotwordRegex { @@ -5391,23 +5493,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRul if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleProximity + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleProximity for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleProximityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleProximity(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleProximitySlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleProximity) []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleProximity { @@ -5529,23 +5634,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRul if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleLikelihoodAdjustment + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleLikelihoodAdjustment for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleLikelihoodAdjustmentNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleLikelihoodAdjustment(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleLikelihoodAdjustmentSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleLikelihoodAdjustment) []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleLikelihoodAdjustment { @@ -5640,23 +5748,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetSet(c *Client, des, if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSet + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSet for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSet(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSet) []JobTriggerInspectJobInspectConfigRuleSet { @@ -5763,23 +5874,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetInfoTypesSet(c *Clie if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetInfoTypesSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetInfoTypes) []JobTriggerInspectJobInspectConfigRuleSetInfoTypes { @@ -5894,23 +6008,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesSet(c *Client, if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRules) []JobTriggerInspectJobInspectConfigRuleSetRules { @@ -6007,23 +6124,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleSet( if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRule + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRule for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRule(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRule) []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRule { @@ -6128,23 +6248,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleHotw if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleHotwordRegex + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleHotwordRegex for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleHotwordRegexNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleHotwordRegex(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleHotwordRegexSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleHotwordRegex) []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleHotwordRegex { @@ -6246,23 +6369,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleProx if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleProximity + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleProximity for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleProximityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleProximity(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleProximitySlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleProximity) []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleProximity { @@ -6384,23 +6510,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleLike if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustmentNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustmentSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment) []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment { @@ -6533,23 +6662,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleSe if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRule + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRule for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRule(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRule) []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRule { @@ -6664,23 +6796,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDi if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionary + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionary for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionary(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionarySlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionary) []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionary { @@ -6779,23 +6914,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDi if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryWordList + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryWordList for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryWordListNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryWordList(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryWordListSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryWordList) []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryWordList { @@ -6894,23 +7032,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDi if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePath + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePath for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePathNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePath(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePathSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePath) []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePath { @@ -7015,23 +7156,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleRe if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleRegex + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleRegex for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleRegexNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleRegex(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleRegexSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleRegex) []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleRegex { @@ -7124,23 +7268,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleEx if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypes) []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypes { @@ -7247,23 +7394,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleEx if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypesSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes) []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes { @@ -7426,23 +7576,26 @@ func canonicalizeNewJobTriggerInspectJobActionsSet(c *Client, des, nw []JobTrigg if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobActions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobActions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobActionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobActions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobActionsSlice(c *Client, des, nw []JobTriggerInspectJobActions) []JobTriggerInspectJobActions { @@ -7535,23 +7688,26 @@ func canonicalizeNewJobTriggerInspectJobActionsSaveFindingsSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobActionsSaveFindings + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobActionsSaveFindings for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobActionsSaveFindingsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobActionsSaveFindings(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobActionsSaveFindingsSlice(c *Client, des, nw []JobTriggerInspectJobActionsSaveFindings) []JobTriggerInspectJobActionsSaveFindings { @@ -7672,23 +7828,26 @@ func canonicalizeNewJobTriggerInspectJobActionsSaveFindingsOutputConfigSet(c *Cl if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobActionsSaveFindingsOutputConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobActionsSaveFindingsOutputConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobActionsSaveFindingsOutputConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobActionsSaveFindingsOutputConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobActionsSaveFindingsOutputConfigSlice(c *Client, des, nw []JobTriggerInspectJobActionsSaveFindingsOutputConfig) []JobTriggerInspectJobActionsSaveFindingsOutputConfig { @@ -7796,23 +7955,26 @@ func canonicalizeNewJobTriggerInspectJobActionsSaveFindingsOutputConfigTableSet( if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobActionsSaveFindingsOutputConfigTable + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobActionsSaveFindingsOutputConfigTable for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobActionsSaveFindingsOutputConfigTableNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobActionsSaveFindingsOutputConfigTable(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobActionsSaveFindingsOutputConfigTableSlice(c *Client, des, nw []JobTriggerInspectJobActionsSaveFindingsOutputConfigTable) []JobTriggerInspectJobActionsSaveFindingsOutputConfigTable { @@ -7900,23 +8062,26 @@ func canonicalizeNewJobTriggerInspectJobActionsSaveFindingsOutputConfigDlpStorag if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobActionsSaveFindingsOutputConfigDlpStorage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobActionsSaveFindingsOutputConfigDlpStorage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobActionsSaveFindingsOutputConfigDlpStorageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobActionsSaveFindingsOutputConfigDlpStorage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobActionsSaveFindingsOutputConfigDlpStorageSlice(c *Client, des, nw []JobTriggerInspectJobActionsSaveFindingsOutputConfigDlpStorage) []JobTriggerInspectJobActionsSaveFindingsOutputConfigDlpStorage { @@ -8012,23 +8177,26 @@ func canonicalizeNewJobTriggerInspectJobActionsPubSubSet(c *Client, des, nw []Jo if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobActionsPubSub + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobActionsPubSub for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobActionsPubSubNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobActionsPubSub(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobActionsPubSubSlice(c *Client, des, nw []JobTriggerInspectJobActionsPubSub) []JobTriggerInspectJobActionsPubSub { @@ -8116,23 +8284,26 @@ func canonicalizeNewJobTriggerInspectJobActionsPublishSummaryToCsccSet(c *Client if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobActionsPublishSummaryToCscc + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobActionsPublishSummaryToCscc for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobActionsPublishSummaryToCsccNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobActionsPublishSummaryToCscc(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobActionsPublishSummaryToCsccSlice(c *Client, des, nw []JobTriggerInspectJobActionsPublishSummaryToCscc) []JobTriggerInspectJobActionsPublishSummaryToCscc { @@ -8220,23 +8391,26 @@ func canonicalizeNewJobTriggerInspectJobActionsPublishFindingsToCloudDataCatalog if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobActionsPublishFindingsToCloudDataCatalog + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobActionsPublishFindingsToCloudDataCatalog for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobActionsPublishFindingsToCloudDataCatalogNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobActionsPublishFindingsToCloudDataCatalog(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobActionsPublishFindingsToCloudDataCatalogSlice(c *Client, des, nw []JobTriggerInspectJobActionsPublishFindingsToCloudDataCatalog) []JobTriggerInspectJobActionsPublishFindingsToCloudDataCatalog { @@ -8324,23 +8498,26 @@ func canonicalizeNewJobTriggerInspectJobActionsJobNotificationEmailsSet(c *Clien if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobActionsJobNotificationEmails + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobActionsJobNotificationEmails for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobActionsJobNotificationEmailsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobActionsJobNotificationEmails(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobActionsJobNotificationEmailsSlice(c *Client, des, nw []JobTriggerInspectJobActionsJobNotificationEmails) []JobTriggerInspectJobActionsJobNotificationEmails { @@ -8428,23 +8605,26 @@ func canonicalizeNewJobTriggerInspectJobActionsPublishToStackdriverSet(c *Client if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobActionsPublishToStackdriver + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobActionsPublishToStackdriver for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobActionsPublishToStackdriverNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobActionsPublishToStackdriver(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobActionsPublishToStackdriverSlice(c *Client, des, nw []JobTriggerInspectJobActionsPublishToStackdriver) []JobTriggerInspectJobActionsPublishToStackdriver { @@ -8559,23 +8739,26 @@ func canonicalizeNewJobTriggerTriggersSet(c *Client, des, nw []JobTriggerTrigger if des == nil { return nw } - var reorderedNew []JobTriggerTriggers + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerTriggers for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerTriggersNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerTriggers(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerTriggersSlice(c *Client, des, nw []JobTriggerTriggers) []JobTriggerTriggers { @@ -8674,23 +8857,26 @@ func canonicalizeNewJobTriggerTriggersScheduleSet(c *Client, des, nw []JobTrigge if des == nil { return nw } - var reorderedNew []JobTriggerTriggersSchedule + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerTriggersSchedule for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerTriggersScheduleNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerTriggersSchedule(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerTriggersScheduleSlice(c *Client, des, nw []JobTriggerTriggersSchedule) []JobTriggerTriggersSchedule { @@ -8778,23 +8964,26 @@ func canonicalizeNewJobTriggerTriggersManualSet(c *Client, des, nw []JobTriggerT if des == nil { return nw } - var reorderedNew []JobTriggerTriggersManual + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerTriggersManual for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerTriggersManualNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerTriggersManual(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerTriggersManualSlice(c *Client, des, nw []JobTriggerTriggersManual) []JobTriggerTriggersManual { @@ -8893,23 +9082,26 @@ func canonicalizeNewJobTriggerErrorsSet(c *Client, des, nw []JobTriggerErrors) [ if des == nil { return nw } - var reorderedNew []JobTriggerErrors + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerErrors for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerErrorsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerErrors(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerErrorsSlice(c *Client, des, nw []JobTriggerErrors) []JobTriggerErrors { @@ -9016,23 +9208,26 @@ func canonicalizeNewJobTriggerErrorsDetailsSet(c *Client, des, nw []JobTriggerEr if des == nil { return nw } - var reorderedNew []JobTriggerErrorsDetails + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerErrorsDetails for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerErrorsDetailsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerErrorsDetails(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerErrorsDetailsSlice(c *Client, des, nw []JobTriggerErrorsDetails) []JobTriggerErrorsDetails { @@ -9139,23 +9334,26 @@ func canonicalizeNewJobTriggerErrorsDetailsDetailsSet(c *Client, des, nw []JobTr if des == nil { return nw } - var reorderedNew []JobTriggerErrorsDetailsDetails + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerErrorsDetailsDetails for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerErrorsDetailsDetailsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerErrorsDetailsDetails(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerErrorsDetailsDetailsSlice(c *Client, des, nw []JobTriggerErrorsDetailsDetails) []JobTriggerErrorsDetailsDetails { diff --git a/services/google/dlp/beta/stored_info_type_internal.go b/services/google/dlp/beta/stored_info_type_internal.go index 0f8b1cbc05..ba93ef6ba5 100755 --- a/services/google/dlp/beta/stored_info_type_internal.go +++ b/services/google/dlp/beta/stored_info_type_internal.go @@ -743,23 +743,26 @@ func canonicalizeNewStoredInfoTypeLargeCustomDictionarySet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []StoredInfoTypeLargeCustomDictionary + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []StoredInfoTypeLargeCustomDictionary for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareStoredInfoTypeLargeCustomDictionaryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewStoredInfoTypeLargeCustomDictionary(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewStoredInfoTypeLargeCustomDictionarySlice(c *Client, des, nw []StoredInfoTypeLargeCustomDictionary) []StoredInfoTypeLargeCustomDictionary { @@ -858,23 +861,26 @@ func canonicalizeNewStoredInfoTypeLargeCustomDictionaryOutputPathSet(c *Client, if des == nil { return nw } - var reorderedNew []StoredInfoTypeLargeCustomDictionaryOutputPath + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []StoredInfoTypeLargeCustomDictionaryOutputPath for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareStoredInfoTypeLargeCustomDictionaryOutputPathNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewStoredInfoTypeLargeCustomDictionaryOutputPath(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewStoredInfoTypeLargeCustomDictionaryOutputPathSlice(c *Client, des, nw []StoredInfoTypeLargeCustomDictionaryOutputPath) []StoredInfoTypeLargeCustomDictionaryOutputPath { @@ -973,23 +979,26 @@ func canonicalizeNewStoredInfoTypeLargeCustomDictionaryCloudStorageFileSetSet(c if des == nil { return nw } - var reorderedNew []StoredInfoTypeLargeCustomDictionaryCloudStorageFileSet + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []StoredInfoTypeLargeCustomDictionaryCloudStorageFileSet for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareStoredInfoTypeLargeCustomDictionaryCloudStorageFileSetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewStoredInfoTypeLargeCustomDictionaryCloudStorageFileSet(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewStoredInfoTypeLargeCustomDictionaryCloudStorageFileSetSlice(c *Client, des, nw []StoredInfoTypeLargeCustomDictionaryCloudStorageFileSet) []StoredInfoTypeLargeCustomDictionaryCloudStorageFileSet { @@ -1084,23 +1093,26 @@ func canonicalizeNewStoredInfoTypeLargeCustomDictionaryBigQueryFieldSet(c *Clien if des == nil { return nw } - var reorderedNew []StoredInfoTypeLargeCustomDictionaryBigQueryField + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []StoredInfoTypeLargeCustomDictionaryBigQueryField for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareStoredInfoTypeLargeCustomDictionaryBigQueryFieldNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewStoredInfoTypeLargeCustomDictionaryBigQueryField(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewStoredInfoTypeLargeCustomDictionaryBigQueryFieldSlice(c *Client, des, nw []StoredInfoTypeLargeCustomDictionaryBigQueryField) []StoredInfoTypeLargeCustomDictionaryBigQueryField { @@ -1208,23 +1220,26 @@ func canonicalizeNewStoredInfoTypeLargeCustomDictionaryBigQueryFieldTableSet(c * if des == nil { return nw } - var reorderedNew []StoredInfoTypeLargeCustomDictionaryBigQueryFieldTable + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []StoredInfoTypeLargeCustomDictionaryBigQueryFieldTable for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareStoredInfoTypeLargeCustomDictionaryBigQueryFieldTableNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewStoredInfoTypeLargeCustomDictionaryBigQueryFieldTable(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewStoredInfoTypeLargeCustomDictionaryBigQueryFieldTableSlice(c *Client, des, nw []StoredInfoTypeLargeCustomDictionaryBigQueryFieldTable) []StoredInfoTypeLargeCustomDictionaryBigQueryFieldTable { @@ -1323,23 +1338,26 @@ func canonicalizeNewStoredInfoTypeLargeCustomDictionaryBigQueryFieldFieldSet(c * if des == nil { return nw } - var reorderedNew []StoredInfoTypeLargeCustomDictionaryBigQueryFieldField + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []StoredInfoTypeLargeCustomDictionaryBigQueryFieldField for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareStoredInfoTypeLargeCustomDictionaryBigQueryFieldFieldNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewStoredInfoTypeLargeCustomDictionaryBigQueryFieldField(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewStoredInfoTypeLargeCustomDictionaryBigQueryFieldFieldSlice(c *Client, des, nw []StoredInfoTypeLargeCustomDictionaryBigQueryFieldField) []StoredInfoTypeLargeCustomDictionaryBigQueryFieldField { @@ -1454,23 +1472,26 @@ func canonicalizeNewStoredInfoTypeDictionarySet(c *Client, des, nw []StoredInfoT if des == nil { return nw } - var reorderedNew []StoredInfoTypeDictionary + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []StoredInfoTypeDictionary for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareStoredInfoTypeDictionaryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewStoredInfoTypeDictionary(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewStoredInfoTypeDictionarySlice(c *Client, des, nw []StoredInfoTypeDictionary) []StoredInfoTypeDictionary { @@ -1569,23 +1590,26 @@ func canonicalizeNewStoredInfoTypeDictionaryWordListSet(c *Client, des, nw []Sto if des == nil { return nw } - var reorderedNew []StoredInfoTypeDictionaryWordList + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []StoredInfoTypeDictionaryWordList for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareStoredInfoTypeDictionaryWordListNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewStoredInfoTypeDictionaryWordList(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewStoredInfoTypeDictionaryWordListSlice(c *Client, des, nw []StoredInfoTypeDictionaryWordList) []StoredInfoTypeDictionaryWordList { @@ -1684,23 +1708,26 @@ func canonicalizeNewStoredInfoTypeDictionaryCloudStoragePathSet(c *Client, des, if des == nil { return nw } - var reorderedNew []StoredInfoTypeDictionaryCloudStoragePath + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []StoredInfoTypeDictionaryCloudStoragePath for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareStoredInfoTypeDictionaryCloudStoragePathNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewStoredInfoTypeDictionaryCloudStoragePath(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewStoredInfoTypeDictionaryCloudStoragePathSlice(c *Client, des, nw []StoredInfoTypeDictionaryCloudStoragePath) []StoredInfoTypeDictionaryCloudStoragePath { @@ -1805,23 +1832,26 @@ func canonicalizeNewStoredInfoTypeRegexSet(c *Client, des, nw []StoredInfoTypeRe if des == nil { return nw } - var reorderedNew []StoredInfoTypeRegex + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []StoredInfoTypeRegex for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareStoredInfoTypeRegexNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewStoredInfoTypeRegex(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewStoredInfoTypeRegexSlice(c *Client, des, nw []StoredInfoTypeRegex) []StoredInfoTypeRegex { diff --git a/services/google/dlp/deidentify_template_internal.go b/services/google/dlp/deidentify_template_internal.go index 66cadf11fe..f73e58c9f5 100755 --- a/services/google/dlp/deidentify_template_internal.go +++ b/services/google/dlp/deidentify_template_internal.go @@ -2388,23 +2388,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigSet(c *Client, des, nw []D if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfig) []DeidentifyTemplateDeidentifyConfig { @@ -2497,23 +2500,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsSet if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformations) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformations { @@ -2608,23 +2614,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformations) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformations { @@ -2723,23 +2732,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsInfoTypesSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsInfoTypes) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsInfoTypes { @@ -2962,23 +2974,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformation) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformation { @@ -3071,23 +3086,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfig) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfig { @@ -3302,23 +3320,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValue { @@ -3432,23 +3453,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue { @@ -3556,23 +3580,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue { @@ -3660,23 +3687,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfig) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfig { @@ -3791,23 +3821,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfig) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfig { @@ -3932,23 +3965,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnoreNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnoreSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore { @@ -4095,23 +4131,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig { @@ -4238,23 +4277,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey { @@ -4353,23 +4395,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient { @@ -4468,23 +4513,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped { @@ -4589,23 +4637,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped { @@ -4704,23 +4755,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContextSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext { @@ -4819,23 +4873,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoTypeSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType { @@ -4936,23 +4993,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfig) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfig { @@ -5167,23 +5227,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound { @@ -5297,23 +5360,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue { @@ -5421,23 +5487,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue { @@ -5652,23 +5721,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound { @@ -5782,23 +5854,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue { @@ -5906,23 +5981,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue { @@ -6015,23 +6093,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfig) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfig { @@ -6128,23 +6209,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBuckets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBuckets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBuckets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBuckets) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBuckets { @@ -6359,23 +6443,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMin + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMin for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMin(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMin) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMin { @@ -6489,23 +6576,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue { @@ -6613,23 +6703,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue { @@ -6844,23 +6937,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMax + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMax for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMax(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMax) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMax { @@ -6974,23 +7070,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue { @@ -7098,23 +7197,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue { @@ -7329,23 +7431,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue { @@ -7459,23 +7564,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue { @@ -7583,23 +7691,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue { @@ -7687,23 +7798,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig { @@ -7799,23 +7913,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfig) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfig { @@ -7908,23 +8025,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfig) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfig { @@ -8051,23 +8171,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey { @@ -8166,23 +8289,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient { @@ -8281,23 +8407,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped { @@ -8402,23 +8531,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped { @@ -8535,23 +8667,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfig) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfig { @@ -8650,23 +8785,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContext + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContext for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContext(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContextSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContext) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContext { @@ -8793,23 +8931,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKey { @@ -8908,23 +9049,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient { @@ -9023,23 +9167,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped { @@ -9144,23 +9291,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped { @@ -9257,23 +9407,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfig) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfig { @@ -9400,23 +9553,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey { @@ -9515,23 +9671,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient { @@ -9630,23 +9789,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped { @@ -9751,23 +9913,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped { @@ -9866,23 +10031,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoTypeSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType { @@ -9981,23 +10149,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTra if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContext + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContext for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContext(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContextSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContext) []DeidentifyTemplateDeidentifyConfigInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContext { @@ -10092,23 +10263,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsSet(c if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformations) []DeidentifyTemplateDeidentifyConfigRecordTransformations { @@ -10227,23 +10401,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformations) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformations { @@ -10342,23 +10519,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsFields + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsFields for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsFieldsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsFields(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsFieldsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsFields) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsFields { @@ -10451,23 +10631,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsCondition + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsCondition for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsCondition(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsCondition) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsCondition { @@ -10576,23 +10759,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressions) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressions { @@ -10685,23 +10871,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditions) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditions { @@ -10802,23 +10991,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditions) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditions { @@ -10917,23 +11109,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsField + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsField for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsFieldNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsField(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsFieldSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsField) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsField { @@ -11148,23 +11343,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValue { @@ -11278,23 +11476,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueTimeValue { @@ -11402,23 +11603,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsConditionExpressionsConditionsConditionsValueDateValue { @@ -11641,23 +11845,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformation) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformation { @@ -11750,23 +11957,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfig { @@ -11981,23 +12191,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValue { @@ -12111,23 +12324,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue { @@ -12235,23 +12451,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue { @@ -12339,23 +12558,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationRedactConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationRedactConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationRedactConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationRedactConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationRedactConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationRedactConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationRedactConfig { @@ -12470,23 +12692,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfig { @@ -12611,23 +12836,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnoreNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnoreSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore { @@ -12774,23 +13002,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig { @@ -12917,23 +13148,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey { @@ -13032,23 +13266,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient { @@ -13147,23 +13384,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped { @@ -13268,23 +13508,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped { @@ -13383,23 +13626,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContextSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext { @@ -13498,23 +13744,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoTypeSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType { @@ -13615,23 +13864,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfig { @@ -13846,23 +14098,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound { @@ -13976,23 +14231,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue - for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue + for _, d := range des { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue { @@ -14100,23 +14358,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue { @@ -14331,23 +14592,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound { @@ -14461,23 +14725,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue { @@ -14585,23 +14852,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue { @@ -14694,23 +14964,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfig { @@ -14807,23 +15080,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBuckets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBuckets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBuckets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBuckets) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBuckets { @@ -15038,23 +15314,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMin + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMin for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMin(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMin) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMin { @@ -15168,23 +15447,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue { @@ -15292,23 +15574,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue { @@ -15523,23 +15808,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMax + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMax for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMax(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMax) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMax { @@ -15653,23 +15941,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue { @@ -15777,23 +16068,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue { @@ -16008,23 +16302,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue { @@ -16138,23 +16435,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue { @@ -16262,23 +16562,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue { @@ -16366,23 +16669,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceWithInfoTypeConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceWithInfoTypeConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig { @@ -16478,23 +16784,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationTimePartConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationTimePartConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationTimePartConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationTimePartConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationTimePartConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationTimePartConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationTimePartConfig { @@ -16587,23 +16896,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfig { @@ -16730,23 +17042,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey { @@ -16845,23 +17160,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient { @@ -16960,23 +17278,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped { @@ -17081,23 +17402,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped { @@ -17214,23 +17538,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfig { @@ -17329,23 +17656,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigContext + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigContext for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigContextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigContext(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigContextSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigContext) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigContext { @@ -17472,23 +17802,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKey { @@ -17587,23 +17920,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient { @@ -17702,23 +18038,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped { @@ -17823,23 +18162,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped { @@ -17936,23 +18278,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfig { @@ -18079,23 +18424,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey { @@ -18194,23 +18542,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient { @@ -18309,23 +18660,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped { @@ -18430,23 +18784,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped { @@ -18545,23 +18902,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoTypeSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType { @@ -18660,23 +19020,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigContext + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigContext for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigContextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigContext(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigContextSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigContext) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsPrimitiveTransformationCryptoDeterministicConfigContext { @@ -18769,23 +19132,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformations) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformations { @@ -18880,23 +19246,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformations) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformations { @@ -18995,23 +19364,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsInfoTypesSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsInfoTypes) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsInfoTypes { @@ -19234,23 +19606,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformation) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformation { @@ -19343,23 +19718,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfig { @@ -19574,23 +19952,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValue { @@ -19704,23 +20085,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueTimeValue { @@ -19828,23 +20212,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceConfigNewValueDateValue { @@ -19932,23 +20319,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationRedactConfig { @@ -20063,23 +20453,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfig { @@ -20204,23 +20597,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnoreNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnoreSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCharacterMaskConfigCharactersToIgnore { @@ -20367,23 +20763,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfig { @@ -20510,23 +20909,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKey { @@ -20625,23 +21027,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyTransient { @@ -20740,23 +21145,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyUnwrapped { @@ -20861,23 +21269,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigCryptoKeyKmsWrapped { @@ -20976,23 +21387,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContextSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigContext { @@ -21091,23 +21505,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoTypeSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoReplaceFfxFpeConfigSurrogateInfoType { @@ -21208,23 +21625,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfig { @@ -21439,23 +21859,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBound { @@ -21569,23 +21992,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundTimeValue { @@ -21693,23 +22119,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigLowerBoundDateValue { @@ -21924,23 +22353,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBound { @@ -22054,23 +22486,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundTimeValue { @@ -22178,23 +22613,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationFixedSizeBucketingConfigUpperBoundDateValue { @@ -22287,23 +22725,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfig { @@ -22400,23 +22841,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBuckets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBuckets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBuckets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBuckets) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBuckets { @@ -22631,23 +23075,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMin + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMin for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMin(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMin) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMin { @@ -22761,23 +23208,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinTimeValue { @@ -22885,23 +23335,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMinDateValue { @@ -23116,23 +23569,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMax + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMax for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMax(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMax) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMax { @@ -23246,23 +23702,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxTimeValue { @@ -23370,23 +23829,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsMaxDateValue { @@ -23601,23 +24063,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValue { @@ -23731,23 +24196,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueTimeValue { @@ -23855,23 +24323,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationBucketingConfigBucketsReplacementValueDateValue { @@ -23959,23 +24430,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationReplaceWithInfoTypeConfig { @@ -24071,23 +24545,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationTimePartConfig { @@ -24180,23 +24657,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfig { @@ -24323,23 +24803,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKey { @@ -24438,23 +24921,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyTransient { @@ -24553,23 +25039,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyUnwrapped { @@ -24674,23 +25163,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoHashConfigCryptoKeyKmsWrapped { @@ -24807,23 +25299,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfig { @@ -24922,23 +25417,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContext + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContext for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContext(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContextSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContext) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigContext { @@ -25065,23 +25563,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKey { @@ -25180,23 +25681,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyTransient { @@ -25295,23 +25799,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyUnwrapped { @@ -25416,23 +25923,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationDateShiftConfigCryptoKeyKmsWrapped { @@ -25529,23 +26039,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfig) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfig { @@ -25672,23 +26185,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeySlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKey { @@ -25787,23 +26303,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransientSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyTransient { @@ -25902,23 +26421,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyUnwrapped { @@ -26023,23 +26545,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrappedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrappedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigCryptoKeyKmsWrapped { @@ -26138,23 +26663,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoTypeSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigSurrogateInfoType { @@ -26253,23 +26781,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsField if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContext + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContext for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContext(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContextSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContext) []DeidentifyTemplateDeidentifyConfigRecordTransformationsFieldTransformationsInfoTypeTransformationsTransformationsPrimitiveTransformationCryptoDeterministicConfigContext { @@ -26362,23 +26893,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecor if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressions) []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressions { @@ -26471,23 +27005,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecor if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsCondition + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsCondition for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsCondition(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsCondition) []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsCondition { @@ -26596,23 +27133,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecor if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressions) []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressions { @@ -26705,23 +27245,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecor if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditions) []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditions { @@ -26822,23 +27365,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecor if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditions) []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditions { @@ -26937,23 +27483,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecor if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsField + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsField for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsFieldNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsField(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsFieldSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsField) []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsField { @@ -27168,23 +27717,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecor if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValue { @@ -27298,23 +27850,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecor if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueTimeValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueTimeValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueTimeValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueTimeValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueTimeValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueTimeValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueTimeValue { @@ -27422,23 +27977,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecor if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueDateValue + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueDateValue for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueDateValueNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueDateValue(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueDateValueSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueDateValue) []DeidentifyTemplateDeidentifyConfigRecordTransformationsRecordSuppressionsConditionExpressionsConditionsConditionsValueDateValue { @@ -27553,23 +28111,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigTransformationErrorHandlin if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigTransformationErrorHandling + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigTransformationErrorHandling for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigTransformationErrorHandlingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigTransformationErrorHandling(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigTransformationErrorHandlingSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigTransformationErrorHandling) []DeidentifyTemplateDeidentifyConfigTransformationErrorHandling { @@ -27657,23 +28218,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigTransformationErrorHandlin if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigTransformationErrorHandlingThrowError + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigTransformationErrorHandlingThrowError for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigTransformationErrorHandlingThrowErrorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigTransformationErrorHandlingThrowError(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigTransformationErrorHandlingThrowErrorSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigTransformationErrorHandlingThrowError) []DeidentifyTemplateDeidentifyConfigTransformationErrorHandlingThrowError { @@ -27761,23 +28325,26 @@ func canonicalizeNewDeidentifyTemplateDeidentifyConfigTransformationErrorHandlin if des == nil { return nw } - var reorderedNew []DeidentifyTemplateDeidentifyConfigTransformationErrorHandlingLeaveUntransformed + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DeidentifyTemplateDeidentifyConfigTransformationErrorHandlingLeaveUntransformed for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDeidentifyTemplateDeidentifyConfigTransformationErrorHandlingLeaveUntransformedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDeidentifyTemplateDeidentifyConfigTransformationErrorHandlingLeaveUntransformed(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDeidentifyTemplateDeidentifyConfigTransformationErrorHandlingLeaveUntransformedSlice(c *Client, des, nw []DeidentifyTemplateDeidentifyConfigTransformationErrorHandlingLeaveUntransformed) []DeidentifyTemplateDeidentifyConfigTransformationErrorHandlingLeaveUntransformed { diff --git a/services/google/dlp/inspect_template_internal.go b/services/google/dlp/inspect_template_internal.go index 714a43f2ab..583f665ab0 100755 --- a/services/google/dlp/inspect_template_internal.go +++ b/services/google/dlp/inspect_template_internal.go @@ -794,23 +794,26 @@ func canonicalizeNewInspectTemplateInspectConfigSet(c *Client, des, nw []Inspect if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigSlice(c *Client, des, nw []InspectTemplateInspectConfig) []InspectTemplateInspectConfig { @@ -909,23 +912,26 @@ func canonicalizeNewInspectTemplateInspectConfigInfoTypesSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigInfoTypesSlice(c *Client, des, nw []InspectTemplateInspectConfigInfoTypes) []InspectTemplateInspectConfigInfoTypes { @@ -1030,23 +1036,26 @@ func canonicalizeNewInspectTemplateInspectConfigLimitsSet(c *Client, des, nw []I if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigLimits + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigLimits for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigLimitsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigLimits(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigLimitsSlice(c *Client, des, nw []InspectTemplateInspectConfigLimits) []InspectTemplateInspectConfigLimits { @@ -1145,23 +1154,26 @@ func canonicalizeNewInspectTemplateInspectConfigLimitsMaxFindingsPerInfoTypeSet( if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigLimitsMaxFindingsPerInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigLimitsMaxFindingsPerInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigLimitsMaxFindingsPerInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigLimitsMaxFindingsPerInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigLimitsMaxFindingsPerInfoTypeSlice(c *Client, des, nw []InspectTemplateInspectConfigLimitsMaxFindingsPerInfoType) []InspectTemplateInspectConfigLimitsMaxFindingsPerInfoType { @@ -1260,23 +1272,26 @@ func canonicalizeNewInspectTemplateInspectConfigLimitsMaxFindingsPerInfoTypeInfo if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigLimitsMaxFindingsPerInfoTypeInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigLimitsMaxFindingsPerInfoTypeInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigLimitsMaxFindingsPerInfoTypeInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigLimitsMaxFindingsPerInfoTypeInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigLimitsMaxFindingsPerInfoTypeInfoTypeSlice(c *Client, des, nw []InspectTemplateInspectConfigLimitsMaxFindingsPerInfoTypeInfoType) []InspectTemplateInspectConfigLimitsMaxFindingsPerInfoTypeInfoType { @@ -1429,23 +1444,26 @@ func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesSet(c *Client, de if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigCustomInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigCustomInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigCustomInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigCustomInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesSlice(c *Client, des, nw []InspectTemplateInspectConfigCustomInfoTypes) []InspectTemplateInspectConfigCustomInfoTypes { @@ -1544,23 +1562,26 @@ func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesInfoTypeSet(c *Cl if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigCustomInfoTypesInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigCustomInfoTypesInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigCustomInfoTypesInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesInfoTypeSlice(c *Client, des, nw []InspectTemplateInspectConfigCustomInfoTypesInfoType) []InspectTemplateInspectConfigCustomInfoTypesInfoType { @@ -1675,23 +1696,26 @@ func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesDictionarySet(c * if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigCustomInfoTypesDictionary + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigCustomInfoTypesDictionary for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigCustomInfoTypesDictionaryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesDictionary(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesDictionarySlice(c *Client, des, nw []InspectTemplateInspectConfigCustomInfoTypesDictionary) []InspectTemplateInspectConfigCustomInfoTypesDictionary { @@ -1790,23 +1814,26 @@ func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesDictionaryWordLis if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigCustomInfoTypesDictionaryWordList + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigCustomInfoTypesDictionaryWordList for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigCustomInfoTypesDictionaryWordListNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesDictionaryWordList(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesDictionaryWordListSlice(c *Client, des, nw []InspectTemplateInspectConfigCustomInfoTypesDictionaryWordList) []InspectTemplateInspectConfigCustomInfoTypesDictionaryWordList { @@ -1905,23 +1932,26 @@ func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesDictionaryCloudSt if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigCustomInfoTypesDictionaryCloudStoragePath + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigCustomInfoTypesDictionaryCloudStoragePath for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigCustomInfoTypesDictionaryCloudStoragePathNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesDictionaryCloudStoragePath(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesDictionaryCloudStoragePathSlice(c *Client, des, nw []InspectTemplateInspectConfigCustomInfoTypesDictionaryCloudStoragePath) []InspectTemplateInspectConfigCustomInfoTypesDictionaryCloudStoragePath { @@ -2026,23 +2056,26 @@ func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesRegexSet(c *Clien if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigCustomInfoTypesRegex + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigCustomInfoTypesRegex for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigCustomInfoTypesRegexNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesRegex(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesRegexSlice(c *Client, des, nw []InspectTemplateInspectConfigCustomInfoTypesRegex) []InspectTemplateInspectConfigCustomInfoTypesRegex { @@ -2130,23 +2163,26 @@ func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesSurrogateTypeSet( if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigCustomInfoTypesSurrogateType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigCustomInfoTypesSurrogateType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigCustomInfoTypesSurrogateTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesSurrogateType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesSurrogateTypeSlice(c *Client, des, nw []InspectTemplateInspectConfigCustomInfoTypesSurrogateType) []InspectTemplateInspectConfigCustomInfoTypesSurrogateType { @@ -2242,23 +2278,26 @@ func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesStoredTypeSet(c * if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigCustomInfoTypesStoredType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigCustomInfoTypesStoredType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigCustomInfoTypesStoredTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesStoredType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigCustomInfoTypesStoredTypeSlice(c *Client, des, nw []InspectTemplateInspectConfigCustomInfoTypesStoredType) []InspectTemplateInspectConfigCustomInfoTypesStoredType { @@ -2353,23 +2392,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSet + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSet for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSet(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSet) []InspectTemplateInspectConfigRuleSet { @@ -2468,23 +2510,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetInfoTypesSet(c *Client, d if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetInfoTypesSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetInfoTypes) []InspectTemplateInspectConfigRuleSetInfoTypes { @@ -2599,23 +2644,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesSet(c *Client, des, if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRules) []InspectTemplateInspectConfigRuleSetRules { @@ -2712,23 +2760,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRuleSet(c *Cl if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRulesHotwordRule + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRulesHotwordRule for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesHotwordRuleNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRule(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRuleSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRulesHotwordRule) []InspectTemplateInspectConfigRuleSetRulesHotwordRule { @@ -2833,23 +2884,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRuleHotwordRe if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRulesHotwordRuleHotwordRegex + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRulesHotwordRuleHotwordRegex for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesHotwordRuleHotwordRegexNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRuleHotwordRegex(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRuleHotwordRegexSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRulesHotwordRuleHotwordRegex) []InspectTemplateInspectConfigRuleSetRulesHotwordRuleHotwordRegex { @@ -2951,23 +3005,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRuleProximity if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRulesHotwordRuleProximity + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRulesHotwordRuleProximity for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesHotwordRuleProximityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRuleProximity(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRuleProximitySlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRulesHotwordRuleProximity) []InspectTemplateInspectConfigRuleSetRulesHotwordRuleProximity { @@ -3089,23 +3146,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRuleLikelihoo if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustmentNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustmentSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment) []InspectTemplateInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment { @@ -3238,23 +3298,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleSet(c * if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRulesExclusionRule + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRulesExclusionRule for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesExclusionRuleNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRule(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRulesExclusionRule) []InspectTemplateInspectConfigRuleSetRulesExclusionRule { @@ -3369,23 +3432,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleDiction if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionary + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionary for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionary(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionarySlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionary) []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionary { @@ -3484,23 +3550,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleDiction if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryWordList + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryWordList for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryWordListNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryWordList(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryWordListSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryWordList) []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryWordList { @@ -3599,23 +3668,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleDiction if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePath + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePath for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePathNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePath(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePathSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePath) []InspectTemplateInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePath { @@ -3720,23 +3792,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleRegexSe if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRulesExclusionRuleRegex + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRulesExclusionRuleRegex for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesExclusionRuleRegexNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleRegex(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleRegexSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRulesExclusionRuleRegex) []InspectTemplateInspectConfigRuleSetRulesExclusionRuleRegex { @@ -3829,23 +3904,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleExclude if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypes) []InspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypes { @@ -3944,23 +4022,26 @@ func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleExclude if des == nil { return nw } - var reorderedNew []InspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypesSlice(c *Client, des, nw []InspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes) []InspectTemplateInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes { diff --git a/services/google/dlp/job_trigger_internal.go b/services/google/dlp/job_trigger_internal.go index 5e8a5bcd8d..77d727e3e4 100755 --- a/services/google/dlp/job_trigger_internal.go +++ b/services/google/dlp/job_trigger_internal.go @@ -1107,23 +1107,26 @@ func canonicalizeNewJobTriggerInspectJobSet(c *Client, des, nw []JobTriggerInspe if des == nil { return nw } - var reorderedNew []JobTriggerInspectJob + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJob for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJob(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobSlice(c *Client, des, nw []JobTriggerInspectJob) []JobTriggerInspectJob { @@ -1304,23 +1307,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigSet(c *Client, des, nw []Jo if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfig) []JobTriggerInspectJobStorageConfig { @@ -1415,23 +1421,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigDatastoreOptionsSet(c *Clie if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigDatastoreOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigDatastoreOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigDatastoreOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigDatastoreOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigDatastoreOptionsSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigDatastoreOptions) []JobTriggerInspectJobStorageConfigDatastoreOptions { @@ -1536,23 +1545,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigDatastoreOptionsPartitionId if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigDatastoreOptionsPartitionId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigDatastoreOptionsPartitionId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigDatastoreOptionsPartitionIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigDatastoreOptionsPartitionId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigDatastoreOptionsPartitionIdSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigDatastoreOptionsPartitionId) []JobTriggerInspectJobStorageConfigDatastoreOptionsPartitionId { @@ -1651,23 +1663,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigDatastoreOptionsKindSet(c * if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigDatastoreOptionsKind + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigDatastoreOptionsKind for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigDatastoreOptionsKindNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigDatastoreOptionsKind(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigDatastoreOptionsKindSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigDatastoreOptionsKind) []JobTriggerInspectJobStorageConfigDatastoreOptionsKind { @@ -1810,23 +1825,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigCloudStorageOptionsSet(c *C if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigCloudStorageOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigCloudStorageOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigCloudStorageOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigCloudStorageOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigCloudStorageOptionsSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigCloudStorageOptions) []JobTriggerInspectJobStorageConfigCloudStorageOptions { @@ -1947,23 +1965,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigCloudStorageOptionsFileSetS if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigCloudStorageOptionsFileSet + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigCloudStorageOptionsFileSet for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigCloudStorageOptionsFileSetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigCloudStorageOptionsFileSet(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigCloudStorageOptionsFileSetSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigCloudStorageOptionsFileSet) []JobTriggerInspectJobStorageConfigCloudStorageOptionsFileSet { @@ -2076,23 +2097,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigCloudStorageOptionsFileSetR if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigCloudStorageOptionsFileSetRegexFileSet + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigCloudStorageOptionsFileSetRegexFileSet for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigCloudStorageOptionsFileSetRegexFileSetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigCloudStorageOptionsFileSetRegexFileSet(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigCloudStorageOptionsFileSetRegexFileSetSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigCloudStorageOptionsFileSetRegexFileSet) []JobTriggerInspectJobStorageConfigCloudStorageOptionsFileSetRegexFileSet { @@ -2249,23 +2273,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsSet(c *Clien if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigBigQueryOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigBigQueryOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigBigQueryOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigBigQueryOptions) []JobTriggerInspectJobStorageConfigBigQueryOptions { @@ -2373,23 +2400,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsTableReferen if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigBigQueryOptionsTableReference + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigBigQueryOptionsTableReference for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigBigQueryOptionsTableReferenceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsTableReference(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsTableReferenceSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigBigQueryOptionsTableReference) []JobTriggerInspectJobStorageConfigBigQueryOptionsTableReference { @@ -2488,23 +2518,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsIdentifyingF if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigBigQueryOptionsIdentifyingFields + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigBigQueryOptionsIdentifyingFields for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigBigQueryOptionsIdentifyingFieldsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsIdentifyingFields(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsIdentifyingFieldsSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigBigQueryOptionsIdentifyingFields) []JobTriggerInspectJobStorageConfigBigQueryOptionsIdentifyingFields { @@ -2603,23 +2636,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsExcludedFiel if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigBigQueryOptionsExcludedFields + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigBigQueryOptionsExcludedFields for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigBigQueryOptionsExcludedFieldsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsExcludedFields(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsExcludedFieldsSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigBigQueryOptionsExcludedFields) []JobTriggerInspectJobStorageConfigBigQueryOptionsExcludedFields { @@ -2718,23 +2754,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsIncludedFiel if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigBigQueryOptionsIncludedFields + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigBigQueryOptionsIncludedFields for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigBigQueryOptionsIncludedFieldsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsIncludedFields(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigBigQueryOptionsIncludedFieldsSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigBigQueryOptionsIncludedFields) []JobTriggerInspectJobStorageConfigBigQueryOptionsIncludedFields { @@ -2849,23 +2888,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigHybridOptionsSet(c *Client, if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigHybridOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigHybridOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigHybridOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigHybridOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigHybridOptionsSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigHybridOptions) []JobTriggerInspectJobStorageConfigHybridOptions { @@ -2958,23 +3000,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigHybridOptionsTableOptionsSe if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigHybridOptionsTableOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigHybridOptionsTableOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigHybridOptionsTableOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigHybridOptionsTableOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigHybridOptionsTableOptionsSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigHybridOptionsTableOptions) []JobTriggerInspectJobStorageConfigHybridOptionsTableOptions { @@ -3073,23 +3118,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigHybridOptionsTableOptionsId if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigHybridOptionsTableOptionsIdentifyingFields + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigHybridOptionsTableOptionsIdentifyingFields for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigHybridOptionsTableOptionsIdentifyingFieldsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigHybridOptionsTableOptionsIdentifyingFields(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigHybridOptionsTableOptionsIdentifyingFieldsSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigHybridOptionsTableOptionsIdentifyingFields) []JobTriggerInspectJobStorageConfigHybridOptionsTableOptionsIdentifyingFields { @@ -3202,23 +3250,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigTimespanConfigSet(c *Client if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigTimespanConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigTimespanConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigTimespanConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigTimespanConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigTimespanConfigSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigTimespanConfig) []JobTriggerInspectJobStorageConfigTimespanConfig { @@ -3317,23 +3368,26 @@ func canonicalizeNewJobTriggerInspectJobStorageConfigTimespanConfigTimestampFiel if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobStorageConfigTimespanConfigTimestampField + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobStorageConfigTimespanConfigTimestampField for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobStorageConfigTimespanConfigTimestampFieldNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobStorageConfigTimespanConfigTimestampField(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobStorageConfigTimespanConfigTimestampFieldSlice(c *Client, des, nw []JobTriggerInspectJobStorageConfigTimespanConfigTimestampField) []JobTriggerInspectJobStorageConfigTimespanConfigTimestampField { @@ -3454,23 +3508,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigSet(c *Client, des, nw []Jo if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfig) []JobTriggerInspectJobInspectConfig { @@ -3569,23 +3626,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigInfoTypesSet(c *Client, des if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigInfoTypesSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigInfoTypes) []JobTriggerInspectJobInspectConfigInfoTypes { @@ -3690,23 +3750,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigLimitsSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigLimits + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigLimits for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigLimitsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigLimits(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigLimitsSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigLimits) []JobTriggerInspectJobInspectConfigLimits { @@ -3805,23 +3868,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoTyp if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoTypeSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoType) []JobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoType { @@ -3928,23 +3994,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoTyp if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoTypeInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoTypeInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoTypeInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoTypeInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoTypeInfoTypeSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoTypeInfoType) []JobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoTypeInfoType { @@ -4099,23 +4168,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesSet(c *Clien if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypes) []JobTriggerInspectJobInspectConfigCustomInfoTypes { @@ -4222,23 +4294,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesInfoTypeSet( if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesInfoType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesInfoType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesInfoTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesInfoType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesInfoTypeSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesInfoType) []JobTriggerInspectJobInspectConfigCustomInfoTypesInfoType { @@ -4353,23 +4428,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDictionarySe if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionary + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionary for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDictionary(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDictionarySlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionary) []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionary { @@ -4468,23 +4546,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryWo if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryWordList + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryWordList for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryWordListNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryWordList(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryWordListSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryWordList) []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryWordList { @@ -4583,23 +4664,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryCl if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryCloudStoragePath + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryCloudStoragePath for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryCloudStoragePathNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryCloudStoragePath(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryCloudStoragePathSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryCloudStoragePath) []JobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryCloudStoragePath { @@ -4704,23 +4788,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesRegexSet(c * if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesRegex + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesRegex for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesRegexNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesRegex(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesRegexSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesRegex) []JobTriggerInspectJobInspectConfigCustomInfoTypesRegex { @@ -4808,23 +4895,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesSurrogateTyp if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesSurrogateType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesSurrogateType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesSurrogateTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesSurrogateType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesSurrogateTypeSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesSurrogateType) []JobTriggerInspectJobInspectConfigCustomInfoTypesSurrogateType { @@ -4920,23 +5010,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesStoredTypeSe if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesStoredType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesStoredType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesStoredTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesStoredType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesStoredTypeSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesStoredType) []JobTriggerInspectJobInspectConfigCustomInfoTypesStoredType { @@ -5039,23 +5132,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRul if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRules) []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRules { @@ -5152,23 +5248,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRul if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRule + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRule for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRule(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRule) []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRule { @@ -5273,23 +5372,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRul if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleHotwordRegex + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleHotwordRegex for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleHotwordRegexNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleHotwordRegex(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleHotwordRegexSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleHotwordRegex) []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleHotwordRegex { @@ -5391,23 +5493,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRul if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleProximity + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleProximity for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleProximityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleProximity(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleProximitySlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleProximity) []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleProximity { @@ -5529,23 +5634,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRul if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleLikelihoodAdjustment + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleLikelihoodAdjustment for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleLikelihoodAdjustmentNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleLikelihoodAdjustment(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleLikelihoodAdjustmentSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleLikelihoodAdjustment) []JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleLikelihoodAdjustment { @@ -5640,23 +5748,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetSet(c *Client, des, if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSet + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSet for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSet(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSet) []JobTriggerInspectJobInspectConfigRuleSet { @@ -5763,23 +5874,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetInfoTypesSet(c *Clie if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetInfoTypesSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetInfoTypes) []JobTriggerInspectJobInspectConfigRuleSetInfoTypes { @@ -5894,23 +6008,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesSet(c *Client, if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRules) []JobTriggerInspectJobInspectConfigRuleSetRules { @@ -6007,23 +6124,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleSet( if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRule + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRule for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRule(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRule) []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRule { @@ -6128,23 +6248,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleHotw if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleHotwordRegex + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleHotwordRegex for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleHotwordRegexNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleHotwordRegex(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleHotwordRegexSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleHotwordRegex) []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleHotwordRegex { @@ -6246,23 +6369,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleProx if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleProximity + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleProximity for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleProximityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleProximity(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleProximitySlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleProximity) []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleProximity { @@ -6384,23 +6510,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleLike if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustmentNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustmentSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment) []JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment { @@ -6533,23 +6662,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleSe if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRule + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRule for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRule(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRule) []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRule { @@ -6664,23 +6796,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDi if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionary + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionary for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionary(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionarySlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionary) []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionary { @@ -6779,23 +6914,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDi if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryWordList + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryWordList for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryWordListNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryWordList(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryWordListSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryWordList) []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryWordList { @@ -6894,23 +7032,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDi if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePath + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePath for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePathNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePath(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePathSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePath) []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePath { @@ -7015,23 +7156,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleRe if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleRegex + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleRegex for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleRegexNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleRegex(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleRegexSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleRegex) []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleRegex { @@ -7124,23 +7268,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleEx if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypes) []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypes { @@ -7247,23 +7394,26 @@ func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleEx if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypesSlice(c *Client, des, nw []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes) []JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes { @@ -7426,23 +7576,26 @@ func canonicalizeNewJobTriggerInspectJobActionsSet(c *Client, des, nw []JobTrigg if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobActions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobActions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobActionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobActions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobActionsSlice(c *Client, des, nw []JobTriggerInspectJobActions) []JobTriggerInspectJobActions { @@ -7535,23 +7688,26 @@ func canonicalizeNewJobTriggerInspectJobActionsSaveFindingsSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobActionsSaveFindings + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobActionsSaveFindings for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobActionsSaveFindingsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobActionsSaveFindings(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobActionsSaveFindingsSlice(c *Client, des, nw []JobTriggerInspectJobActionsSaveFindings) []JobTriggerInspectJobActionsSaveFindings { @@ -7672,23 +7828,26 @@ func canonicalizeNewJobTriggerInspectJobActionsSaveFindingsOutputConfigSet(c *Cl if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobActionsSaveFindingsOutputConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobActionsSaveFindingsOutputConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobActionsSaveFindingsOutputConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobActionsSaveFindingsOutputConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobActionsSaveFindingsOutputConfigSlice(c *Client, des, nw []JobTriggerInspectJobActionsSaveFindingsOutputConfig) []JobTriggerInspectJobActionsSaveFindingsOutputConfig { @@ -7796,23 +7955,26 @@ func canonicalizeNewJobTriggerInspectJobActionsSaveFindingsOutputConfigTableSet( if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobActionsSaveFindingsOutputConfigTable + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobActionsSaveFindingsOutputConfigTable for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobActionsSaveFindingsOutputConfigTableNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobActionsSaveFindingsOutputConfigTable(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobActionsSaveFindingsOutputConfigTableSlice(c *Client, des, nw []JobTriggerInspectJobActionsSaveFindingsOutputConfigTable) []JobTriggerInspectJobActionsSaveFindingsOutputConfigTable { @@ -7900,23 +8062,26 @@ func canonicalizeNewJobTriggerInspectJobActionsSaveFindingsOutputConfigDlpStorag if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobActionsSaveFindingsOutputConfigDlpStorage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobActionsSaveFindingsOutputConfigDlpStorage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobActionsSaveFindingsOutputConfigDlpStorageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobActionsSaveFindingsOutputConfigDlpStorage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobActionsSaveFindingsOutputConfigDlpStorageSlice(c *Client, des, nw []JobTriggerInspectJobActionsSaveFindingsOutputConfigDlpStorage) []JobTriggerInspectJobActionsSaveFindingsOutputConfigDlpStorage { @@ -8012,23 +8177,26 @@ func canonicalizeNewJobTriggerInspectJobActionsPubSubSet(c *Client, des, nw []Jo if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobActionsPubSub + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobActionsPubSub for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobActionsPubSubNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobActionsPubSub(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobActionsPubSubSlice(c *Client, des, nw []JobTriggerInspectJobActionsPubSub) []JobTriggerInspectJobActionsPubSub { @@ -8116,23 +8284,26 @@ func canonicalizeNewJobTriggerInspectJobActionsPublishSummaryToCsccSet(c *Client if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobActionsPublishSummaryToCscc + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobActionsPublishSummaryToCscc for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobActionsPublishSummaryToCsccNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobActionsPublishSummaryToCscc(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobActionsPublishSummaryToCsccSlice(c *Client, des, nw []JobTriggerInspectJobActionsPublishSummaryToCscc) []JobTriggerInspectJobActionsPublishSummaryToCscc { @@ -8220,23 +8391,26 @@ func canonicalizeNewJobTriggerInspectJobActionsPublishFindingsToCloudDataCatalog if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobActionsPublishFindingsToCloudDataCatalog + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobActionsPublishFindingsToCloudDataCatalog for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobActionsPublishFindingsToCloudDataCatalogNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobActionsPublishFindingsToCloudDataCatalog(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobActionsPublishFindingsToCloudDataCatalogSlice(c *Client, des, nw []JobTriggerInspectJobActionsPublishFindingsToCloudDataCatalog) []JobTriggerInspectJobActionsPublishFindingsToCloudDataCatalog { @@ -8324,23 +8498,26 @@ func canonicalizeNewJobTriggerInspectJobActionsJobNotificationEmailsSet(c *Clien if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobActionsJobNotificationEmails + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobActionsJobNotificationEmails for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobActionsJobNotificationEmailsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobActionsJobNotificationEmails(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobActionsJobNotificationEmailsSlice(c *Client, des, nw []JobTriggerInspectJobActionsJobNotificationEmails) []JobTriggerInspectJobActionsJobNotificationEmails { @@ -8428,23 +8605,26 @@ func canonicalizeNewJobTriggerInspectJobActionsPublishToStackdriverSet(c *Client if des == nil { return nw } - var reorderedNew []JobTriggerInspectJobActionsPublishToStackdriver + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerInspectJobActionsPublishToStackdriver for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerInspectJobActionsPublishToStackdriverNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerInspectJobActionsPublishToStackdriver(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerInspectJobActionsPublishToStackdriverSlice(c *Client, des, nw []JobTriggerInspectJobActionsPublishToStackdriver) []JobTriggerInspectJobActionsPublishToStackdriver { @@ -8559,23 +8739,26 @@ func canonicalizeNewJobTriggerTriggersSet(c *Client, des, nw []JobTriggerTrigger if des == nil { return nw } - var reorderedNew []JobTriggerTriggers + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerTriggers for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerTriggersNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerTriggers(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerTriggersSlice(c *Client, des, nw []JobTriggerTriggers) []JobTriggerTriggers { @@ -8674,23 +8857,26 @@ func canonicalizeNewJobTriggerTriggersScheduleSet(c *Client, des, nw []JobTrigge if des == nil { return nw } - var reorderedNew []JobTriggerTriggersSchedule + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerTriggersSchedule for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerTriggersScheduleNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerTriggersSchedule(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerTriggersScheduleSlice(c *Client, des, nw []JobTriggerTriggersSchedule) []JobTriggerTriggersSchedule { @@ -8778,23 +8964,26 @@ func canonicalizeNewJobTriggerTriggersManualSet(c *Client, des, nw []JobTriggerT if des == nil { return nw } - var reorderedNew []JobTriggerTriggersManual + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerTriggersManual for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerTriggersManualNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerTriggersManual(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerTriggersManualSlice(c *Client, des, nw []JobTriggerTriggersManual) []JobTriggerTriggersManual { @@ -8893,23 +9082,26 @@ func canonicalizeNewJobTriggerErrorsSet(c *Client, des, nw []JobTriggerErrors) [ if des == nil { return nw } - var reorderedNew []JobTriggerErrors + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerErrors for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerErrorsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerErrors(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerErrorsSlice(c *Client, des, nw []JobTriggerErrors) []JobTriggerErrors { @@ -9016,23 +9208,26 @@ func canonicalizeNewJobTriggerErrorsDetailsSet(c *Client, des, nw []JobTriggerEr if des == nil { return nw } - var reorderedNew []JobTriggerErrorsDetails + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerErrorsDetails for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerErrorsDetailsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerErrorsDetails(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerErrorsDetailsSlice(c *Client, des, nw []JobTriggerErrorsDetails) []JobTriggerErrorsDetails { @@ -9139,23 +9334,26 @@ func canonicalizeNewJobTriggerErrorsDetailsDetailsSet(c *Client, des, nw []JobTr if des == nil { return nw } - var reorderedNew []JobTriggerErrorsDetailsDetails + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTriggerErrorsDetailsDetails for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTriggerErrorsDetailsDetailsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTriggerErrorsDetailsDetails(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTriggerErrorsDetailsDetailsSlice(c *Client, des, nw []JobTriggerErrorsDetailsDetails) []JobTriggerErrorsDetailsDetails { diff --git a/services/google/dlp/stored_info_type_internal.go b/services/google/dlp/stored_info_type_internal.go index 3cc869a270..17c498daa3 100755 --- a/services/google/dlp/stored_info_type_internal.go +++ b/services/google/dlp/stored_info_type_internal.go @@ -743,23 +743,26 @@ func canonicalizeNewStoredInfoTypeLargeCustomDictionarySet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []StoredInfoTypeLargeCustomDictionary + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []StoredInfoTypeLargeCustomDictionary for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareStoredInfoTypeLargeCustomDictionaryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewStoredInfoTypeLargeCustomDictionary(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewStoredInfoTypeLargeCustomDictionarySlice(c *Client, des, nw []StoredInfoTypeLargeCustomDictionary) []StoredInfoTypeLargeCustomDictionary { @@ -858,23 +861,26 @@ func canonicalizeNewStoredInfoTypeLargeCustomDictionaryOutputPathSet(c *Client, if des == nil { return nw } - var reorderedNew []StoredInfoTypeLargeCustomDictionaryOutputPath + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []StoredInfoTypeLargeCustomDictionaryOutputPath for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareStoredInfoTypeLargeCustomDictionaryOutputPathNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewStoredInfoTypeLargeCustomDictionaryOutputPath(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewStoredInfoTypeLargeCustomDictionaryOutputPathSlice(c *Client, des, nw []StoredInfoTypeLargeCustomDictionaryOutputPath) []StoredInfoTypeLargeCustomDictionaryOutputPath { @@ -973,23 +979,26 @@ func canonicalizeNewStoredInfoTypeLargeCustomDictionaryCloudStorageFileSetSet(c if des == nil { return nw } - var reorderedNew []StoredInfoTypeLargeCustomDictionaryCloudStorageFileSet + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []StoredInfoTypeLargeCustomDictionaryCloudStorageFileSet for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareStoredInfoTypeLargeCustomDictionaryCloudStorageFileSetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewStoredInfoTypeLargeCustomDictionaryCloudStorageFileSet(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewStoredInfoTypeLargeCustomDictionaryCloudStorageFileSetSlice(c *Client, des, nw []StoredInfoTypeLargeCustomDictionaryCloudStorageFileSet) []StoredInfoTypeLargeCustomDictionaryCloudStorageFileSet { @@ -1084,23 +1093,26 @@ func canonicalizeNewStoredInfoTypeLargeCustomDictionaryBigQueryFieldSet(c *Clien if des == nil { return nw } - var reorderedNew []StoredInfoTypeLargeCustomDictionaryBigQueryField + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []StoredInfoTypeLargeCustomDictionaryBigQueryField for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareStoredInfoTypeLargeCustomDictionaryBigQueryFieldNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewStoredInfoTypeLargeCustomDictionaryBigQueryField(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewStoredInfoTypeLargeCustomDictionaryBigQueryFieldSlice(c *Client, des, nw []StoredInfoTypeLargeCustomDictionaryBigQueryField) []StoredInfoTypeLargeCustomDictionaryBigQueryField { @@ -1208,23 +1220,26 @@ func canonicalizeNewStoredInfoTypeLargeCustomDictionaryBigQueryFieldTableSet(c * if des == nil { return nw } - var reorderedNew []StoredInfoTypeLargeCustomDictionaryBigQueryFieldTable + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []StoredInfoTypeLargeCustomDictionaryBigQueryFieldTable for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareStoredInfoTypeLargeCustomDictionaryBigQueryFieldTableNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewStoredInfoTypeLargeCustomDictionaryBigQueryFieldTable(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewStoredInfoTypeLargeCustomDictionaryBigQueryFieldTableSlice(c *Client, des, nw []StoredInfoTypeLargeCustomDictionaryBigQueryFieldTable) []StoredInfoTypeLargeCustomDictionaryBigQueryFieldTable { @@ -1323,23 +1338,26 @@ func canonicalizeNewStoredInfoTypeLargeCustomDictionaryBigQueryFieldFieldSet(c * if des == nil { return nw } - var reorderedNew []StoredInfoTypeLargeCustomDictionaryBigQueryFieldField + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []StoredInfoTypeLargeCustomDictionaryBigQueryFieldField for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareStoredInfoTypeLargeCustomDictionaryBigQueryFieldFieldNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewStoredInfoTypeLargeCustomDictionaryBigQueryFieldField(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewStoredInfoTypeLargeCustomDictionaryBigQueryFieldFieldSlice(c *Client, des, nw []StoredInfoTypeLargeCustomDictionaryBigQueryFieldField) []StoredInfoTypeLargeCustomDictionaryBigQueryFieldField { @@ -1454,23 +1472,26 @@ func canonicalizeNewStoredInfoTypeDictionarySet(c *Client, des, nw []StoredInfoT if des == nil { return nw } - var reorderedNew []StoredInfoTypeDictionary + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []StoredInfoTypeDictionary for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareStoredInfoTypeDictionaryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewStoredInfoTypeDictionary(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewStoredInfoTypeDictionarySlice(c *Client, des, nw []StoredInfoTypeDictionary) []StoredInfoTypeDictionary { @@ -1569,23 +1590,26 @@ func canonicalizeNewStoredInfoTypeDictionaryWordListSet(c *Client, des, nw []Sto if des == nil { return nw } - var reorderedNew []StoredInfoTypeDictionaryWordList + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []StoredInfoTypeDictionaryWordList for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareStoredInfoTypeDictionaryWordListNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewStoredInfoTypeDictionaryWordList(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewStoredInfoTypeDictionaryWordListSlice(c *Client, des, nw []StoredInfoTypeDictionaryWordList) []StoredInfoTypeDictionaryWordList { @@ -1684,23 +1708,26 @@ func canonicalizeNewStoredInfoTypeDictionaryCloudStoragePathSet(c *Client, des, if des == nil { return nw } - var reorderedNew []StoredInfoTypeDictionaryCloudStoragePath + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []StoredInfoTypeDictionaryCloudStoragePath for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareStoredInfoTypeDictionaryCloudStoragePathNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewStoredInfoTypeDictionaryCloudStoragePath(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewStoredInfoTypeDictionaryCloudStoragePathSlice(c *Client, des, nw []StoredInfoTypeDictionaryCloudStoragePath) []StoredInfoTypeDictionaryCloudStoragePath { @@ -1805,23 +1832,26 @@ func canonicalizeNewStoredInfoTypeRegexSet(c *Client, des, nw []StoredInfoTypeRe if des == nil { return nw } - var reorderedNew []StoredInfoTypeRegex + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []StoredInfoTypeRegex for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareStoredInfoTypeRegexNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewStoredInfoTypeRegex(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewStoredInfoTypeRegexSlice(c *Client, des, nw []StoredInfoTypeRegex) []StoredInfoTypeRegex { diff --git a/services/google/eventarc/alpha/trigger_internal.go b/services/google/eventarc/alpha/trigger_internal.go index f78e651a05..7920608a16 100755 --- a/services/google/eventarc/alpha/trigger_internal.go +++ b/services/google/eventarc/alpha/trigger_internal.go @@ -754,23 +754,26 @@ func canonicalizeNewTriggerMatchingCriteriaSet(c *Client, des, nw []TriggerMatch if des == nil { return nw } - var reorderedNew []TriggerMatchingCriteria + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TriggerMatchingCriteria for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTriggerMatchingCriteriaNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTriggerMatchingCriteria(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTriggerMatchingCriteriaSlice(c *Client, des, nw []TriggerMatchingCriteria) []TriggerMatchingCriteria { @@ -921,23 +924,26 @@ func canonicalizeNewTriggerDestinationSet(c *Client, des, nw []TriggerDestinatio if des == nil { return nw } - var reorderedNew []TriggerDestination + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TriggerDestination for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTriggerDestinationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTriggerDestination(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTriggerDestinationSlice(c *Client, des, nw []TriggerDestination) []TriggerDestination { @@ -1050,23 +1056,26 @@ func canonicalizeNewTriggerDestinationCloudRunServiceSet(c *Client, des, nw []Tr if des == nil { return nw } - var reorderedNew []TriggerDestinationCloudRunService + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TriggerDestinationCloudRunService for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTriggerDestinationCloudRunServiceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTriggerDestinationCloudRunService(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTriggerDestinationCloudRunServiceSlice(c *Client, des, nw []TriggerDestinationCloudRunService) []TriggerDestinationCloudRunService { @@ -1195,23 +1204,26 @@ func canonicalizeNewTriggerDestinationGkeSet(c *Client, des, nw []TriggerDestina if des == nil { return nw } - var reorderedNew []TriggerDestinationGke + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TriggerDestinationGke for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTriggerDestinationGkeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTriggerDestinationGke(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTriggerDestinationGkeSlice(c *Client, des, nw []TriggerDestinationGke) []TriggerDestinationGke { @@ -1304,23 +1316,26 @@ func canonicalizeNewTriggerTransportSet(c *Client, des, nw []TriggerTransport) [ if des == nil { return nw } - var reorderedNew []TriggerTransport + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TriggerTransport for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTriggerTransportNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTriggerTransport(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTriggerTransportSlice(c *Client, des, nw []TriggerTransport) []TriggerTransport { @@ -1422,23 +1437,26 @@ func canonicalizeNewTriggerTransportPubsubSet(c *Client, des, nw []TriggerTransp if des == nil { return nw } - var reorderedNew []TriggerTransportPubsub + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TriggerTransportPubsub for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTriggerTransportPubsubNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTriggerTransportPubsub(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTriggerTransportPubsubSlice(c *Client, des, nw []TriggerTransportPubsub) []TriggerTransportPubsub { diff --git a/services/google/eventarc/beta/trigger_internal.go b/services/google/eventarc/beta/trigger_internal.go index d02129a399..fa02701c2f 100755 --- a/services/google/eventarc/beta/trigger_internal.go +++ b/services/google/eventarc/beta/trigger_internal.go @@ -754,23 +754,26 @@ func canonicalizeNewTriggerMatchingCriteriaSet(c *Client, des, nw []TriggerMatch if des == nil { return nw } - var reorderedNew []TriggerMatchingCriteria + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TriggerMatchingCriteria for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTriggerMatchingCriteriaNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTriggerMatchingCriteria(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTriggerMatchingCriteriaSlice(c *Client, des, nw []TriggerMatchingCriteria) []TriggerMatchingCriteria { @@ -921,23 +924,26 @@ func canonicalizeNewTriggerDestinationSet(c *Client, des, nw []TriggerDestinatio if des == nil { return nw } - var reorderedNew []TriggerDestination + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TriggerDestination for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTriggerDestinationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTriggerDestination(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTriggerDestinationSlice(c *Client, des, nw []TriggerDestination) []TriggerDestination { @@ -1050,23 +1056,26 @@ func canonicalizeNewTriggerDestinationCloudRunServiceSet(c *Client, des, nw []Tr if des == nil { return nw } - var reorderedNew []TriggerDestinationCloudRunService + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TriggerDestinationCloudRunService for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTriggerDestinationCloudRunServiceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTriggerDestinationCloudRunService(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTriggerDestinationCloudRunServiceSlice(c *Client, des, nw []TriggerDestinationCloudRunService) []TriggerDestinationCloudRunService { @@ -1195,23 +1204,26 @@ func canonicalizeNewTriggerDestinationGkeSet(c *Client, des, nw []TriggerDestina if des == nil { return nw } - var reorderedNew []TriggerDestinationGke + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TriggerDestinationGke for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTriggerDestinationGkeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTriggerDestinationGke(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTriggerDestinationGkeSlice(c *Client, des, nw []TriggerDestinationGke) []TriggerDestinationGke { @@ -1304,23 +1316,26 @@ func canonicalizeNewTriggerTransportSet(c *Client, des, nw []TriggerTransport) [ if des == nil { return nw } - var reorderedNew []TriggerTransport + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TriggerTransport for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTriggerTransportNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTriggerTransport(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTriggerTransportSlice(c *Client, des, nw []TriggerTransport) []TriggerTransport { @@ -1422,23 +1437,26 @@ func canonicalizeNewTriggerTransportPubsubSet(c *Client, des, nw []TriggerTransp if des == nil { return nw } - var reorderedNew []TriggerTransportPubsub + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TriggerTransportPubsub for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTriggerTransportPubsubNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTriggerTransportPubsub(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTriggerTransportPubsubSlice(c *Client, des, nw []TriggerTransportPubsub) []TriggerTransportPubsub { diff --git a/services/google/eventarc/trigger_internal.go b/services/google/eventarc/trigger_internal.go index 2ccb73e902..6cb5a8ad64 100755 --- a/services/google/eventarc/trigger_internal.go +++ b/services/google/eventarc/trigger_internal.go @@ -754,23 +754,26 @@ func canonicalizeNewTriggerMatchingCriteriaSet(c *Client, des, nw []TriggerMatch if des == nil { return nw } - var reorderedNew []TriggerMatchingCriteria + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TriggerMatchingCriteria for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTriggerMatchingCriteriaNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTriggerMatchingCriteria(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTriggerMatchingCriteriaSlice(c *Client, des, nw []TriggerMatchingCriteria) []TriggerMatchingCriteria { @@ -921,23 +924,26 @@ func canonicalizeNewTriggerDestinationSet(c *Client, des, nw []TriggerDestinatio if des == nil { return nw } - var reorderedNew []TriggerDestination + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TriggerDestination for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTriggerDestinationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTriggerDestination(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTriggerDestinationSlice(c *Client, des, nw []TriggerDestination) []TriggerDestination { @@ -1050,23 +1056,26 @@ func canonicalizeNewTriggerDestinationCloudRunServiceSet(c *Client, des, nw []Tr if des == nil { return nw } - var reorderedNew []TriggerDestinationCloudRunService + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TriggerDestinationCloudRunService for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTriggerDestinationCloudRunServiceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTriggerDestinationCloudRunService(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTriggerDestinationCloudRunServiceSlice(c *Client, des, nw []TriggerDestinationCloudRunService) []TriggerDestinationCloudRunService { @@ -1195,23 +1204,26 @@ func canonicalizeNewTriggerDestinationGkeSet(c *Client, des, nw []TriggerDestina if des == nil { return nw } - var reorderedNew []TriggerDestinationGke + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TriggerDestinationGke for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTriggerDestinationGkeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTriggerDestinationGke(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTriggerDestinationGkeSlice(c *Client, des, nw []TriggerDestinationGke) []TriggerDestinationGke { @@ -1304,23 +1316,26 @@ func canonicalizeNewTriggerTransportSet(c *Client, des, nw []TriggerTransport) [ if des == nil { return nw } - var reorderedNew []TriggerTransport + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TriggerTransport for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTriggerTransportNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTriggerTransport(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTriggerTransportSlice(c *Client, des, nw []TriggerTransport) []TriggerTransport { @@ -1422,23 +1437,26 @@ func canonicalizeNewTriggerTransportPubsubSet(c *Client, des, nw []TriggerTransp if des == nil { return nw } - var reorderedNew []TriggerTransportPubsub + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TriggerTransportPubsub for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTriggerTransportPubsubNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTriggerTransportPubsub(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTriggerTransportPubsubSlice(c *Client, des, nw []TriggerTransportPubsub) []TriggerTransportPubsub { diff --git a/services/google/filestore/alpha/instance_internal.go b/services/google/filestore/alpha/instance_internal.go index f7c4d7f172..deb2e98c01 100755 --- a/services/google/filestore/alpha/instance_internal.go +++ b/services/google/filestore/alpha/instance_internal.go @@ -627,23 +627,26 @@ func canonicalizeNewInstanceFileSharesSet(c *Client, des, nw []InstanceFileShare if des == nil { return nw } - var reorderedNew []InstanceFileShares + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceFileShares for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceFileSharesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceFileShares(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceFileSharesSlice(c *Client, des, nw []InstanceFileShares) []InstanceFileShares { @@ -766,23 +769,26 @@ func canonicalizeNewInstanceFileSharesNfsExportOptionsSet(c *Client, des, nw []I if des == nil { return nw } - var reorderedNew []InstanceFileSharesNfsExportOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceFileSharesNfsExportOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceFileSharesNfsExportOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceFileSharesNfsExportOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceFileSharesNfsExportOptionsSlice(c *Client, des, nw []InstanceFileSharesNfsExportOptions) []InstanceFileSharesNfsExportOptions { @@ -896,23 +902,26 @@ func canonicalizeNewInstanceNetworksSet(c *Client, des, nw []InstanceNetworks) [ if des == nil { return nw } - var reorderedNew []InstanceNetworks + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceNetworks for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceNetworksNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceNetworks(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceNetworksSlice(c *Client, des, nw []InstanceNetworks) []InstanceNetworks { diff --git a/services/google/filestore/beta/instance_internal.go b/services/google/filestore/beta/instance_internal.go index 62fe826d56..d7e46e43c8 100755 --- a/services/google/filestore/beta/instance_internal.go +++ b/services/google/filestore/beta/instance_internal.go @@ -627,23 +627,26 @@ func canonicalizeNewInstanceFileSharesSet(c *Client, des, nw []InstanceFileShare if des == nil { return nw } - var reorderedNew []InstanceFileShares + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceFileShares for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceFileSharesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceFileShares(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceFileSharesSlice(c *Client, des, nw []InstanceFileShares) []InstanceFileShares { @@ -766,23 +769,26 @@ func canonicalizeNewInstanceFileSharesNfsExportOptionsSet(c *Client, des, nw []I if des == nil { return nw } - var reorderedNew []InstanceFileSharesNfsExportOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceFileSharesNfsExportOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceFileSharesNfsExportOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceFileSharesNfsExportOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceFileSharesNfsExportOptionsSlice(c *Client, des, nw []InstanceFileSharesNfsExportOptions) []InstanceFileSharesNfsExportOptions { @@ -896,23 +902,26 @@ func canonicalizeNewInstanceNetworksSet(c *Client, des, nw []InstanceNetworks) [ if des == nil { return nw } - var reorderedNew []InstanceNetworks + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceNetworks for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceNetworksNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceNetworks(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceNetworksSlice(c *Client, des, nw []InstanceNetworks) []InstanceNetworks { diff --git a/services/google/filestore/instance_internal.go b/services/google/filestore/instance_internal.go index 80427ee07a..155a0d2606 100755 --- a/services/google/filestore/instance_internal.go +++ b/services/google/filestore/instance_internal.go @@ -627,23 +627,26 @@ func canonicalizeNewInstanceFileSharesSet(c *Client, des, nw []InstanceFileShare if des == nil { return nw } - var reorderedNew []InstanceFileShares + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceFileShares for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceFileSharesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceFileShares(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceFileSharesSlice(c *Client, des, nw []InstanceFileShares) []InstanceFileShares { @@ -766,23 +769,26 @@ func canonicalizeNewInstanceFileSharesNfsExportOptionsSet(c *Client, des, nw []I if des == nil { return nw } - var reorderedNew []InstanceFileSharesNfsExportOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceFileSharesNfsExportOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceFileSharesNfsExportOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceFileSharesNfsExportOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceFileSharesNfsExportOptionsSlice(c *Client, des, nw []InstanceFileSharesNfsExportOptions) []InstanceFileSharesNfsExportOptions { @@ -896,23 +902,26 @@ func canonicalizeNewInstanceNetworksSet(c *Client, des, nw []InstanceNetworks) [ if des == nil { return nw } - var reorderedNew []InstanceNetworks + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []InstanceNetworks for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareInstanceNetworksNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewInstanceNetworks(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewInstanceNetworksSlice(c *Client, des, nw []InstanceNetworks) []InstanceNetworks { diff --git a/services/google/firebase/alpha/firebase_project_internal.go b/services/google/firebase/alpha/firebase_project_internal.go index e347c685d7..d6c388bba6 100755 --- a/services/google/firebase/alpha/firebase_project_internal.go +++ b/services/google/firebase/alpha/firebase_project_internal.go @@ -500,23 +500,26 @@ func canonicalizeNewFirebaseProjectResourcesSet(c *Client, des, nw []FirebasePro if des == nil { return nw } - var reorderedNew []FirebaseProjectResources + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FirebaseProjectResources for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFirebaseProjectResourcesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFirebaseProjectResources(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFirebaseProjectResourcesSlice(c *Client, des, nw []FirebaseProjectResources) []FirebaseProjectResources { diff --git a/services/google/firebase/beta/firebase_project_internal.go b/services/google/firebase/beta/firebase_project_internal.go index d3d645b6bb..7a5cacd18f 100755 --- a/services/google/firebase/beta/firebase_project_internal.go +++ b/services/google/firebase/beta/firebase_project_internal.go @@ -500,23 +500,26 @@ func canonicalizeNewFirebaseProjectResourcesSet(c *Client, des, nw []FirebasePro if des == nil { return nw } - var reorderedNew []FirebaseProjectResources + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FirebaseProjectResources for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFirebaseProjectResourcesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFirebaseProjectResources(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFirebaseProjectResourcesSlice(c *Client, des, nw []FirebaseProjectResources) []FirebaseProjectResources { diff --git a/services/google/firebaserules/alpha/ruleset_internal.go b/services/google/firebaserules/alpha/ruleset_internal.go index 50b9660d9e..81c466b9d0 100755 --- a/services/google/firebaserules/alpha/ruleset_internal.go +++ b/services/google/firebaserules/alpha/ruleset_internal.go @@ -482,23 +482,26 @@ func canonicalizeNewRulesetSourceSet(c *Client, des, nw []RulesetSource) []Rules if des == nil { return nw } - var reorderedNew []RulesetSource + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []RulesetSource for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareRulesetSourceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewRulesetSource(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewRulesetSourceSlice(c *Client, des, nw []RulesetSource) []RulesetSource { @@ -613,23 +616,26 @@ func canonicalizeNewRulesetSourceFilesSet(c *Client, des, nw []RulesetSourceFile if des == nil { return nw } - var reorderedNew []RulesetSourceFiles + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []RulesetSourceFiles for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareRulesetSourceFilesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewRulesetSourceFiles(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewRulesetSourceFilesSlice(c *Client, des, nw []RulesetSourceFiles) []RulesetSourceFiles { @@ -728,23 +734,26 @@ func canonicalizeNewRulesetMetadataSet(c *Client, des, nw []RulesetMetadata) []R if des == nil { return nw } - var reorderedNew []RulesetMetadata + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []RulesetMetadata for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareRulesetMetadataNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewRulesetMetadata(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewRulesetMetadataSlice(c *Client, des, nw []RulesetMetadata) []RulesetMetadata { diff --git a/services/google/firebaserules/beta/ruleset_internal.go b/services/google/firebaserules/beta/ruleset_internal.go index f303d1eac3..964a306704 100755 --- a/services/google/firebaserules/beta/ruleset_internal.go +++ b/services/google/firebaserules/beta/ruleset_internal.go @@ -482,23 +482,26 @@ func canonicalizeNewRulesetSourceSet(c *Client, des, nw []RulesetSource) []Rules if des == nil { return nw } - var reorderedNew []RulesetSource + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []RulesetSource for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareRulesetSourceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewRulesetSource(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewRulesetSourceSlice(c *Client, des, nw []RulesetSource) []RulesetSource { @@ -613,23 +616,26 @@ func canonicalizeNewRulesetSourceFilesSet(c *Client, des, nw []RulesetSourceFile if des == nil { return nw } - var reorderedNew []RulesetSourceFiles + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []RulesetSourceFiles for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareRulesetSourceFilesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewRulesetSourceFiles(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewRulesetSourceFilesSlice(c *Client, des, nw []RulesetSourceFiles) []RulesetSourceFiles { @@ -728,23 +734,26 @@ func canonicalizeNewRulesetMetadataSet(c *Client, des, nw []RulesetMetadata) []R if des == nil { return nw } - var reorderedNew []RulesetMetadata + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []RulesetMetadata for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareRulesetMetadataNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewRulesetMetadata(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewRulesetMetadataSlice(c *Client, des, nw []RulesetMetadata) []RulesetMetadata { diff --git a/services/google/firebaserules/ruleset_internal.go b/services/google/firebaserules/ruleset_internal.go index f07e0b8915..a062ffb46a 100755 --- a/services/google/firebaserules/ruleset_internal.go +++ b/services/google/firebaserules/ruleset_internal.go @@ -482,23 +482,26 @@ func canonicalizeNewRulesetSourceSet(c *Client, des, nw []RulesetSource) []Rules if des == nil { return nw } - var reorderedNew []RulesetSource + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []RulesetSource for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareRulesetSourceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewRulesetSource(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewRulesetSourceSlice(c *Client, des, nw []RulesetSource) []RulesetSource { @@ -613,23 +616,26 @@ func canonicalizeNewRulesetSourceFilesSet(c *Client, des, nw []RulesetSourceFile if des == nil { return nw } - var reorderedNew []RulesetSourceFiles + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []RulesetSourceFiles for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareRulesetSourceFilesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewRulesetSourceFiles(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewRulesetSourceFilesSlice(c *Client, des, nw []RulesetSourceFiles) []RulesetSourceFiles { @@ -728,23 +734,26 @@ func canonicalizeNewRulesetMetadataSet(c *Client, des, nw []RulesetMetadata) []R if des == nil { return nw } - var reorderedNew []RulesetMetadata + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []RulesetMetadata for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareRulesetMetadataNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewRulesetMetadata(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewRulesetMetadataSlice(c *Client, des, nw []RulesetMetadata) []RulesetMetadata { diff --git a/services/google/gkehub/alpha/feature_internal.go b/services/google/gkehub/alpha/feature_internal.go index 08c4001d23..3c47191cb7 100755 --- a/services/google/gkehub/alpha/feature_internal.go +++ b/services/google/gkehub/alpha/feature_internal.go @@ -582,23 +582,26 @@ func canonicalizeNewFeatureResourceStateSet(c *Client, des, nw []FeatureResource if des == nil { return nw } - var reorderedNew []FeatureResourceState + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FeatureResourceState for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFeatureResourceStateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFeatureResourceState(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFeatureResourceStateSlice(c *Client, des, nw []FeatureResourceState) []FeatureResourceState { @@ -693,23 +696,26 @@ func canonicalizeNewFeatureSpecSet(c *Client, des, nw []FeatureSpec) []FeatureSp if des == nil { return nw } - var reorderedNew []FeatureSpec + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FeatureSpec for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFeatureSpecNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFeatureSpec(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFeatureSpecSlice(c *Client, des, nw []FeatureSpec) []FeatureSpec { @@ -805,23 +811,26 @@ func canonicalizeNewFeatureSpecMulticlusteringressSet(c *Client, des, nw []Featu if des == nil { return nw } - var reorderedNew []FeatureSpecMulticlusteringress + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FeatureSpecMulticlusteringress for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFeatureSpecMulticlusteringressNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFeatureSpecMulticlusteringress(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFeatureSpecMulticlusteringressSlice(c *Client, des, nw []FeatureSpecMulticlusteringress) []FeatureSpecMulticlusteringress { @@ -920,23 +929,26 @@ func canonicalizeNewFeatureSpecCloudauditloggingSet(c *Client, des, nw []Feature if des == nil { return nw } - var reorderedNew []FeatureSpecCloudauditlogging + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FeatureSpecCloudauditlogging for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFeatureSpecCloudauditloggingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFeatureSpecCloudauditlogging(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFeatureSpecCloudauditloggingSlice(c *Client, des, nw []FeatureSpecCloudauditlogging) []FeatureSpecCloudauditlogging { @@ -1028,23 +1040,26 @@ func canonicalizeNewFeatureStateSet(c *Client, des, nw []FeatureState) []Feature if des == nil { return nw } - var reorderedNew []FeatureState + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FeatureState for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFeatureStateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFeatureState(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFeatureStateSlice(c *Client, des, nw []FeatureState) []FeatureState { @@ -1140,23 +1155,26 @@ func canonicalizeNewFeatureStateStateSet(c *Client, des, nw []FeatureStateState) if des == nil { return nw } - var reorderedNew []FeatureStateState + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FeatureStateState for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFeatureStateStateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFeatureStateState(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFeatureStateStateSlice(c *Client, des, nw []FeatureStateState) []FeatureStateState { @@ -1247,23 +1265,26 @@ func canonicalizeNewFeatureStateServicemeshSet(c *Client, des, nw []FeatureState if des == nil { return nw } - var reorderedNew []FeatureStateServicemesh + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FeatureStateServicemesh for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFeatureStateServicemeshNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFeatureStateServicemesh(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFeatureStateServicemeshSlice(c *Client, des, nw []FeatureStateServicemesh) []FeatureStateServicemesh { @@ -1360,23 +1381,26 @@ func canonicalizeNewFeatureStateServicemeshAnalysisMessagesSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []FeatureStateServicemeshAnalysisMessages + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FeatureStateServicemeshAnalysisMessages for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFeatureStateServicemeshAnalysisMessagesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFeatureStateServicemeshAnalysisMessages(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFeatureStateServicemeshAnalysisMessagesSlice(c *Client, des, nw []FeatureStateServicemeshAnalysisMessages) []FeatureStateServicemeshAnalysisMessages { @@ -1470,23 +1494,26 @@ func canonicalizeNewFeatureStateServicemeshAnalysisMessagesMessageBaseSet(c *Cli if des == nil { return nw } - var reorderedNew []FeatureStateServicemeshAnalysisMessagesMessageBase + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FeatureStateServicemeshAnalysisMessagesMessageBase for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFeatureStateServicemeshAnalysisMessagesMessageBaseNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFeatureStateServicemeshAnalysisMessagesMessageBase(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFeatureStateServicemeshAnalysisMessagesMessageBaseSlice(c *Client, des, nw []FeatureStateServicemeshAnalysisMessagesMessageBase) []FeatureStateServicemeshAnalysisMessagesMessageBase { @@ -1582,23 +1609,26 @@ func canonicalizeNewFeatureStateServicemeshAnalysisMessagesMessageBaseTypeSet(c if des == nil { return nw } - var reorderedNew []FeatureStateServicemeshAnalysisMessagesMessageBaseType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FeatureStateServicemeshAnalysisMessagesMessageBaseType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFeatureStateServicemeshAnalysisMessagesMessageBaseTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFeatureStateServicemeshAnalysisMessagesMessageBaseType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFeatureStateServicemeshAnalysisMessagesMessageBaseTypeSlice(c *Client, des, nw []FeatureStateServicemeshAnalysisMessagesMessageBaseType) []FeatureStateServicemeshAnalysisMessagesMessageBaseType { diff --git a/services/google/gkehub/alpha/feature_membership.yaml b/services/google/gkehub/alpha/feature_membership.yaml index 288f81dbc1..e1434b4a31 100755 --- a/services/google/gkehub/alpha/feature_membership.yaml +++ b/services/google/gkehub/alpha/feature_membership.yaml @@ -334,9 +334,9 @@ components: type: string x-dcl-go-name: ControlPlane x-dcl-go-type: FeatureMembershipMeshControlPlaneEnum - description: 'Whether to automatically manage Service Mesh control planes. - Possible values: CONTROL_PLANE_MANAGEMENT_UNSPECIFIED, AUTOMATIC, - MANUAL' + description: '**DEPRECATED** Whether to automatically manage Service + Mesh control planes. Possible values: CONTROL_PLANE_MANAGEMENT_UNSPECIFIED, + AUTOMATIC, MANUAL' enum: - CONTROL_PLANE_MANAGEMENT_UNSPECIFIED - AUTOMATIC diff --git a/services/google/gkehub/alpha/feature_membership_alpha_yaml_embed.go b/services/google/gkehub/alpha/feature_membership_alpha_yaml_embed.go index 32efd4982d..210daa88af 100755 --- a/services/google/gkehub/alpha/feature_membership_alpha_yaml_embed.go +++ b/services/google/gkehub/alpha/feature_membership_alpha_yaml_embed.go @@ -17,7 +17,7 @@ package alpha // blaze-out/k8-fastbuild/genfiles/cloud/graphite/mmv2/services/google/gkehub/alpha/feature_membership.yaml -var YAML_feature_membership = []byte("info:\n title: GkeHub/FeatureMembership\n description: The GkeHub FeatureMembership resource\n x-dcl-struct-name: FeatureMembership\n x-dcl-has-iam: false\n x-dcl-mutex: '{{project}}/{{location}}/{{feature}}'\npaths:\n get:\n description: The function used to get information about a FeatureMembership\n parameters:\n - name: featureMembership\n required: true\n description: A full instance of a FeatureMembership\n apply:\n description: The function used to apply information about a FeatureMembership\n parameters:\n - name: featureMembership\n required: true\n description: A full instance of a FeatureMembership\n delete:\n description: The function used to delete a FeatureMembership\n parameters:\n - name: featureMembership\n required: true\n description: A full instance of a FeatureMembership\n deleteAll:\n description: The function used to delete all FeatureMembership\n parameters:\n - name: project\n required: true\n schema:\n type: string\n - name: location\n required: true\n schema:\n type: string\n - name: feature\n required: true\n schema:\n type: string\n list:\n description: The function used to list information about many FeatureMembership\n parameters:\n - name: project\n required: true\n schema:\n type: string\n - name: location\n required: true\n schema:\n type: string\n - name: feature\n required: true\n schema:\n type: string\ncomponents:\n schemas:\n FeatureMembership:\n title: FeatureMembership\n x-dcl-id: projects/{{project}}/locations/{{location}}/features/{{feature}}/memberships/{{membership}}\n x-dcl-parent-container: project\n x-dcl-has-create: true\n x-dcl-has-iam: false\n x-dcl-read-timeout: 0\n x-dcl-apply-timeout: 0\n x-dcl-delete-timeout: 0\n type: object\n required:\n - project\n - location\n - feature\n - membership\n properties:\n configmanagement:\n type: object\n x-dcl-go-name: Configmanagement\n x-dcl-go-type: FeatureMembershipConfigmanagement\n description: Config Management-specific spec.\n properties:\n binauthz:\n type: object\n x-dcl-go-name: Binauthz\n x-dcl-go-type: FeatureMembershipConfigmanagementBinauthz\n description: Binauthz configuration for the cluster.\n properties:\n enabled:\n type: boolean\n x-dcl-go-name: Enabled\n description: Whether binauthz is enabled in this cluster.\n configSync:\n type: object\n x-dcl-go-name: ConfigSync\n x-dcl-go-type: FeatureMembershipConfigmanagementConfigSync\n description: Config Sync configuration for the cluster.\n x-dcl-send-empty: true\n properties:\n git:\n type: object\n x-dcl-go-name: Git\n x-dcl-go-type: FeatureMembershipConfigmanagementConfigSyncGit\n properties:\n gcpServiceAccountEmail:\n type: string\n x-dcl-go-name: GcpServiceAccountEmail\n description: The GCP Service Account Email used for auth when\n secretType is gcpServiceAccount.\n x-dcl-references:\n - resource: Iam/ServiceAccount\n field: email\n httpsProxy:\n type: string\n x-dcl-go-name: HttpsProxy\n description: URL for the HTTPS proxy to be used when communicating\n with the Git repo.\n policyDir:\n type: string\n x-dcl-go-name: PolicyDir\n description: 'The path within the Git repository that represents\n the top level of the repo to sync. Default: the root directory\n of the repository.'\n secretType:\n type: string\n x-dcl-go-name: SecretType\n description: Type of secret configured for access to the Git\n repo. Must be one of ssh, cookiefile, gcenode, token, gcpserviceaccount\n or none. The validation of this is case-sensitive.\n syncBranch:\n type: string\n x-dcl-go-name: SyncBranch\n description: 'The branch of the repository to sync from. Default:\n master.'\n syncRepo:\n type: string\n x-dcl-go-name: SyncRepo\n description: The URL of the Git repository to use as the source\n of truth.\n syncRev:\n type: string\n x-dcl-go-name: SyncRev\n description: Git revision (tag or hash) to check out. Default\n HEAD.\n syncWaitSecs:\n type: string\n x-dcl-go-name: SyncWaitSecs\n description: 'Period in seconds between consecutive syncs. Default:\n 15.'\n oci:\n type: object\n x-dcl-go-name: Oci\n x-dcl-go-type: FeatureMembershipConfigmanagementConfigSyncOci\n properties:\n gcpServiceAccountEmail:\n type: string\n x-dcl-go-name: GcpServiceAccountEmail\n description: 'The GCP Service Account Email used for auth when\n secret_type is gcpserviceaccount. '\n x-dcl-references:\n - resource: Iam/ServiceAccount\n field: email\n policyDir:\n type: string\n x-dcl-go-name: PolicyDir\n description: 'The absolute path of the directory that contains\n the local resources. Default: the root directory of the image.'\n secretType:\n type: string\n x-dcl-go-name: SecretType\n description: Type of secret configured for access to the OCI\n Image. Must be one of gcenode, gcpserviceaccount or none.\n The validation of this is case-sensitive.\n syncRepo:\n type: string\n x-dcl-go-name: SyncRepo\n description: The OCI image repository URL for the package to\n sync from. e.g. LOCATION-docker.pkg.dev/PROJECT_ID/REPOSITORY_NAME/PACKAGE_NAME.\n syncWaitSecs:\n type: string\n x-dcl-go-name: SyncWaitSecs\n description: 'Period in seconds(int64 format) between consecutive\n syncs. Default: 15.'\n preventDrift:\n type: boolean\n x-dcl-go-name: PreventDrift\n description: Set to true to enable the Config Sync admission webhook\n to prevent drifts. If set to `false`, disables the Config Sync\n admission webhook and does not prevent drifts.\n x-dcl-server-default: true\n sourceFormat:\n type: string\n x-dcl-go-name: SourceFormat\n description: Specifies whether the Config Sync Repo is in \"hierarchical\"\n or \"unstructured\" mode.\n hierarchyController:\n type: object\n x-dcl-go-name: HierarchyController\n x-dcl-go-type: FeatureMembershipConfigmanagementHierarchyController\n description: Hierarchy Controller configuration for the cluster.\n properties:\n enableHierarchicalResourceQuota:\n type: boolean\n x-dcl-go-name: EnableHierarchicalResourceQuota\n description: Whether hierarchical resource quota is enabled in this\n cluster.\n enablePodTreeLabels:\n type: boolean\n x-dcl-go-name: EnablePodTreeLabels\n description: Whether pod tree labels are enabled in this cluster.\n enabled:\n type: boolean\n x-dcl-go-name: Enabled\n description: Whether Hierarchy Controller is enabled in this cluster.\n policyController:\n type: object\n x-dcl-go-name: PolicyController\n x-dcl-go-type: FeatureMembershipConfigmanagementPolicyController\n description: Policy Controller configuration for the cluster.\n properties:\n auditIntervalSeconds:\n type: string\n x-dcl-go-name: AuditIntervalSeconds\n description: Sets the interval for Policy Controller Audit Scans\n (in seconds). When set to 0, this disables audit functionality\n altogether.\n enabled:\n type: boolean\n x-dcl-go-name: Enabled\n description: Enables the installation of Policy Controller. If false,\n the rest of PolicyController fields take no effect.\n exemptableNamespaces:\n type: array\n x-dcl-go-name: ExemptableNamespaces\n description: The set of namespaces that are excluded from Policy\n Controller checks. Namespaces do not need to currently exist on\n the cluster.\n x-dcl-send-empty: true\n x-dcl-list-type: list\n items:\n type: string\n x-dcl-go-type: string\n logDeniesEnabled:\n type: boolean\n x-dcl-go-name: LogDeniesEnabled\n description: Logs all denies and dry run failures.\n monitoring:\n type: object\n x-dcl-go-name: Monitoring\n x-dcl-go-type: FeatureMembershipConfigmanagementPolicyControllerMonitoring\n description: 'Specifies the backends Policy Controller should export\n metrics to. For example, to specify metrics should be exported\n to Cloud Monitoring and Prometheus, specify backends: [\"cloudmonitoring\",\n \"prometheus\"]. Default: [\"cloudmonitoring\", \"prometheus\"]'\n x-dcl-server-default: true\n properties:\n backends:\n type: array\n x-dcl-go-name: Backends\n description: ' Specifies the list of backends Policy Controller\n will export to. Specifying an empty value `[]` disables metrics\n export.'\n x-dcl-server-default: true\n x-dcl-send-empty: true\n x-dcl-list-type: list\n items:\n type: string\n x-dcl-go-type: FeatureMembershipConfigmanagementPolicyControllerMonitoringBackendsEnum\n enum:\n - MONITORING_BACKEND_UNSPECIFIED\n - PROMETHEUS\n - CLOUD_MONITORING\n mutationEnabled:\n type: boolean\n x-dcl-go-name: MutationEnabled\n description: Enable or disable mutation in policy controller. If\n true, mutation CRDs, webhook and controller deployment will be\n deployed to the cluster.\n referentialRulesEnabled:\n type: boolean\n x-dcl-go-name: ReferentialRulesEnabled\n description: Enables the ability to use Constraint Templates that\n reference to objects other than the object currently being evaluated.\n templateLibraryInstalled:\n type: boolean\n x-dcl-go-name: TemplateLibraryInstalled\n description: Installs the default template library along with Policy\n Controller.\n version:\n type: string\n x-dcl-go-name: Version\n description: Optional. Version of ACM to install. Defaults to the latest\n version.\n x-dcl-server-default: true\n feature:\n type: string\n x-dcl-go-name: Feature\n description: The name of the feature\n x-kubernetes-immutable: true\n x-dcl-references:\n - resource: Gkehub/Feature\n field: name\n parent: true\n location:\n type: string\n x-dcl-go-name: Location\n description: The location of the feature\n x-kubernetes-immutable: true\n membership:\n type: string\n x-dcl-go-name: Membership\n description: The name of the membership\n x-kubernetes-immutable: true\n x-dcl-references:\n - resource: Gkehub/Membership\n field: name\n mesh:\n type: object\n x-dcl-go-name: Mesh\n x-dcl-go-type: FeatureMembershipMesh\n description: Manage Mesh Features\n properties:\n controlPlane:\n type: string\n x-dcl-go-name: ControlPlane\n x-dcl-go-type: FeatureMembershipMeshControlPlaneEnum\n description: 'Whether to automatically manage Service Mesh control planes.\n Possible values: CONTROL_PLANE_MANAGEMENT_UNSPECIFIED, AUTOMATIC,\n MANUAL'\n enum:\n - CONTROL_PLANE_MANAGEMENT_UNSPECIFIED\n - AUTOMATIC\n - MANUAL\n management:\n type: string\n x-dcl-go-name: Management\n x-dcl-go-type: FeatureMembershipMeshManagementEnum\n description: 'Whether to automatically manage Service Mesh. Possible\n values: MANAGEMENT_UNSPECIFIED, MANAGEMENT_AUTOMATIC, MANAGEMENT_MANUAL'\n enum:\n - MANAGEMENT_UNSPECIFIED\n - MANAGEMENT_AUTOMATIC\n - MANAGEMENT_MANUAL\n project:\n type: string\n x-dcl-go-name: Project\n description: The project of the feature\n x-kubernetes-immutable: true\n x-dcl-references:\n - resource: Cloudresourcemanager/Project\n field: name\n parent: true\n") +var YAML_feature_membership = []byte("info:\n title: GkeHub/FeatureMembership\n description: The GkeHub FeatureMembership resource\n x-dcl-struct-name: FeatureMembership\n x-dcl-has-iam: false\n x-dcl-mutex: '{{project}}/{{location}}/{{feature}}'\npaths:\n get:\n description: The function used to get information about a FeatureMembership\n parameters:\n - name: featureMembership\n required: true\n description: A full instance of a FeatureMembership\n apply:\n description: The function used to apply information about a FeatureMembership\n parameters:\n - name: featureMembership\n required: true\n description: A full instance of a FeatureMembership\n delete:\n description: The function used to delete a FeatureMembership\n parameters:\n - name: featureMembership\n required: true\n description: A full instance of a FeatureMembership\n deleteAll:\n description: The function used to delete all FeatureMembership\n parameters:\n - name: project\n required: true\n schema:\n type: string\n - name: location\n required: true\n schema:\n type: string\n - name: feature\n required: true\n schema:\n type: string\n list:\n description: The function used to list information about many FeatureMembership\n parameters:\n - name: project\n required: true\n schema:\n type: string\n - name: location\n required: true\n schema:\n type: string\n - name: feature\n required: true\n schema:\n type: string\ncomponents:\n schemas:\n FeatureMembership:\n title: FeatureMembership\n x-dcl-id: projects/{{project}}/locations/{{location}}/features/{{feature}}/memberships/{{membership}}\n x-dcl-parent-container: project\n x-dcl-has-create: true\n x-dcl-has-iam: false\n x-dcl-read-timeout: 0\n x-dcl-apply-timeout: 0\n x-dcl-delete-timeout: 0\n type: object\n required:\n - project\n - location\n - feature\n - membership\n properties:\n configmanagement:\n type: object\n x-dcl-go-name: Configmanagement\n x-dcl-go-type: FeatureMembershipConfigmanagement\n description: Config Management-specific spec.\n properties:\n binauthz:\n type: object\n x-dcl-go-name: Binauthz\n x-dcl-go-type: FeatureMembershipConfigmanagementBinauthz\n description: Binauthz configuration for the cluster.\n properties:\n enabled:\n type: boolean\n x-dcl-go-name: Enabled\n description: Whether binauthz is enabled in this cluster.\n configSync:\n type: object\n x-dcl-go-name: ConfigSync\n x-dcl-go-type: FeatureMembershipConfigmanagementConfigSync\n description: Config Sync configuration for the cluster.\n x-dcl-send-empty: true\n properties:\n git:\n type: object\n x-dcl-go-name: Git\n x-dcl-go-type: FeatureMembershipConfigmanagementConfigSyncGit\n properties:\n gcpServiceAccountEmail:\n type: string\n x-dcl-go-name: GcpServiceAccountEmail\n description: The GCP Service Account Email used for auth when\n secretType is gcpServiceAccount.\n x-dcl-references:\n - resource: Iam/ServiceAccount\n field: email\n httpsProxy:\n type: string\n x-dcl-go-name: HttpsProxy\n description: URL for the HTTPS proxy to be used when communicating\n with the Git repo.\n policyDir:\n type: string\n x-dcl-go-name: PolicyDir\n description: 'The path within the Git repository that represents\n the top level of the repo to sync. Default: the root directory\n of the repository.'\n secretType:\n type: string\n x-dcl-go-name: SecretType\n description: Type of secret configured for access to the Git\n repo. Must be one of ssh, cookiefile, gcenode, token, gcpserviceaccount\n or none. The validation of this is case-sensitive.\n syncBranch:\n type: string\n x-dcl-go-name: SyncBranch\n description: 'The branch of the repository to sync from. Default:\n master.'\n syncRepo:\n type: string\n x-dcl-go-name: SyncRepo\n description: The URL of the Git repository to use as the source\n of truth.\n syncRev:\n type: string\n x-dcl-go-name: SyncRev\n description: Git revision (tag or hash) to check out. Default\n HEAD.\n syncWaitSecs:\n type: string\n x-dcl-go-name: SyncWaitSecs\n description: 'Period in seconds between consecutive syncs. Default:\n 15.'\n oci:\n type: object\n x-dcl-go-name: Oci\n x-dcl-go-type: FeatureMembershipConfigmanagementConfigSyncOci\n properties:\n gcpServiceAccountEmail:\n type: string\n x-dcl-go-name: GcpServiceAccountEmail\n description: 'The GCP Service Account Email used for auth when\n secret_type is gcpserviceaccount. '\n x-dcl-references:\n - resource: Iam/ServiceAccount\n field: email\n policyDir:\n type: string\n x-dcl-go-name: PolicyDir\n description: 'The absolute path of the directory that contains\n the local resources. Default: the root directory of the image.'\n secretType:\n type: string\n x-dcl-go-name: SecretType\n description: Type of secret configured for access to the OCI\n Image. Must be one of gcenode, gcpserviceaccount or none.\n The validation of this is case-sensitive.\n syncRepo:\n type: string\n x-dcl-go-name: SyncRepo\n description: The OCI image repository URL for the package to\n sync from. e.g. LOCATION-docker.pkg.dev/PROJECT_ID/REPOSITORY_NAME/PACKAGE_NAME.\n syncWaitSecs:\n type: string\n x-dcl-go-name: SyncWaitSecs\n description: 'Period in seconds(int64 format) between consecutive\n syncs. Default: 15.'\n preventDrift:\n type: boolean\n x-dcl-go-name: PreventDrift\n description: Set to true to enable the Config Sync admission webhook\n to prevent drifts. If set to `false`, disables the Config Sync\n admission webhook and does not prevent drifts.\n x-dcl-server-default: true\n sourceFormat:\n type: string\n x-dcl-go-name: SourceFormat\n description: Specifies whether the Config Sync Repo is in \"hierarchical\"\n or \"unstructured\" mode.\n hierarchyController:\n type: object\n x-dcl-go-name: HierarchyController\n x-dcl-go-type: FeatureMembershipConfigmanagementHierarchyController\n description: Hierarchy Controller configuration for the cluster.\n properties:\n enableHierarchicalResourceQuota:\n type: boolean\n x-dcl-go-name: EnableHierarchicalResourceQuota\n description: Whether hierarchical resource quota is enabled in this\n cluster.\n enablePodTreeLabels:\n type: boolean\n x-dcl-go-name: EnablePodTreeLabels\n description: Whether pod tree labels are enabled in this cluster.\n enabled:\n type: boolean\n x-dcl-go-name: Enabled\n description: Whether Hierarchy Controller is enabled in this cluster.\n policyController:\n type: object\n x-dcl-go-name: PolicyController\n x-dcl-go-type: FeatureMembershipConfigmanagementPolicyController\n description: Policy Controller configuration for the cluster.\n properties:\n auditIntervalSeconds:\n type: string\n x-dcl-go-name: AuditIntervalSeconds\n description: Sets the interval for Policy Controller Audit Scans\n (in seconds). When set to 0, this disables audit functionality\n altogether.\n enabled:\n type: boolean\n x-dcl-go-name: Enabled\n description: Enables the installation of Policy Controller. If false,\n the rest of PolicyController fields take no effect.\n exemptableNamespaces:\n type: array\n x-dcl-go-name: ExemptableNamespaces\n description: The set of namespaces that are excluded from Policy\n Controller checks. Namespaces do not need to currently exist on\n the cluster.\n x-dcl-send-empty: true\n x-dcl-list-type: list\n items:\n type: string\n x-dcl-go-type: string\n logDeniesEnabled:\n type: boolean\n x-dcl-go-name: LogDeniesEnabled\n description: Logs all denies and dry run failures.\n monitoring:\n type: object\n x-dcl-go-name: Monitoring\n x-dcl-go-type: FeatureMembershipConfigmanagementPolicyControllerMonitoring\n description: 'Specifies the backends Policy Controller should export\n metrics to. For example, to specify metrics should be exported\n to Cloud Monitoring and Prometheus, specify backends: [\"cloudmonitoring\",\n \"prometheus\"]. Default: [\"cloudmonitoring\", \"prometheus\"]'\n x-dcl-server-default: true\n properties:\n backends:\n type: array\n x-dcl-go-name: Backends\n description: ' Specifies the list of backends Policy Controller\n will export to. Specifying an empty value `[]` disables metrics\n export.'\n x-dcl-server-default: true\n x-dcl-send-empty: true\n x-dcl-list-type: list\n items:\n type: string\n x-dcl-go-type: FeatureMembershipConfigmanagementPolicyControllerMonitoringBackendsEnum\n enum:\n - MONITORING_BACKEND_UNSPECIFIED\n - PROMETHEUS\n - CLOUD_MONITORING\n mutationEnabled:\n type: boolean\n x-dcl-go-name: MutationEnabled\n description: Enable or disable mutation in policy controller. If\n true, mutation CRDs, webhook and controller deployment will be\n deployed to the cluster.\n referentialRulesEnabled:\n type: boolean\n x-dcl-go-name: ReferentialRulesEnabled\n description: Enables the ability to use Constraint Templates that\n reference to objects other than the object currently being evaluated.\n templateLibraryInstalled:\n type: boolean\n x-dcl-go-name: TemplateLibraryInstalled\n description: Installs the default template library along with Policy\n Controller.\n version:\n type: string\n x-dcl-go-name: Version\n description: Optional. Version of ACM to install. Defaults to the latest\n version.\n x-dcl-server-default: true\n feature:\n type: string\n x-dcl-go-name: Feature\n description: The name of the feature\n x-kubernetes-immutable: true\n x-dcl-references:\n - resource: Gkehub/Feature\n field: name\n parent: true\n location:\n type: string\n x-dcl-go-name: Location\n description: The location of the feature\n x-kubernetes-immutable: true\n membership:\n type: string\n x-dcl-go-name: Membership\n description: The name of the membership\n x-kubernetes-immutable: true\n x-dcl-references:\n - resource: Gkehub/Membership\n field: name\n mesh:\n type: object\n x-dcl-go-name: Mesh\n x-dcl-go-type: FeatureMembershipMesh\n description: Manage Mesh Features\n properties:\n controlPlane:\n type: string\n x-dcl-go-name: ControlPlane\n x-dcl-go-type: FeatureMembershipMeshControlPlaneEnum\n description: '**DEPRECATED** Whether to automatically manage Service\n Mesh control planes. Possible values: CONTROL_PLANE_MANAGEMENT_UNSPECIFIED,\n AUTOMATIC, MANUAL'\n enum:\n - CONTROL_PLANE_MANAGEMENT_UNSPECIFIED\n - AUTOMATIC\n - MANUAL\n management:\n type: string\n x-dcl-go-name: Management\n x-dcl-go-type: FeatureMembershipMeshManagementEnum\n description: 'Whether to automatically manage Service Mesh. Possible\n values: MANAGEMENT_UNSPECIFIED, MANAGEMENT_AUTOMATIC, MANAGEMENT_MANUAL'\n enum:\n - MANAGEMENT_UNSPECIFIED\n - MANAGEMENT_AUTOMATIC\n - MANAGEMENT_MANUAL\n project:\n type: string\n x-dcl-go-name: Project\n description: The project of the feature\n x-kubernetes-immutable: true\n x-dcl-references:\n - resource: Cloudresourcemanager/Project\n field: name\n parent: true\n") -// 14991 bytes -// MD5: 708d8c65de4aea55a7491b84b2f38347 +// 15006 bytes +// MD5: 4edc5730b75bf43641c46eefe1c2cc6c diff --git a/services/google/gkehub/alpha/feature_membership_internal.go b/services/google/gkehub/alpha/feature_membership_internal.go index 116f24de2b..73ffe34e07 100755 --- a/services/google/gkehub/alpha/feature_membership_internal.go +++ b/services/google/gkehub/alpha/feature_membership_internal.go @@ -441,23 +441,26 @@ func canonicalizeNewFeatureMembershipMeshSet(c *Client, des, nw []FeatureMembers if des == nil { return nw } - var reorderedNew []FeatureMembershipMesh + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FeatureMembershipMesh for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFeatureMembershipMeshNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFeatureMembershipMesh(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFeatureMembershipMeshSlice(c *Client, des, nw []FeatureMembershipMesh) []FeatureMembershipMesh { @@ -564,23 +567,26 @@ func canonicalizeNewFeatureMembershipConfigmanagementSet(c *Client, des, nw []Fe if des == nil { return nw } - var reorderedNew []FeatureMembershipConfigmanagement + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FeatureMembershipConfigmanagement for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFeatureMembershipConfigmanagementNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFeatureMembershipConfigmanagement(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFeatureMembershipConfigmanagementSlice(c *Client, des, nw []FeatureMembershipConfigmanagement) []FeatureMembershipConfigmanagement { @@ -691,23 +697,26 @@ func canonicalizeNewFeatureMembershipConfigmanagementConfigSyncSet(c *Client, de if des == nil { return nw } - var reorderedNew []FeatureMembershipConfigmanagementConfigSync + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FeatureMembershipConfigmanagementConfigSync for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFeatureMembershipConfigmanagementConfigSyncNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFeatureMembershipConfigmanagementConfigSync(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFeatureMembershipConfigmanagementConfigSyncSlice(c *Client, des, nw []FeatureMembershipConfigmanagementConfigSync) []FeatureMembershipConfigmanagementConfigSync { @@ -860,23 +869,26 @@ func canonicalizeNewFeatureMembershipConfigmanagementConfigSyncGitSet(c *Client, if des == nil { return nw } - var reorderedNew []FeatureMembershipConfigmanagementConfigSyncGit + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FeatureMembershipConfigmanagementConfigSyncGit for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFeatureMembershipConfigmanagementConfigSyncGitNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFeatureMembershipConfigmanagementConfigSyncGit(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFeatureMembershipConfigmanagementConfigSyncGitSlice(c *Client, des, nw []FeatureMembershipConfigmanagementConfigSyncGit) []FeatureMembershipConfigmanagementConfigSyncGit { @@ -1005,23 +1017,26 @@ func canonicalizeNewFeatureMembershipConfigmanagementConfigSyncOciSet(c *Client, if des == nil { return nw } - var reorderedNew []FeatureMembershipConfigmanagementConfigSyncOci + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FeatureMembershipConfigmanagementConfigSyncOci for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFeatureMembershipConfigmanagementConfigSyncOciNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFeatureMembershipConfigmanagementConfigSyncOci(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFeatureMembershipConfigmanagementConfigSyncOciSlice(c *Client, des, nw []FeatureMembershipConfigmanagementConfigSyncOci) []FeatureMembershipConfigmanagementConfigSyncOci { @@ -1170,23 +1185,26 @@ func canonicalizeNewFeatureMembershipConfigmanagementPolicyControllerSet(c *Clie if des == nil { return nw } - var reorderedNew []FeatureMembershipConfigmanagementPolicyController + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FeatureMembershipConfigmanagementPolicyController for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFeatureMembershipConfigmanagementPolicyControllerNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFeatureMembershipConfigmanagementPolicyController(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFeatureMembershipConfigmanagementPolicyControllerSlice(c *Client, des, nw []FeatureMembershipConfigmanagementPolicyController) []FeatureMembershipConfigmanagementPolicyController { @@ -1282,23 +1300,26 @@ func canonicalizeNewFeatureMembershipConfigmanagementPolicyControllerMonitoringS if des == nil { return nw } - var reorderedNew []FeatureMembershipConfigmanagementPolicyControllerMonitoring + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FeatureMembershipConfigmanagementPolicyControllerMonitoring for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFeatureMembershipConfigmanagementPolicyControllerMonitoringNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFeatureMembershipConfigmanagementPolicyControllerMonitoring(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFeatureMembershipConfigmanagementPolicyControllerMonitoringSlice(c *Client, des, nw []FeatureMembershipConfigmanagementPolicyControllerMonitoring) []FeatureMembershipConfigmanagementPolicyControllerMonitoring { @@ -1397,23 +1418,26 @@ func canonicalizeNewFeatureMembershipConfigmanagementBinauthzSet(c *Client, des, if des == nil { return nw } - var reorderedNew []FeatureMembershipConfigmanagementBinauthz + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FeatureMembershipConfigmanagementBinauthz for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFeatureMembershipConfigmanagementBinauthzNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFeatureMembershipConfigmanagementBinauthz(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFeatureMembershipConfigmanagementBinauthzSlice(c *Client, des, nw []FeatureMembershipConfigmanagementBinauthz) []FeatureMembershipConfigmanagementBinauthz { @@ -1528,23 +1552,26 @@ func canonicalizeNewFeatureMembershipConfigmanagementHierarchyControllerSet(c *C if des == nil { return nw } - var reorderedNew []FeatureMembershipConfigmanagementHierarchyController + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FeatureMembershipConfigmanagementHierarchyController for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFeatureMembershipConfigmanagementHierarchyControllerNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFeatureMembershipConfigmanagementHierarchyController(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFeatureMembershipConfigmanagementHierarchyControllerSlice(c *Client, des, nw []FeatureMembershipConfigmanagementHierarchyController) []FeatureMembershipConfigmanagementHierarchyController { diff --git a/services/google/gkehub/alpha/feature_membership_schema.go b/services/google/gkehub/alpha/feature_membership_schema.go index c8e77f0646..7e87bb81b3 100755 --- a/services/google/gkehub/alpha/feature_membership_schema.go +++ b/services/google/gkehub/alpha/feature_membership_schema.go @@ -402,7 +402,7 @@ func DCLFeatureMembershipSchema() *dcl.Schema { Type: "string", GoName: "ControlPlane", GoType: "FeatureMembershipMeshControlPlaneEnum", - Description: "Whether to automatically manage Service Mesh control planes. Possible values: CONTROL_PLANE_MANAGEMENT_UNSPECIFIED, AUTOMATIC, MANUAL", + Description: "**DEPRECATED** Whether to automatically manage Service Mesh control planes. Possible values: CONTROL_PLANE_MANAGEMENT_UNSPECIFIED, AUTOMATIC, MANUAL", Enum: []string{ "CONTROL_PLANE_MANAGEMENT_UNSPECIFIED", "AUTOMATIC", diff --git a/services/google/gkehub/alpha/membership_internal.go b/services/google/gkehub/alpha/membership_internal.go index f82818c6e7..c7f98da68d 100755 --- a/services/google/gkehub/alpha/membership_internal.go +++ b/services/google/gkehub/alpha/membership_internal.go @@ -742,23 +742,26 @@ func canonicalizeNewMembershipEndpointSet(c *Client, des, nw []MembershipEndpoin if des == nil { return nw } - var reorderedNew []MembershipEndpoint + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipEndpoint for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipEndpointNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipEndpoint(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipEndpointSlice(c *Client, des, nw []MembershipEndpoint) []MembershipEndpoint { @@ -854,23 +857,26 @@ func canonicalizeNewMembershipEndpointGkeClusterSet(c *Client, des, nw []Members if des == nil { return nw } - var reorderedNew []MembershipEndpointGkeCluster + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipEndpointGkeCluster for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipEndpointGkeClusterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipEndpointGkeCluster(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipEndpointGkeClusterSlice(c *Client, des, nw []MembershipEndpointGkeCluster) []MembershipEndpointGkeCluster { @@ -966,23 +972,26 @@ func canonicalizeNewMembershipEndpointKubernetesMetadataSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []MembershipEndpointKubernetesMetadata + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipEndpointKubernetesMetadata for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipEndpointKubernetesMetadataNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipEndpointKubernetesMetadata(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipEndpointKubernetesMetadataSlice(c *Client, des, nw []MembershipEndpointKubernetesMetadata) []MembershipEndpointKubernetesMetadata { @@ -1083,23 +1092,26 @@ func canonicalizeNewMembershipEndpointKubernetesResourceSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []MembershipEndpointKubernetesResource + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipEndpointKubernetesResource for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipEndpointKubernetesResourceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipEndpointKubernetesResource(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipEndpointKubernetesResourceSlice(c *Client, des, nw []MembershipEndpointKubernetesResource) []MembershipEndpointKubernetesResource { @@ -1206,23 +1218,26 @@ func canonicalizeNewMembershipEndpointKubernetesResourceMembershipResourcesSet(c if des == nil { return nw } - var reorderedNew []MembershipEndpointKubernetesResourceMembershipResources + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipEndpointKubernetesResourceMembershipResources for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipEndpointKubernetesResourceMembershipResourcesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipEndpointKubernetesResourceMembershipResources(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipEndpointKubernetesResourceMembershipResourcesSlice(c *Client, des, nw []MembershipEndpointKubernetesResourceMembershipResources) []MembershipEndpointKubernetesResourceMembershipResources { @@ -1329,23 +1344,26 @@ func canonicalizeNewMembershipEndpointKubernetesResourceConnectResourcesSet(c *C if des == nil { return nw } - var reorderedNew []MembershipEndpointKubernetesResourceConnectResources + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipEndpointKubernetesResourceConnectResources for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipEndpointKubernetesResourceConnectResourcesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipEndpointKubernetesResourceConnectResources(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipEndpointKubernetesResourceConnectResourcesSlice(c *Client, des, nw []MembershipEndpointKubernetesResourceConnectResources) []MembershipEndpointKubernetesResourceConnectResources { @@ -1452,23 +1470,26 @@ func canonicalizeNewMembershipEndpointKubernetesResourceResourceOptionsSet(c *Cl if des == nil { return nw } - var reorderedNew []MembershipEndpointKubernetesResourceResourceOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipEndpointKubernetesResourceResourceOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipEndpointKubernetesResourceResourceOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipEndpointKubernetesResourceResourceOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipEndpointKubernetesResourceResourceOptionsSlice(c *Client, des, nw []MembershipEndpointKubernetesResourceResourceOptions) []MembershipEndpointKubernetesResourceResourceOptions { @@ -1557,23 +1578,26 @@ func canonicalizeNewMembershipStateSet(c *Client, des, nw []MembershipState) []M if des == nil { return nw } - var reorderedNew []MembershipState + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipState for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipStateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipState(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipStateSlice(c *Client, des, nw []MembershipState) []MembershipState { @@ -1678,23 +1702,26 @@ func canonicalizeNewMembershipAuthoritySet(c *Client, des, nw []MembershipAuthor if des == nil { return nw } - var reorderedNew []MembershipAuthority + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipAuthority for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipAuthorityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipAuthority(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipAuthoritySlice(c *Client, des, nw []MembershipAuthority) []MembershipAuthority { diff --git a/services/google/gkehub/beta/feature_internal.go b/services/google/gkehub/beta/feature_internal.go index 0dcc46c014..066a2c7059 100755 --- a/services/google/gkehub/beta/feature_internal.go +++ b/services/google/gkehub/beta/feature_internal.go @@ -547,23 +547,26 @@ func canonicalizeNewFeatureResourceStateSet(c *Client, des, nw []FeatureResource if des == nil { return nw } - var reorderedNew []FeatureResourceState + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FeatureResourceState for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFeatureResourceStateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFeatureResourceState(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFeatureResourceStateSlice(c *Client, des, nw []FeatureResourceState) []FeatureResourceState { @@ -656,23 +659,26 @@ func canonicalizeNewFeatureSpecSet(c *Client, des, nw []FeatureSpec) []FeatureSp if des == nil { return nw } - var reorderedNew []FeatureSpec + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FeatureSpec for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFeatureSpecNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFeatureSpec(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFeatureSpecSlice(c *Client, des, nw []FeatureSpec) []FeatureSpec { @@ -768,23 +774,26 @@ func canonicalizeNewFeatureSpecMulticlusteringressSet(c *Client, des, nw []Featu if des == nil { return nw } - var reorderedNew []FeatureSpecMulticlusteringress + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FeatureSpecMulticlusteringress for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFeatureSpecMulticlusteringressNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFeatureSpecMulticlusteringress(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFeatureSpecMulticlusteringressSlice(c *Client, des, nw []FeatureSpecMulticlusteringress) []FeatureSpecMulticlusteringress { @@ -875,23 +884,26 @@ func canonicalizeNewFeatureStateSet(c *Client, des, nw []FeatureState) []Feature if des == nil { return nw } - var reorderedNew []FeatureState + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FeatureState for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFeatureStateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFeatureState(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFeatureStateSlice(c *Client, des, nw []FeatureState) []FeatureState { @@ -987,23 +999,26 @@ func canonicalizeNewFeatureStateStateSet(c *Client, des, nw []FeatureStateState) if des == nil { return nw } - var reorderedNew []FeatureStateState + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FeatureStateState for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFeatureStateStateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFeatureStateState(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFeatureStateStateSlice(c *Client, des, nw []FeatureStateState) []FeatureStateState { diff --git a/services/google/gkehub/beta/feature_membership.yaml b/services/google/gkehub/beta/feature_membership.yaml index 288f81dbc1..e1434b4a31 100755 --- a/services/google/gkehub/beta/feature_membership.yaml +++ b/services/google/gkehub/beta/feature_membership.yaml @@ -334,9 +334,9 @@ components: type: string x-dcl-go-name: ControlPlane x-dcl-go-type: FeatureMembershipMeshControlPlaneEnum - description: 'Whether to automatically manage Service Mesh control planes. - Possible values: CONTROL_PLANE_MANAGEMENT_UNSPECIFIED, AUTOMATIC, - MANUAL' + description: '**DEPRECATED** Whether to automatically manage Service + Mesh control planes. Possible values: CONTROL_PLANE_MANAGEMENT_UNSPECIFIED, + AUTOMATIC, MANUAL' enum: - CONTROL_PLANE_MANAGEMENT_UNSPECIFIED - AUTOMATIC diff --git a/services/google/gkehub/beta/feature_membership_beta_yaml_embed.go b/services/google/gkehub/beta/feature_membership_beta_yaml_embed.go index c027e01996..ccf1862fb3 100755 --- a/services/google/gkehub/beta/feature_membership_beta_yaml_embed.go +++ b/services/google/gkehub/beta/feature_membership_beta_yaml_embed.go @@ -17,7 +17,7 @@ package beta // blaze-out/k8-fastbuild/genfiles/cloud/graphite/mmv2/services/google/gkehub/beta/feature_membership.yaml -var YAML_feature_membership = []byte("info:\n title: GkeHub/FeatureMembership\n description: The GkeHub FeatureMembership resource\n x-dcl-struct-name: FeatureMembership\n x-dcl-has-iam: false\n x-dcl-mutex: '{{project}}/{{location}}/{{feature}}'\npaths:\n get:\n description: The function used to get information about a FeatureMembership\n parameters:\n - name: featureMembership\n required: true\n description: A full instance of a FeatureMembership\n apply:\n description: The function used to apply information about a FeatureMembership\n parameters:\n - name: featureMembership\n required: true\n description: A full instance of a FeatureMembership\n delete:\n description: The function used to delete a FeatureMembership\n parameters:\n - name: featureMembership\n required: true\n description: A full instance of a FeatureMembership\n deleteAll:\n description: The function used to delete all FeatureMembership\n parameters:\n - name: project\n required: true\n schema:\n type: string\n - name: location\n required: true\n schema:\n type: string\n - name: feature\n required: true\n schema:\n type: string\n list:\n description: The function used to list information about many FeatureMembership\n parameters:\n - name: project\n required: true\n schema:\n type: string\n - name: location\n required: true\n schema:\n type: string\n - name: feature\n required: true\n schema:\n type: string\ncomponents:\n schemas:\n FeatureMembership:\n title: FeatureMembership\n x-dcl-id: projects/{{project}}/locations/{{location}}/features/{{feature}}/memberships/{{membership}}\n x-dcl-parent-container: project\n x-dcl-has-create: true\n x-dcl-has-iam: false\n x-dcl-read-timeout: 0\n x-dcl-apply-timeout: 0\n x-dcl-delete-timeout: 0\n type: object\n required:\n - project\n - location\n - feature\n - membership\n properties:\n configmanagement:\n type: object\n x-dcl-go-name: Configmanagement\n x-dcl-go-type: FeatureMembershipConfigmanagement\n description: Config Management-specific spec.\n properties:\n binauthz:\n type: object\n x-dcl-go-name: Binauthz\n x-dcl-go-type: FeatureMembershipConfigmanagementBinauthz\n description: Binauthz configuration for the cluster.\n properties:\n enabled:\n type: boolean\n x-dcl-go-name: Enabled\n description: Whether binauthz is enabled in this cluster.\n configSync:\n type: object\n x-dcl-go-name: ConfigSync\n x-dcl-go-type: FeatureMembershipConfigmanagementConfigSync\n description: Config Sync configuration for the cluster.\n x-dcl-send-empty: true\n properties:\n git:\n type: object\n x-dcl-go-name: Git\n x-dcl-go-type: FeatureMembershipConfigmanagementConfigSyncGit\n properties:\n gcpServiceAccountEmail:\n type: string\n x-dcl-go-name: GcpServiceAccountEmail\n description: The GCP Service Account Email used for auth when\n secretType is gcpServiceAccount.\n x-dcl-references:\n - resource: Iam/ServiceAccount\n field: email\n httpsProxy:\n type: string\n x-dcl-go-name: HttpsProxy\n description: URL for the HTTPS proxy to be used when communicating\n with the Git repo.\n policyDir:\n type: string\n x-dcl-go-name: PolicyDir\n description: 'The path within the Git repository that represents\n the top level of the repo to sync. Default: the root directory\n of the repository.'\n secretType:\n type: string\n x-dcl-go-name: SecretType\n description: Type of secret configured for access to the Git\n repo. Must be one of ssh, cookiefile, gcenode, token, gcpserviceaccount\n or none. The validation of this is case-sensitive.\n syncBranch:\n type: string\n x-dcl-go-name: SyncBranch\n description: 'The branch of the repository to sync from. Default:\n master.'\n syncRepo:\n type: string\n x-dcl-go-name: SyncRepo\n description: The URL of the Git repository to use as the source\n of truth.\n syncRev:\n type: string\n x-dcl-go-name: SyncRev\n description: Git revision (tag or hash) to check out. Default\n HEAD.\n syncWaitSecs:\n type: string\n x-dcl-go-name: SyncWaitSecs\n description: 'Period in seconds between consecutive syncs. Default:\n 15.'\n oci:\n type: object\n x-dcl-go-name: Oci\n x-dcl-go-type: FeatureMembershipConfigmanagementConfigSyncOci\n properties:\n gcpServiceAccountEmail:\n type: string\n x-dcl-go-name: GcpServiceAccountEmail\n description: 'The GCP Service Account Email used for auth when\n secret_type is gcpserviceaccount. '\n x-dcl-references:\n - resource: Iam/ServiceAccount\n field: email\n policyDir:\n type: string\n x-dcl-go-name: PolicyDir\n description: 'The absolute path of the directory that contains\n the local resources. Default: the root directory of the image.'\n secretType:\n type: string\n x-dcl-go-name: SecretType\n description: Type of secret configured for access to the OCI\n Image. Must be one of gcenode, gcpserviceaccount or none.\n The validation of this is case-sensitive.\n syncRepo:\n type: string\n x-dcl-go-name: SyncRepo\n description: The OCI image repository URL for the package to\n sync from. e.g. LOCATION-docker.pkg.dev/PROJECT_ID/REPOSITORY_NAME/PACKAGE_NAME.\n syncWaitSecs:\n type: string\n x-dcl-go-name: SyncWaitSecs\n description: 'Period in seconds(int64 format) between consecutive\n syncs. Default: 15.'\n preventDrift:\n type: boolean\n x-dcl-go-name: PreventDrift\n description: Set to true to enable the Config Sync admission webhook\n to prevent drifts. If set to `false`, disables the Config Sync\n admission webhook and does not prevent drifts.\n x-dcl-server-default: true\n sourceFormat:\n type: string\n x-dcl-go-name: SourceFormat\n description: Specifies whether the Config Sync Repo is in \"hierarchical\"\n or \"unstructured\" mode.\n hierarchyController:\n type: object\n x-dcl-go-name: HierarchyController\n x-dcl-go-type: FeatureMembershipConfigmanagementHierarchyController\n description: Hierarchy Controller configuration for the cluster.\n properties:\n enableHierarchicalResourceQuota:\n type: boolean\n x-dcl-go-name: EnableHierarchicalResourceQuota\n description: Whether hierarchical resource quota is enabled in this\n cluster.\n enablePodTreeLabels:\n type: boolean\n x-dcl-go-name: EnablePodTreeLabels\n description: Whether pod tree labels are enabled in this cluster.\n enabled:\n type: boolean\n x-dcl-go-name: Enabled\n description: Whether Hierarchy Controller is enabled in this cluster.\n policyController:\n type: object\n x-dcl-go-name: PolicyController\n x-dcl-go-type: FeatureMembershipConfigmanagementPolicyController\n description: Policy Controller configuration for the cluster.\n properties:\n auditIntervalSeconds:\n type: string\n x-dcl-go-name: AuditIntervalSeconds\n description: Sets the interval for Policy Controller Audit Scans\n (in seconds). When set to 0, this disables audit functionality\n altogether.\n enabled:\n type: boolean\n x-dcl-go-name: Enabled\n description: Enables the installation of Policy Controller. If false,\n the rest of PolicyController fields take no effect.\n exemptableNamespaces:\n type: array\n x-dcl-go-name: ExemptableNamespaces\n description: The set of namespaces that are excluded from Policy\n Controller checks. Namespaces do not need to currently exist on\n the cluster.\n x-dcl-send-empty: true\n x-dcl-list-type: list\n items:\n type: string\n x-dcl-go-type: string\n logDeniesEnabled:\n type: boolean\n x-dcl-go-name: LogDeniesEnabled\n description: Logs all denies and dry run failures.\n monitoring:\n type: object\n x-dcl-go-name: Monitoring\n x-dcl-go-type: FeatureMembershipConfigmanagementPolicyControllerMonitoring\n description: 'Specifies the backends Policy Controller should export\n metrics to. For example, to specify metrics should be exported\n to Cloud Monitoring and Prometheus, specify backends: [\"cloudmonitoring\",\n \"prometheus\"]. Default: [\"cloudmonitoring\", \"prometheus\"]'\n x-dcl-server-default: true\n properties:\n backends:\n type: array\n x-dcl-go-name: Backends\n description: ' Specifies the list of backends Policy Controller\n will export to. Specifying an empty value `[]` disables metrics\n export.'\n x-dcl-server-default: true\n x-dcl-send-empty: true\n x-dcl-list-type: list\n items:\n type: string\n x-dcl-go-type: FeatureMembershipConfigmanagementPolicyControllerMonitoringBackendsEnum\n enum:\n - MONITORING_BACKEND_UNSPECIFIED\n - PROMETHEUS\n - CLOUD_MONITORING\n mutationEnabled:\n type: boolean\n x-dcl-go-name: MutationEnabled\n description: Enable or disable mutation in policy controller. If\n true, mutation CRDs, webhook and controller deployment will be\n deployed to the cluster.\n referentialRulesEnabled:\n type: boolean\n x-dcl-go-name: ReferentialRulesEnabled\n description: Enables the ability to use Constraint Templates that\n reference to objects other than the object currently being evaluated.\n templateLibraryInstalled:\n type: boolean\n x-dcl-go-name: TemplateLibraryInstalled\n description: Installs the default template library along with Policy\n Controller.\n version:\n type: string\n x-dcl-go-name: Version\n description: Optional. Version of ACM to install. Defaults to the latest\n version.\n x-dcl-server-default: true\n feature:\n type: string\n x-dcl-go-name: Feature\n description: The name of the feature\n x-kubernetes-immutable: true\n x-dcl-references:\n - resource: Gkehub/Feature\n field: name\n parent: true\n location:\n type: string\n x-dcl-go-name: Location\n description: The location of the feature\n x-kubernetes-immutable: true\n membership:\n type: string\n x-dcl-go-name: Membership\n description: The name of the membership\n x-kubernetes-immutable: true\n x-dcl-references:\n - resource: Gkehub/Membership\n field: name\n mesh:\n type: object\n x-dcl-go-name: Mesh\n x-dcl-go-type: FeatureMembershipMesh\n description: Manage Mesh Features\n properties:\n controlPlane:\n type: string\n x-dcl-go-name: ControlPlane\n x-dcl-go-type: FeatureMembershipMeshControlPlaneEnum\n description: 'Whether to automatically manage Service Mesh control planes.\n Possible values: CONTROL_PLANE_MANAGEMENT_UNSPECIFIED, AUTOMATIC,\n MANUAL'\n enum:\n - CONTROL_PLANE_MANAGEMENT_UNSPECIFIED\n - AUTOMATIC\n - MANUAL\n management:\n type: string\n x-dcl-go-name: Management\n x-dcl-go-type: FeatureMembershipMeshManagementEnum\n description: 'Whether to automatically manage Service Mesh. Possible\n values: MANAGEMENT_UNSPECIFIED, MANAGEMENT_AUTOMATIC, MANAGEMENT_MANUAL'\n enum:\n - MANAGEMENT_UNSPECIFIED\n - MANAGEMENT_AUTOMATIC\n - MANAGEMENT_MANUAL\n project:\n type: string\n x-dcl-go-name: Project\n description: The project of the feature\n x-kubernetes-immutable: true\n x-dcl-references:\n - resource: Cloudresourcemanager/Project\n field: name\n parent: true\n") +var YAML_feature_membership = []byte("info:\n title: GkeHub/FeatureMembership\n description: The GkeHub FeatureMembership resource\n x-dcl-struct-name: FeatureMembership\n x-dcl-has-iam: false\n x-dcl-mutex: '{{project}}/{{location}}/{{feature}}'\npaths:\n get:\n description: The function used to get information about a FeatureMembership\n parameters:\n - name: featureMembership\n required: true\n description: A full instance of a FeatureMembership\n apply:\n description: The function used to apply information about a FeatureMembership\n parameters:\n - name: featureMembership\n required: true\n description: A full instance of a FeatureMembership\n delete:\n description: The function used to delete a FeatureMembership\n parameters:\n - name: featureMembership\n required: true\n description: A full instance of a FeatureMembership\n deleteAll:\n description: The function used to delete all FeatureMembership\n parameters:\n - name: project\n required: true\n schema:\n type: string\n - name: location\n required: true\n schema:\n type: string\n - name: feature\n required: true\n schema:\n type: string\n list:\n description: The function used to list information about many FeatureMembership\n parameters:\n - name: project\n required: true\n schema:\n type: string\n - name: location\n required: true\n schema:\n type: string\n - name: feature\n required: true\n schema:\n type: string\ncomponents:\n schemas:\n FeatureMembership:\n title: FeatureMembership\n x-dcl-id: projects/{{project}}/locations/{{location}}/features/{{feature}}/memberships/{{membership}}\n x-dcl-parent-container: project\n x-dcl-has-create: true\n x-dcl-has-iam: false\n x-dcl-read-timeout: 0\n x-dcl-apply-timeout: 0\n x-dcl-delete-timeout: 0\n type: object\n required:\n - project\n - location\n - feature\n - membership\n properties:\n configmanagement:\n type: object\n x-dcl-go-name: Configmanagement\n x-dcl-go-type: FeatureMembershipConfigmanagement\n description: Config Management-specific spec.\n properties:\n binauthz:\n type: object\n x-dcl-go-name: Binauthz\n x-dcl-go-type: FeatureMembershipConfigmanagementBinauthz\n description: Binauthz configuration for the cluster.\n properties:\n enabled:\n type: boolean\n x-dcl-go-name: Enabled\n description: Whether binauthz is enabled in this cluster.\n configSync:\n type: object\n x-dcl-go-name: ConfigSync\n x-dcl-go-type: FeatureMembershipConfigmanagementConfigSync\n description: Config Sync configuration for the cluster.\n x-dcl-send-empty: true\n properties:\n git:\n type: object\n x-dcl-go-name: Git\n x-dcl-go-type: FeatureMembershipConfigmanagementConfigSyncGit\n properties:\n gcpServiceAccountEmail:\n type: string\n x-dcl-go-name: GcpServiceAccountEmail\n description: The GCP Service Account Email used for auth when\n secretType is gcpServiceAccount.\n x-dcl-references:\n - resource: Iam/ServiceAccount\n field: email\n httpsProxy:\n type: string\n x-dcl-go-name: HttpsProxy\n description: URL for the HTTPS proxy to be used when communicating\n with the Git repo.\n policyDir:\n type: string\n x-dcl-go-name: PolicyDir\n description: 'The path within the Git repository that represents\n the top level of the repo to sync. Default: the root directory\n of the repository.'\n secretType:\n type: string\n x-dcl-go-name: SecretType\n description: Type of secret configured for access to the Git\n repo. Must be one of ssh, cookiefile, gcenode, token, gcpserviceaccount\n or none. The validation of this is case-sensitive.\n syncBranch:\n type: string\n x-dcl-go-name: SyncBranch\n description: 'The branch of the repository to sync from. Default:\n master.'\n syncRepo:\n type: string\n x-dcl-go-name: SyncRepo\n description: The URL of the Git repository to use as the source\n of truth.\n syncRev:\n type: string\n x-dcl-go-name: SyncRev\n description: Git revision (tag or hash) to check out. Default\n HEAD.\n syncWaitSecs:\n type: string\n x-dcl-go-name: SyncWaitSecs\n description: 'Period in seconds between consecutive syncs. Default:\n 15.'\n oci:\n type: object\n x-dcl-go-name: Oci\n x-dcl-go-type: FeatureMembershipConfigmanagementConfigSyncOci\n properties:\n gcpServiceAccountEmail:\n type: string\n x-dcl-go-name: GcpServiceAccountEmail\n description: 'The GCP Service Account Email used for auth when\n secret_type is gcpserviceaccount. '\n x-dcl-references:\n - resource: Iam/ServiceAccount\n field: email\n policyDir:\n type: string\n x-dcl-go-name: PolicyDir\n description: 'The absolute path of the directory that contains\n the local resources. Default: the root directory of the image.'\n secretType:\n type: string\n x-dcl-go-name: SecretType\n description: Type of secret configured for access to the OCI\n Image. Must be one of gcenode, gcpserviceaccount or none.\n The validation of this is case-sensitive.\n syncRepo:\n type: string\n x-dcl-go-name: SyncRepo\n description: The OCI image repository URL for the package to\n sync from. e.g. LOCATION-docker.pkg.dev/PROJECT_ID/REPOSITORY_NAME/PACKAGE_NAME.\n syncWaitSecs:\n type: string\n x-dcl-go-name: SyncWaitSecs\n description: 'Period in seconds(int64 format) between consecutive\n syncs. Default: 15.'\n preventDrift:\n type: boolean\n x-dcl-go-name: PreventDrift\n description: Set to true to enable the Config Sync admission webhook\n to prevent drifts. If set to `false`, disables the Config Sync\n admission webhook and does not prevent drifts.\n x-dcl-server-default: true\n sourceFormat:\n type: string\n x-dcl-go-name: SourceFormat\n description: Specifies whether the Config Sync Repo is in \"hierarchical\"\n or \"unstructured\" mode.\n hierarchyController:\n type: object\n x-dcl-go-name: HierarchyController\n x-dcl-go-type: FeatureMembershipConfigmanagementHierarchyController\n description: Hierarchy Controller configuration for the cluster.\n properties:\n enableHierarchicalResourceQuota:\n type: boolean\n x-dcl-go-name: EnableHierarchicalResourceQuota\n description: Whether hierarchical resource quota is enabled in this\n cluster.\n enablePodTreeLabels:\n type: boolean\n x-dcl-go-name: EnablePodTreeLabels\n description: Whether pod tree labels are enabled in this cluster.\n enabled:\n type: boolean\n x-dcl-go-name: Enabled\n description: Whether Hierarchy Controller is enabled in this cluster.\n policyController:\n type: object\n x-dcl-go-name: PolicyController\n x-dcl-go-type: FeatureMembershipConfigmanagementPolicyController\n description: Policy Controller configuration for the cluster.\n properties:\n auditIntervalSeconds:\n type: string\n x-dcl-go-name: AuditIntervalSeconds\n description: Sets the interval for Policy Controller Audit Scans\n (in seconds). When set to 0, this disables audit functionality\n altogether.\n enabled:\n type: boolean\n x-dcl-go-name: Enabled\n description: Enables the installation of Policy Controller. If false,\n the rest of PolicyController fields take no effect.\n exemptableNamespaces:\n type: array\n x-dcl-go-name: ExemptableNamespaces\n description: The set of namespaces that are excluded from Policy\n Controller checks. Namespaces do not need to currently exist on\n the cluster.\n x-dcl-send-empty: true\n x-dcl-list-type: list\n items:\n type: string\n x-dcl-go-type: string\n logDeniesEnabled:\n type: boolean\n x-dcl-go-name: LogDeniesEnabled\n description: Logs all denies and dry run failures.\n monitoring:\n type: object\n x-dcl-go-name: Monitoring\n x-dcl-go-type: FeatureMembershipConfigmanagementPolicyControllerMonitoring\n description: 'Specifies the backends Policy Controller should export\n metrics to. For example, to specify metrics should be exported\n to Cloud Monitoring and Prometheus, specify backends: [\"cloudmonitoring\",\n \"prometheus\"]. Default: [\"cloudmonitoring\", \"prometheus\"]'\n x-dcl-server-default: true\n properties:\n backends:\n type: array\n x-dcl-go-name: Backends\n description: ' Specifies the list of backends Policy Controller\n will export to. Specifying an empty value `[]` disables metrics\n export.'\n x-dcl-server-default: true\n x-dcl-send-empty: true\n x-dcl-list-type: list\n items:\n type: string\n x-dcl-go-type: FeatureMembershipConfigmanagementPolicyControllerMonitoringBackendsEnum\n enum:\n - MONITORING_BACKEND_UNSPECIFIED\n - PROMETHEUS\n - CLOUD_MONITORING\n mutationEnabled:\n type: boolean\n x-dcl-go-name: MutationEnabled\n description: Enable or disable mutation in policy controller. If\n true, mutation CRDs, webhook and controller deployment will be\n deployed to the cluster.\n referentialRulesEnabled:\n type: boolean\n x-dcl-go-name: ReferentialRulesEnabled\n description: Enables the ability to use Constraint Templates that\n reference to objects other than the object currently being evaluated.\n templateLibraryInstalled:\n type: boolean\n x-dcl-go-name: TemplateLibraryInstalled\n description: Installs the default template library along with Policy\n Controller.\n version:\n type: string\n x-dcl-go-name: Version\n description: Optional. Version of ACM to install. Defaults to the latest\n version.\n x-dcl-server-default: true\n feature:\n type: string\n x-dcl-go-name: Feature\n description: The name of the feature\n x-kubernetes-immutable: true\n x-dcl-references:\n - resource: Gkehub/Feature\n field: name\n parent: true\n location:\n type: string\n x-dcl-go-name: Location\n description: The location of the feature\n x-kubernetes-immutable: true\n membership:\n type: string\n x-dcl-go-name: Membership\n description: The name of the membership\n x-kubernetes-immutable: true\n x-dcl-references:\n - resource: Gkehub/Membership\n field: name\n mesh:\n type: object\n x-dcl-go-name: Mesh\n x-dcl-go-type: FeatureMembershipMesh\n description: Manage Mesh Features\n properties:\n controlPlane:\n type: string\n x-dcl-go-name: ControlPlane\n x-dcl-go-type: FeatureMembershipMeshControlPlaneEnum\n description: '**DEPRECATED** Whether to automatically manage Service\n Mesh control planes. Possible values: CONTROL_PLANE_MANAGEMENT_UNSPECIFIED,\n AUTOMATIC, MANUAL'\n enum:\n - CONTROL_PLANE_MANAGEMENT_UNSPECIFIED\n - AUTOMATIC\n - MANUAL\n management:\n type: string\n x-dcl-go-name: Management\n x-dcl-go-type: FeatureMembershipMeshManagementEnum\n description: 'Whether to automatically manage Service Mesh. Possible\n values: MANAGEMENT_UNSPECIFIED, MANAGEMENT_AUTOMATIC, MANAGEMENT_MANUAL'\n enum:\n - MANAGEMENT_UNSPECIFIED\n - MANAGEMENT_AUTOMATIC\n - MANAGEMENT_MANUAL\n project:\n type: string\n x-dcl-go-name: Project\n description: The project of the feature\n x-kubernetes-immutable: true\n x-dcl-references:\n - resource: Cloudresourcemanager/Project\n field: name\n parent: true\n") -// 14991 bytes -// MD5: 708d8c65de4aea55a7491b84b2f38347 +// 15006 bytes +// MD5: 4edc5730b75bf43641c46eefe1c2cc6c diff --git a/services/google/gkehub/beta/feature_membership_internal.go b/services/google/gkehub/beta/feature_membership_internal.go index 9f62a01342..6834ac747f 100755 --- a/services/google/gkehub/beta/feature_membership_internal.go +++ b/services/google/gkehub/beta/feature_membership_internal.go @@ -441,23 +441,26 @@ func canonicalizeNewFeatureMembershipMeshSet(c *Client, des, nw []FeatureMembers if des == nil { return nw } - var reorderedNew []FeatureMembershipMesh + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FeatureMembershipMesh for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFeatureMembershipMeshNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFeatureMembershipMesh(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFeatureMembershipMeshSlice(c *Client, des, nw []FeatureMembershipMesh) []FeatureMembershipMesh { @@ -564,23 +567,26 @@ func canonicalizeNewFeatureMembershipConfigmanagementSet(c *Client, des, nw []Fe if des == nil { return nw } - var reorderedNew []FeatureMembershipConfigmanagement + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FeatureMembershipConfigmanagement for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFeatureMembershipConfigmanagementNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFeatureMembershipConfigmanagement(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFeatureMembershipConfigmanagementSlice(c *Client, des, nw []FeatureMembershipConfigmanagement) []FeatureMembershipConfigmanagement { @@ -691,23 +697,26 @@ func canonicalizeNewFeatureMembershipConfigmanagementConfigSyncSet(c *Client, de if des == nil { return nw } - var reorderedNew []FeatureMembershipConfigmanagementConfigSync + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FeatureMembershipConfigmanagementConfigSync for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFeatureMembershipConfigmanagementConfigSyncNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFeatureMembershipConfigmanagementConfigSync(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFeatureMembershipConfigmanagementConfigSyncSlice(c *Client, des, nw []FeatureMembershipConfigmanagementConfigSync) []FeatureMembershipConfigmanagementConfigSync { @@ -860,23 +869,26 @@ func canonicalizeNewFeatureMembershipConfigmanagementConfigSyncGitSet(c *Client, if des == nil { return nw } - var reorderedNew []FeatureMembershipConfigmanagementConfigSyncGit + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FeatureMembershipConfigmanagementConfigSyncGit for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFeatureMembershipConfigmanagementConfigSyncGitNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFeatureMembershipConfigmanagementConfigSyncGit(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFeatureMembershipConfigmanagementConfigSyncGitSlice(c *Client, des, nw []FeatureMembershipConfigmanagementConfigSyncGit) []FeatureMembershipConfigmanagementConfigSyncGit { @@ -1005,23 +1017,26 @@ func canonicalizeNewFeatureMembershipConfigmanagementConfigSyncOciSet(c *Client, if des == nil { return nw } - var reorderedNew []FeatureMembershipConfigmanagementConfigSyncOci + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FeatureMembershipConfigmanagementConfigSyncOci for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFeatureMembershipConfigmanagementConfigSyncOciNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFeatureMembershipConfigmanagementConfigSyncOci(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFeatureMembershipConfigmanagementConfigSyncOciSlice(c *Client, des, nw []FeatureMembershipConfigmanagementConfigSyncOci) []FeatureMembershipConfigmanagementConfigSyncOci { @@ -1170,23 +1185,26 @@ func canonicalizeNewFeatureMembershipConfigmanagementPolicyControllerSet(c *Clie if des == nil { return nw } - var reorderedNew []FeatureMembershipConfigmanagementPolicyController + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FeatureMembershipConfigmanagementPolicyController for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFeatureMembershipConfigmanagementPolicyControllerNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFeatureMembershipConfigmanagementPolicyController(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFeatureMembershipConfigmanagementPolicyControllerSlice(c *Client, des, nw []FeatureMembershipConfigmanagementPolicyController) []FeatureMembershipConfigmanagementPolicyController { @@ -1282,23 +1300,26 @@ func canonicalizeNewFeatureMembershipConfigmanagementPolicyControllerMonitoringS if des == nil { return nw } - var reorderedNew []FeatureMembershipConfigmanagementPolicyControllerMonitoring + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FeatureMembershipConfigmanagementPolicyControllerMonitoring for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFeatureMembershipConfigmanagementPolicyControllerMonitoringNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFeatureMembershipConfigmanagementPolicyControllerMonitoring(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFeatureMembershipConfigmanagementPolicyControllerMonitoringSlice(c *Client, des, nw []FeatureMembershipConfigmanagementPolicyControllerMonitoring) []FeatureMembershipConfigmanagementPolicyControllerMonitoring { @@ -1397,23 +1418,26 @@ func canonicalizeNewFeatureMembershipConfigmanagementBinauthzSet(c *Client, des, if des == nil { return nw } - var reorderedNew []FeatureMembershipConfigmanagementBinauthz + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FeatureMembershipConfigmanagementBinauthz for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFeatureMembershipConfigmanagementBinauthzNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFeatureMembershipConfigmanagementBinauthz(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFeatureMembershipConfigmanagementBinauthzSlice(c *Client, des, nw []FeatureMembershipConfigmanagementBinauthz) []FeatureMembershipConfigmanagementBinauthz { @@ -1528,23 +1552,26 @@ func canonicalizeNewFeatureMembershipConfigmanagementHierarchyControllerSet(c *C if des == nil { return nw } - var reorderedNew []FeatureMembershipConfigmanagementHierarchyController + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []FeatureMembershipConfigmanagementHierarchyController for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareFeatureMembershipConfigmanagementHierarchyControllerNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewFeatureMembershipConfigmanagementHierarchyController(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewFeatureMembershipConfigmanagementHierarchyControllerSlice(c *Client, des, nw []FeatureMembershipConfigmanagementHierarchyController) []FeatureMembershipConfigmanagementHierarchyController { diff --git a/services/google/gkehub/beta/feature_membership_schema.go b/services/google/gkehub/beta/feature_membership_schema.go index fa9fa9cbc5..a4fbca22f0 100755 --- a/services/google/gkehub/beta/feature_membership_schema.go +++ b/services/google/gkehub/beta/feature_membership_schema.go @@ -402,7 +402,7 @@ func DCLFeatureMembershipSchema() *dcl.Schema { Type: "string", GoName: "ControlPlane", GoType: "FeatureMembershipMeshControlPlaneEnum", - Description: "Whether to automatically manage Service Mesh control planes. Possible values: CONTROL_PLANE_MANAGEMENT_UNSPECIFIED, AUTOMATIC, MANUAL", + Description: "**DEPRECATED** Whether to automatically manage Service Mesh control planes. Possible values: CONTROL_PLANE_MANAGEMENT_UNSPECIFIED, AUTOMATIC, MANUAL", Enum: []string{ "CONTROL_PLANE_MANAGEMENT_UNSPECIFIED", "AUTOMATIC", diff --git a/services/google/gkehub/beta/membership_internal.go b/services/google/gkehub/beta/membership_internal.go index fb2b75d8b5..c56d80e054 100755 --- a/services/google/gkehub/beta/membership_internal.go +++ b/services/google/gkehub/beta/membership_internal.go @@ -742,23 +742,26 @@ func canonicalizeNewMembershipEndpointSet(c *Client, des, nw []MembershipEndpoin if des == nil { return nw } - var reorderedNew []MembershipEndpoint + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipEndpoint for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipEndpointNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipEndpoint(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipEndpointSlice(c *Client, des, nw []MembershipEndpoint) []MembershipEndpoint { @@ -854,23 +857,26 @@ func canonicalizeNewMembershipEndpointGkeClusterSet(c *Client, des, nw []Members if des == nil { return nw } - var reorderedNew []MembershipEndpointGkeCluster + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipEndpointGkeCluster for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipEndpointGkeClusterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipEndpointGkeCluster(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipEndpointGkeClusterSlice(c *Client, des, nw []MembershipEndpointGkeCluster) []MembershipEndpointGkeCluster { @@ -966,23 +972,26 @@ func canonicalizeNewMembershipEndpointKubernetesMetadataSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []MembershipEndpointKubernetesMetadata + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipEndpointKubernetesMetadata for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipEndpointKubernetesMetadataNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipEndpointKubernetesMetadata(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipEndpointKubernetesMetadataSlice(c *Client, des, nw []MembershipEndpointKubernetesMetadata) []MembershipEndpointKubernetesMetadata { @@ -1083,23 +1092,26 @@ func canonicalizeNewMembershipEndpointKubernetesResourceSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []MembershipEndpointKubernetesResource + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipEndpointKubernetesResource for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipEndpointKubernetesResourceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipEndpointKubernetesResource(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipEndpointKubernetesResourceSlice(c *Client, des, nw []MembershipEndpointKubernetesResource) []MembershipEndpointKubernetesResource { @@ -1206,23 +1218,26 @@ func canonicalizeNewMembershipEndpointKubernetesResourceMembershipResourcesSet(c if des == nil { return nw } - var reorderedNew []MembershipEndpointKubernetesResourceMembershipResources + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipEndpointKubernetesResourceMembershipResources for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipEndpointKubernetesResourceMembershipResourcesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipEndpointKubernetesResourceMembershipResources(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipEndpointKubernetesResourceMembershipResourcesSlice(c *Client, des, nw []MembershipEndpointKubernetesResourceMembershipResources) []MembershipEndpointKubernetesResourceMembershipResources { @@ -1329,23 +1344,26 @@ func canonicalizeNewMembershipEndpointKubernetesResourceConnectResourcesSet(c *C if des == nil { return nw } - var reorderedNew []MembershipEndpointKubernetesResourceConnectResources + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipEndpointKubernetesResourceConnectResources for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipEndpointKubernetesResourceConnectResourcesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipEndpointKubernetesResourceConnectResources(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipEndpointKubernetesResourceConnectResourcesSlice(c *Client, des, nw []MembershipEndpointKubernetesResourceConnectResources) []MembershipEndpointKubernetesResourceConnectResources { @@ -1452,23 +1470,26 @@ func canonicalizeNewMembershipEndpointKubernetesResourceResourceOptionsSet(c *Cl if des == nil { return nw } - var reorderedNew []MembershipEndpointKubernetesResourceResourceOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipEndpointKubernetesResourceResourceOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipEndpointKubernetesResourceResourceOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipEndpointKubernetesResourceResourceOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipEndpointKubernetesResourceResourceOptionsSlice(c *Client, des, nw []MembershipEndpointKubernetesResourceResourceOptions) []MembershipEndpointKubernetesResourceResourceOptions { @@ -1557,23 +1578,26 @@ func canonicalizeNewMembershipStateSet(c *Client, des, nw []MembershipState) []M if des == nil { return nw } - var reorderedNew []MembershipState + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipState for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipStateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipState(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipStateSlice(c *Client, des, nw []MembershipState) []MembershipState { @@ -1678,23 +1702,26 @@ func canonicalizeNewMembershipAuthoritySet(c *Client, des, nw []MembershipAuthor if des == nil { return nw } - var reorderedNew []MembershipAuthority + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MembershipAuthority for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMembershipAuthorityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMembershipAuthority(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMembershipAuthoritySlice(c *Client, des, nw []MembershipAuthority) []MembershipAuthority { diff --git a/services/google/iam/alpha/role_internal.go b/services/google/iam/alpha/role_internal.go index bf1d79b4a3..725a0c586f 100755 --- a/services/google/iam/alpha/role_internal.go +++ b/services/google/iam/alpha/role_internal.go @@ -644,23 +644,26 @@ func canonicalizeNewRoleLocalizedValuesSet(c *Client, des, nw []RoleLocalizedVal if des == nil { return nw } - var reorderedNew []RoleLocalizedValues + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []RoleLocalizedValues for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareRoleLocalizedValuesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewRoleLocalizedValues(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewRoleLocalizedValuesSlice(c *Client, des, nw []RoleLocalizedValues) []RoleLocalizedValues { diff --git a/services/google/iam/alpha/service_account_internal.go b/services/google/iam/alpha/service_account_internal.go index aa0f8861aa..bbc8bd9cd0 100755 --- a/services/google/iam/alpha/service_account_internal.go +++ b/services/google/iam/alpha/service_account_internal.go @@ -592,23 +592,26 @@ func canonicalizeNewServiceAccountActasResourcesSet(c *Client, des, nw []Service if des == nil { return nw } - var reorderedNew []ServiceAccountActasResources + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceAccountActasResources for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceAccountActasResourcesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceAccountActasResources(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceAccountActasResourcesSlice(c *Client, des, nw []ServiceAccountActasResources) []ServiceAccountActasResources { @@ -707,23 +710,26 @@ func canonicalizeNewServiceAccountActasResourcesResourcesSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []ServiceAccountActasResourcesResources + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceAccountActasResourcesResources for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceAccountActasResourcesResourcesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceAccountActasResourcesResources(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceAccountActasResourcesResourcesSlice(c *Client, des, nw []ServiceAccountActasResourcesResources) []ServiceAccountActasResourcesResources { diff --git a/services/google/iam/alpha/workforce_pool_provider_internal.go b/services/google/iam/alpha/workforce_pool_provider_internal.go index a533f5b94b..0173ffab72 100755 --- a/services/google/iam/alpha/workforce_pool_provider_internal.go +++ b/services/google/iam/alpha/workforce_pool_provider_internal.go @@ -690,23 +690,26 @@ func canonicalizeNewWorkforcePoolProviderSamlSet(c *Client, des, nw []WorkforceP if des == nil { return nw } - var reorderedNew []WorkforcePoolProviderSaml + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkforcePoolProviderSaml for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkforcePoolProviderSamlNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkforcePoolProviderSaml(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkforcePoolProviderSamlSlice(c *Client, des, nw []WorkforcePoolProviderSaml) []WorkforcePoolProviderSaml { @@ -813,23 +816,26 @@ func canonicalizeNewWorkforcePoolProviderOidcSet(c *Client, des, nw []WorkforceP if des == nil { return nw } - var reorderedNew []WorkforcePoolProviderOidc + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkforcePoolProviderOidc for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkforcePoolProviderOidcNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkforcePoolProviderOidc(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkforcePoolProviderOidcSlice(c *Client, des, nw []WorkforcePoolProviderOidc) []WorkforcePoolProviderOidc { diff --git a/services/google/iam/alpha/workload_identity_pool_provider_internal.go b/services/google/iam/alpha/workload_identity_pool_provider_internal.go index 4e5f8e8197..ce9e65615a 100755 --- a/services/google/iam/alpha/workload_identity_pool_provider_internal.go +++ b/services/google/iam/alpha/workload_identity_pool_provider_internal.go @@ -705,23 +705,26 @@ func canonicalizeNewWorkloadIdentityPoolProviderAwsSet(c *Client, des, nw []Work if des == nil { return nw } - var reorderedNew []WorkloadIdentityPoolProviderAws + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkloadIdentityPoolProviderAws for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkloadIdentityPoolProviderAwsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkloadIdentityPoolProviderAws(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkloadIdentityPoolProviderAwsSlice(c *Client, des, nw []WorkloadIdentityPoolProviderAws) []WorkloadIdentityPoolProviderAws { @@ -828,23 +831,26 @@ func canonicalizeNewWorkloadIdentityPoolProviderOidcSet(c *Client, des, nw []Wor if des == nil { return nw } - var reorderedNew []WorkloadIdentityPoolProviderOidc + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkloadIdentityPoolProviderOidc for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkloadIdentityPoolProviderOidcNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkloadIdentityPoolProviderOidc(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkloadIdentityPoolProviderOidcSlice(c *Client, des, nw []WorkloadIdentityPoolProviderOidc) []WorkloadIdentityPoolProviderOidc { diff --git a/services/google/iam/beta/role_internal.go b/services/google/iam/beta/role_internal.go index f85b9dab51..e034447772 100755 --- a/services/google/iam/beta/role_internal.go +++ b/services/google/iam/beta/role_internal.go @@ -644,23 +644,26 @@ func canonicalizeNewRoleLocalizedValuesSet(c *Client, des, nw []RoleLocalizedVal if des == nil { return nw } - var reorderedNew []RoleLocalizedValues + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []RoleLocalizedValues for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareRoleLocalizedValuesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewRoleLocalizedValues(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewRoleLocalizedValuesSlice(c *Client, des, nw []RoleLocalizedValues) []RoleLocalizedValues { diff --git a/services/google/iam/beta/service_account_internal.go b/services/google/iam/beta/service_account_internal.go index 9df1ffc81a..98d600883a 100755 --- a/services/google/iam/beta/service_account_internal.go +++ b/services/google/iam/beta/service_account_internal.go @@ -592,23 +592,26 @@ func canonicalizeNewServiceAccountActasResourcesSet(c *Client, des, nw []Service if des == nil { return nw } - var reorderedNew []ServiceAccountActasResources + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceAccountActasResources for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceAccountActasResourcesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceAccountActasResources(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceAccountActasResourcesSlice(c *Client, des, nw []ServiceAccountActasResources) []ServiceAccountActasResources { @@ -707,23 +710,26 @@ func canonicalizeNewServiceAccountActasResourcesResourcesSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []ServiceAccountActasResourcesResources + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceAccountActasResourcesResources for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceAccountActasResourcesResourcesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceAccountActasResourcesResources(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceAccountActasResourcesResourcesSlice(c *Client, des, nw []ServiceAccountActasResourcesResources) []ServiceAccountActasResourcesResources { diff --git a/services/google/iam/beta/workforce_pool_provider_internal.go b/services/google/iam/beta/workforce_pool_provider_internal.go index 34e39e1d63..296acf6bfe 100755 --- a/services/google/iam/beta/workforce_pool_provider_internal.go +++ b/services/google/iam/beta/workforce_pool_provider_internal.go @@ -690,23 +690,26 @@ func canonicalizeNewWorkforcePoolProviderSamlSet(c *Client, des, nw []WorkforceP if des == nil { return nw } - var reorderedNew []WorkforcePoolProviderSaml + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkforcePoolProviderSaml for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkforcePoolProviderSamlNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkforcePoolProviderSaml(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkforcePoolProviderSamlSlice(c *Client, des, nw []WorkforcePoolProviderSaml) []WorkforcePoolProviderSaml { @@ -813,23 +816,26 @@ func canonicalizeNewWorkforcePoolProviderOidcSet(c *Client, des, nw []WorkforceP if des == nil { return nw } - var reorderedNew []WorkforcePoolProviderOidc + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkforcePoolProviderOidc for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkforcePoolProviderOidcNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkforcePoolProviderOidc(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkforcePoolProviderOidcSlice(c *Client, des, nw []WorkforcePoolProviderOidc) []WorkforcePoolProviderOidc { diff --git a/services/google/iam/beta/workload_identity_pool_provider_internal.go b/services/google/iam/beta/workload_identity_pool_provider_internal.go index b6cff94fc2..781fdc4e44 100755 --- a/services/google/iam/beta/workload_identity_pool_provider_internal.go +++ b/services/google/iam/beta/workload_identity_pool_provider_internal.go @@ -705,23 +705,26 @@ func canonicalizeNewWorkloadIdentityPoolProviderAwsSet(c *Client, des, nw []Work if des == nil { return nw } - var reorderedNew []WorkloadIdentityPoolProviderAws + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkloadIdentityPoolProviderAws for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkloadIdentityPoolProviderAwsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkloadIdentityPoolProviderAws(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkloadIdentityPoolProviderAwsSlice(c *Client, des, nw []WorkloadIdentityPoolProviderAws) []WorkloadIdentityPoolProviderAws { @@ -828,23 +831,26 @@ func canonicalizeNewWorkloadIdentityPoolProviderOidcSet(c *Client, des, nw []Wor if des == nil { return nw } - var reorderedNew []WorkloadIdentityPoolProviderOidc + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkloadIdentityPoolProviderOidc for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkloadIdentityPoolProviderOidcNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkloadIdentityPoolProviderOidc(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkloadIdentityPoolProviderOidcSlice(c *Client, des, nw []WorkloadIdentityPoolProviderOidc) []WorkloadIdentityPoolProviderOidc { diff --git a/services/google/iam/role_internal.go b/services/google/iam/role_internal.go index c0c426e10b..996700a329 100755 --- a/services/google/iam/role_internal.go +++ b/services/google/iam/role_internal.go @@ -644,23 +644,26 @@ func canonicalizeNewRoleLocalizedValuesSet(c *Client, des, nw []RoleLocalizedVal if des == nil { return nw } - var reorderedNew []RoleLocalizedValues + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []RoleLocalizedValues for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareRoleLocalizedValuesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewRoleLocalizedValues(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewRoleLocalizedValuesSlice(c *Client, des, nw []RoleLocalizedValues) []RoleLocalizedValues { diff --git a/services/google/iam/service_account_internal.go b/services/google/iam/service_account_internal.go index 8f13616a13..2059893b28 100755 --- a/services/google/iam/service_account_internal.go +++ b/services/google/iam/service_account_internal.go @@ -592,23 +592,26 @@ func canonicalizeNewServiceAccountActasResourcesSet(c *Client, des, nw []Service if des == nil { return nw } - var reorderedNew []ServiceAccountActasResources + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceAccountActasResources for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceAccountActasResourcesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceAccountActasResources(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceAccountActasResourcesSlice(c *Client, des, nw []ServiceAccountActasResources) []ServiceAccountActasResources { @@ -707,23 +710,26 @@ func canonicalizeNewServiceAccountActasResourcesResourcesSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []ServiceAccountActasResourcesResources + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceAccountActasResourcesResources for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceAccountActasResourcesResourcesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceAccountActasResourcesResources(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceAccountActasResourcesResourcesSlice(c *Client, des, nw []ServiceAccountActasResourcesResources) []ServiceAccountActasResourcesResources { diff --git a/services/google/iam/workforce_pool_provider_internal.go b/services/google/iam/workforce_pool_provider_internal.go index 6bf928cf9a..2b9ee97a6e 100755 --- a/services/google/iam/workforce_pool_provider_internal.go +++ b/services/google/iam/workforce_pool_provider_internal.go @@ -690,23 +690,26 @@ func canonicalizeNewWorkforcePoolProviderSamlSet(c *Client, des, nw []WorkforceP if des == nil { return nw } - var reorderedNew []WorkforcePoolProviderSaml + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkforcePoolProviderSaml for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkforcePoolProviderSamlNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkforcePoolProviderSaml(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkforcePoolProviderSamlSlice(c *Client, des, nw []WorkforcePoolProviderSaml) []WorkforcePoolProviderSaml { @@ -813,23 +816,26 @@ func canonicalizeNewWorkforcePoolProviderOidcSet(c *Client, des, nw []WorkforceP if des == nil { return nw } - var reorderedNew []WorkforcePoolProviderOidc + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkforcePoolProviderOidc for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkforcePoolProviderOidcNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkforcePoolProviderOidc(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkforcePoolProviderOidcSlice(c *Client, des, nw []WorkforcePoolProviderOidc) []WorkforcePoolProviderOidc { diff --git a/services/google/iam/workload_identity_pool_provider_internal.go b/services/google/iam/workload_identity_pool_provider_internal.go index 7b505fa5b2..31f58c12c2 100755 --- a/services/google/iam/workload_identity_pool_provider_internal.go +++ b/services/google/iam/workload_identity_pool_provider_internal.go @@ -705,23 +705,26 @@ func canonicalizeNewWorkloadIdentityPoolProviderAwsSet(c *Client, des, nw []Work if des == nil { return nw } - var reorderedNew []WorkloadIdentityPoolProviderAws + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkloadIdentityPoolProviderAws for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkloadIdentityPoolProviderAwsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkloadIdentityPoolProviderAws(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkloadIdentityPoolProviderAwsSlice(c *Client, des, nw []WorkloadIdentityPoolProviderAws) []WorkloadIdentityPoolProviderAws { @@ -828,23 +831,26 @@ func canonicalizeNewWorkloadIdentityPoolProviderOidcSet(c *Client, des, nw []Wor if des == nil { return nw } - var reorderedNew []WorkloadIdentityPoolProviderOidc + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []WorkloadIdentityPoolProviderOidc for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareWorkloadIdentityPoolProviderOidcNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewWorkloadIdentityPoolProviderOidc(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewWorkloadIdentityPoolProviderOidcSlice(c *Client, des, nw []WorkloadIdentityPoolProviderOidc) []WorkloadIdentityPoolProviderOidc { diff --git a/services/google/identitytoolkit/alpha/config_internal.go b/services/google/identitytoolkit/alpha/config_internal.go index 3b5f5be3c1..c46e34f92c 100755 --- a/services/google/identitytoolkit/alpha/config_internal.go +++ b/services/google/identitytoolkit/alpha/config_internal.go @@ -645,23 +645,26 @@ func canonicalizeNewConfigSignInSet(c *Client, des, nw []ConfigSignIn) []ConfigS if des == nil { return nw } - var reorderedNew []ConfigSignIn + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigSignIn for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigSignInNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigSignIn(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigSignInSlice(c *Client, des, nw []ConfigSignIn) []ConfigSignIn { @@ -769,23 +772,26 @@ func canonicalizeNewConfigSignInEmailSet(c *Client, des, nw []ConfigSignInEmail) if des == nil { return nw } - var reorderedNew []ConfigSignInEmail + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigSignInEmail for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigSignInEmailNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigSignInEmail(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigSignInEmailSlice(c *Client, des, nw []ConfigSignInEmail) []ConfigSignInEmail { @@ -881,23 +887,26 @@ func canonicalizeNewConfigSignInEmailHashConfigSet(c *Client, des, nw []ConfigSi if des == nil { return nw } - var reorderedNew []ConfigSignInEmailHashConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigSignInEmailHashConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigSignInEmailHashConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigSignInEmailHashConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigSignInEmailHashConfigSlice(c *Client, des, nw []ConfigSignInEmailHashConfig) []ConfigSignInEmailHashConfig { @@ -1004,23 +1013,26 @@ func canonicalizeNewConfigSignInPhoneNumberSet(c *Client, des, nw []ConfigSignIn if des == nil { return nw } - var reorderedNew []ConfigSignInPhoneNumber + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigSignInPhoneNumber for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigSignInPhoneNumberNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigSignInPhoneNumber(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigSignInPhoneNumberSlice(c *Client, des, nw []ConfigSignInPhoneNumber) []ConfigSignInPhoneNumber { @@ -1119,23 +1131,26 @@ func canonicalizeNewConfigSignInAnonymousSet(c *Client, des, nw []ConfigSignInAn if des == nil { return nw } - var reorderedNew []ConfigSignInAnonymous + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigSignInAnonymous for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigSignInAnonymousNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigSignInAnonymous(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigSignInAnonymousSlice(c *Client, des, nw []ConfigSignInAnonymous) []ConfigSignInAnonymous { @@ -1231,23 +1246,26 @@ func canonicalizeNewConfigSignInHashConfigSet(c *Client, des, nw []ConfigSignInH if des == nil { return nw } - var reorderedNew []ConfigSignInHashConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigSignInHashConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigSignInHashConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigSignInHashConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigSignInHashConfigSlice(c *Client, des, nw []ConfigSignInHashConfig) []ConfigSignInHashConfig { @@ -1350,23 +1368,26 @@ func canonicalizeNewConfigNotificationSet(c *Client, des, nw []ConfigNotificatio if des == nil { return nw } - var reorderedNew []ConfigNotification + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigNotification for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigNotificationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigNotification(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigNotificationSlice(c *Client, des, nw []ConfigNotification) []ConfigNotification { @@ -1483,23 +1504,26 @@ func canonicalizeNewConfigNotificationSendEmailSet(c *Client, des, nw []ConfigNo if des == nil { return nw } - var reorderedNew []ConfigNotificationSendEmail + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigNotificationSendEmail for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigNotificationSendEmailNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigNotificationSendEmail(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigNotificationSendEmailSlice(c *Client, des, nw []ConfigNotificationSendEmail) []ConfigNotificationSendEmail { @@ -1632,23 +1656,26 @@ func canonicalizeNewConfigNotificationSendEmailSmtpSet(c *Client, des, nw []Conf if des == nil { return nw } - var reorderedNew []ConfigNotificationSendEmailSmtp + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigNotificationSendEmailSmtp for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigNotificationSendEmailSmtpNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigNotificationSendEmailSmtp(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigNotificationSendEmailSmtpSlice(c *Client, des, nw []ConfigNotificationSendEmailSmtp) []ConfigNotificationSendEmailSmtp { @@ -1788,23 +1815,26 @@ func canonicalizeNewConfigNotificationSendEmailResetPasswordTemplateSet(c *Clien if des == nil { return nw } - var reorderedNew []ConfigNotificationSendEmailResetPasswordTemplate + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigNotificationSendEmailResetPasswordTemplate for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigNotificationSendEmailResetPasswordTemplateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigNotificationSendEmailResetPasswordTemplate(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigNotificationSendEmailResetPasswordTemplateSlice(c *Client, des, nw []ConfigNotificationSendEmailResetPasswordTemplate) []ConfigNotificationSendEmailResetPasswordTemplate { @@ -1944,23 +1974,26 @@ func canonicalizeNewConfigNotificationSendEmailVerifyEmailTemplateSet(c *Client, if des == nil { return nw } - var reorderedNew []ConfigNotificationSendEmailVerifyEmailTemplate + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigNotificationSendEmailVerifyEmailTemplate for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigNotificationSendEmailVerifyEmailTemplateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigNotificationSendEmailVerifyEmailTemplate(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigNotificationSendEmailVerifyEmailTemplateSlice(c *Client, des, nw []ConfigNotificationSendEmailVerifyEmailTemplate) []ConfigNotificationSendEmailVerifyEmailTemplate { @@ -2100,23 +2133,26 @@ func canonicalizeNewConfigNotificationSendEmailChangeEmailTemplateSet(c *Client, if des == nil { return nw } - var reorderedNew []ConfigNotificationSendEmailChangeEmailTemplate + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigNotificationSendEmailChangeEmailTemplate for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigNotificationSendEmailChangeEmailTemplateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigNotificationSendEmailChangeEmailTemplate(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigNotificationSendEmailChangeEmailTemplateSlice(c *Client, des, nw []ConfigNotificationSendEmailChangeEmailTemplate) []ConfigNotificationSendEmailChangeEmailTemplate { @@ -2221,23 +2257,26 @@ func canonicalizeNewConfigNotificationSendEmailDnsInfoSet(c *Client, des, nw []C if des == nil { return nw } - var reorderedNew []ConfigNotificationSendEmailDnsInfo + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigNotificationSendEmailDnsInfo for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigNotificationSendEmailDnsInfoNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigNotificationSendEmailDnsInfo(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigNotificationSendEmailDnsInfoSlice(c *Client, des, nw []ConfigNotificationSendEmailDnsInfo) []ConfigNotificationSendEmailDnsInfo { @@ -2377,23 +2416,26 @@ func canonicalizeNewConfigNotificationSendEmailRevertSecondFactorAdditionTemplat if des == nil { return nw } - var reorderedNew []ConfigNotificationSendEmailRevertSecondFactorAdditionTemplate + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigNotificationSendEmailRevertSecondFactorAdditionTemplate for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigNotificationSendEmailRevertSecondFactorAdditionTemplateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigNotificationSendEmailRevertSecondFactorAdditionTemplate(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigNotificationSendEmailRevertSecondFactorAdditionTemplateSlice(c *Client, des, nw []ConfigNotificationSendEmailRevertSecondFactorAdditionTemplate) []ConfigNotificationSendEmailRevertSecondFactorAdditionTemplate { @@ -2493,23 +2535,26 @@ func canonicalizeNewConfigNotificationSendSmsSet(c *Client, des, nw []ConfigNoti if des == nil { return nw } - var reorderedNew []ConfigNotificationSendSms + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigNotificationSendSms for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigNotificationSendSmsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigNotificationSendSms(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigNotificationSendSmsSlice(c *Client, des, nw []ConfigNotificationSendSms) []ConfigNotificationSendSms { @@ -2602,23 +2647,26 @@ func canonicalizeNewConfigNotificationSendSmsSmsTemplateSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []ConfigNotificationSendSmsSmsTemplate + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigNotificationSendSmsSmsTemplate for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigNotificationSendSmsSmsTemplateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigNotificationSendSmsSmsTemplate(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigNotificationSendSmsSmsTemplateSlice(c *Client, des, nw []ConfigNotificationSendSmsSmsTemplate) []ConfigNotificationSendSmsSmsTemplate { @@ -2711,23 +2759,26 @@ func canonicalizeNewConfigQuotaSet(c *Client, des, nw []ConfigQuota) []ConfigQuo if des == nil { return nw } - var reorderedNew []ConfigQuota + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigQuota for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigQuotaNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigQuota(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigQuotaSlice(c *Client, des, nw []ConfigQuota) []ConfigQuota { @@ -2838,23 +2889,26 @@ func canonicalizeNewConfigQuotaSignUpQuotaConfigSet(c *Client, des, nw []ConfigQ if des == nil { return nw } - var reorderedNew []ConfigQuotaSignUpQuotaConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigQuotaSignUpQuotaConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigQuotaSignUpQuotaConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigQuotaSignUpQuotaConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigQuotaSignUpQuotaConfigSlice(c *Client, des, nw []ConfigQuotaSignUpQuotaConfig) []ConfigQuotaSignUpQuotaConfig { @@ -2947,23 +3001,26 @@ func canonicalizeNewConfigMonitoringSet(c *Client, des, nw []ConfigMonitoring) [ if des == nil { return nw } - var reorderedNew []ConfigMonitoring + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigMonitoring for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigMonitoringNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigMonitoring(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigMonitoringSlice(c *Client, des, nw []ConfigMonitoring) []ConfigMonitoring { @@ -3062,23 +3119,26 @@ func canonicalizeNewConfigMonitoringRequestLoggingSet(c *Client, des, nw []Confi if des == nil { return nw } - var reorderedNew []ConfigMonitoringRequestLogging + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigMonitoringRequestLogging for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigMonitoringRequestLoggingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigMonitoringRequestLogging(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigMonitoringRequestLoggingSlice(c *Client, des, nw []ConfigMonitoringRequestLogging) []ConfigMonitoringRequestLogging { @@ -3183,23 +3243,26 @@ func canonicalizeNewConfigMultiTenantSet(c *Client, des, nw []ConfigMultiTenant) if des == nil { return nw } - var reorderedNew []ConfigMultiTenant + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigMultiTenant for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigMultiTenantNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigMultiTenant(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigMultiTenantSlice(c *Client, des, nw []ConfigMultiTenant) []ConfigMultiTenant { @@ -3298,23 +3361,26 @@ func canonicalizeNewConfigClientSet(c *Client, des, nw []ConfigClient) []ConfigC if des == nil { return nw } - var reorderedNew []ConfigClient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigClient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigClientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigClient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigClientSlice(c *Client, des, nw []ConfigClient) []ConfigClient { @@ -3421,23 +3487,26 @@ func canonicalizeNewConfigClientPermissionsSet(c *Client, des, nw []ConfigClient if des == nil { return nw } - var reorderedNew []ConfigClientPermissions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigClientPermissions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigClientPermissionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigClientPermissions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigClientPermissionsSlice(c *Client, des, nw []ConfigClientPermissions) []ConfigClientPermissions { @@ -3533,23 +3602,26 @@ func canonicalizeNewConfigMfaSet(c *Client, des, nw []ConfigMfa) []ConfigMfa { if des == nil { return nw } - var reorderedNew []ConfigMfa + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigMfa for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigMfaNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigMfa(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigMfaSlice(c *Client, des, nw []ConfigMfa) []ConfigMfa { @@ -3645,23 +3717,26 @@ func canonicalizeNewConfigBlockingFunctionsSet(c *Client, des, nw []ConfigBlocki if des == nil { return nw } - var reorderedNew []ConfigBlockingFunctions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigBlockingFunctions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigBlockingFunctionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigBlockingFunctions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigBlockingFunctionsSlice(c *Client, des, nw []ConfigBlockingFunctions) []ConfigBlockingFunctions { @@ -3757,23 +3832,26 @@ func canonicalizeNewConfigBlockingFunctionsTriggersSet(c *Client, des, nw []Conf if des == nil { return nw } - var reorderedNew []ConfigBlockingFunctionsTriggers + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigBlockingFunctionsTriggers for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigBlockingFunctionsTriggersNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigBlockingFunctionsTriggers(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigBlockingFunctionsTriggersSlice(c *Client, des, nw []ConfigBlockingFunctionsTriggers) []ConfigBlockingFunctionsTriggers { diff --git a/services/google/identitytoolkit/alpha/oauth_idp_config_internal.go b/services/google/identitytoolkit/alpha/oauth_idp_config_internal.go index 1cd53c6c95..f8a4db4f09 100755 --- a/services/google/identitytoolkit/alpha/oauth_idp_config_internal.go +++ b/services/google/identitytoolkit/alpha/oauth_idp_config_internal.go @@ -619,23 +619,26 @@ func canonicalizeNewOAuthIdpConfigResponseTypeSet(c *Client, des, nw []OAuthIdpC if des == nil { return nw } - var reorderedNew []OAuthIdpConfigResponseType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OAuthIdpConfigResponseType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOAuthIdpConfigResponseTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOAuthIdpConfigResponseType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOAuthIdpConfigResponseTypeSlice(c *Client, des, nw []OAuthIdpConfigResponseType) []OAuthIdpConfigResponseType { diff --git a/services/google/identitytoolkit/alpha/tenant_internal.go b/services/google/identitytoolkit/alpha/tenant_internal.go index 65a63df5f1..fa3aee8b59 100755 --- a/services/google/identitytoolkit/alpha/tenant_internal.go +++ b/services/google/identitytoolkit/alpha/tenant_internal.go @@ -623,23 +623,26 @@ func canonicalizeNewTenantMfaConfigSet(c *Client, des, nw []TenantMfaConfig) []T if des == nil { return nw } - var reorderedNew []TenantMfaConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TenantMfaConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTenantMfaConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTenantMfaConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTenantMfaConfigSlice(c *Client, des, nw []TenantMfaConfig) []TenantMfaConfig { diff --git a/services/google/identitytoolkit/alpha/tenant_oauth_idp_config_internal.go b/services/google/identitytoolkit/alpha/tenant_oauth_idp_config_internal.go index 0903597549..6c1bd677e6 100755 --- a/services/google/identitytoolkit/alpha/tenant_oauth_idp_config_internal.go +++ b/services/google/identitytoolkit/alpha/tenant_oauth_idp_config_internal.go @@ -634,23 +634,26 @@ func canonicalizeNewTenantOAuthIdpConfigResponseTypeSet(c *Client, des, nw []Ten if des == nil { return nw } - var reorderedNew []TenantOAuthIdpConfigResponseType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TenantOAuthIdpConfigResponseType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTenantOAuthIdpConfigResponseTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTenantOAuthIdpConfigResponseType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTenantOAuthIdpConfigResponseTypeSlice(c *Client, des, nw []TenantOAuthIdpConfigResponseType) []TenantOAuthIdpConfigResponseType { diff --git a/services/google/identitytoolkit/beta/config_internal.go b/services/google/identitytoolkit/beta/config_internal.go index 0b8361fb8d..b5080227e0 100755 --- a/services/google/identitytoolkit/beta/config_internal.go +++ b/services/google/identitytoolkit/beta/config_internal.go @@ -645,23 +645,26 @@ func canonicalizeNewConfigSignInSet(c *Client, des, nw []ConfigSignIn) []ConfigS if des == nil { return nw } - var reorderedNew []ConfigSignIn + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigSignIn for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigSignInNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigSignIn(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigSignInSlice(c *Client, des, nw []ConfigSignIn) []ConfigSignIn { @@ -769,23 +772,26 @@ func canonicalizeNewConfigSignInEmailSet(c *Client, des, nw []ConfigSignInEmail) if des == nil { return nw } - var reorderedNew []ConfigSignInEmail + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigSignInEmail for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigSignInEmailNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigSignInEmail(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigSignInEmailSlice(c *Client, des, nw []ConfigSignInEmail) []ConfigSignInEmail { @@ -881,23 +887,26 @@ func canonicalizeNewConfigSignInEmailHashConfigSet(c *Client, des, nw []ConfigSi if des == nil { return nw } - var reorderedNew []ConfigSignInEmailHashConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigSignInEmailHashConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigSignInEmailHashConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigSignInEmailHashConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigSignInEmailHashConfigSlice(c *Client, des, nw []ConfigSignInEmailHashConfig) []ConfigSignInEmailHashConfig { @@ -1004,23 +1013,26 @@ func canonicalizeNewConfigSignInPhoneNumberSet(c *Client, des, nw []ConfigSignIn if des == nil { return nw } - var reorderedNew []ConfigSignInPhoneNumber + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigSignInPhoneNumber for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigSignInPhoneNumberNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigSignInPhoneNumber(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigSignInPhoneNumberSlice(c *Client, des, nw []ConfigSignInPhoneNumber) []ConfigSignInPhoneNumber { @@ -1119,23 +1131,26 @@ func canonicalizeNewConfigSignInAnonymousSet(c *Client, des, nw []ConfigSignInAn if des == nil { return nw } - var reorderedNew []ConfigSignInAnonymous + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigSignInAnonymous for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigSignInAnonymousNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigSignInAnonymous(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigSignInAnonymousSlice(c *Client, des, nw []ConfigSignInAnonymous) []ConfigSignInAnonymous { @@ -1231,23 +1246,26 @@ func canonicalizeNewConfigSignInHashConfigSet(c *Client, des, nw []ConfigSignInH if des == nil { return nw } - var reorderedNew []ConfigSignInHashConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigSignInHashConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigSignInHashConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigSignInHashConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigSignInHashConfigSlice(c *Client, des, nw []ConfigSignInHashConfig) []ConfigSignInHashConfig { @@ -1350,23 +1368,26 @@ func canonicalizeNewConfigNotificationSet(c *Client, des, nw []ConfigNotificatio if des == nil { return nw } - var reorderedNew []ConfigNotification + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigNotification for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigNotificationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigNotification(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigNotificationSlice(c *Client, des, nw []ConfigNotification) []ConfigNotification { @@ -1483,23 +1504,26 @@ func canonicalizeNewConfigNotificationSendEmailSet(c *Client, des, nw []ConfigNo if des == nil { return nw } - var reorderedNew []ConfigNotificationSendEmail + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigNotificationSendEmail for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigNotificationSendEmailNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigNotificationSendEmail(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigNotificationSendEmailSlice(c *Client, des, nw []ConfigNotificationSendEmail) []ConfigNotificationSendEmail { @@ -1632,23 +1656,26 @@ func canonicalizeNewConfigNotificationSendEmailSmtpSet(c *Client, des, nw []Conf if des == nil { return nw } - var reorderedNew []ConfigNotificationSendEmailSmtp + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigNotificationSendEmailSmtp for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigNotificationSendEmailSmtpNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigNotificationSendEmailSmtp(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigNotificationSendEmailSmtpSlice(c *Client, des, nw []ConfigNotificationSendEmailSmtp) []ConfigNotificationSendEmailSmtp { @@ -1788,23 +1815,26 @@ func canonicalizeNewConfigNotificationSendEmailResetPasswordTemplateSet(c *Clien if des == nil { return nw } - var reorderedNew []ConfigNotificationSendEmailResetPasswordTemplate + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigNotificationSendEmailResetPasswordTemplate for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigNotificationSendEmailResetPasswordTemplateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigNotificationSendEmailResetPasswordTemplate(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigNotificationSendEmailResetPasswordTemplateSlice(c *Client, des, nw []ConfigNotificationSendEmailResetPasswordTemplate) []ConfigNotificationSendEmailResetPasswordTemplate { @@ -1944,23 +1974,26 @@ func canonicalizeNewConfigNotificationSendEmailVerifyEmailTemplateSet(c *Client, if des == nil { return nw } - var reorderedNew []ConfigNotificationSendEmailVerifyEmailTemplate + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigNotificationSendEmailVerifyEmailTemplate for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigNotificationSendEmailVerifyEmailTemplateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigNotificationSendEmailVerifyEmailTemplate(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigNotificationSendEmailVerifyEmailTemplateSlice(c *Client, des, nw []ConfigNotificationSendEmailVerifyEmailTemplate) []ConfigNotificationSendEmailVerifyEmailTemplate { @@ -2100,23 +2133,26 @@ func canonicalizeNewConfigNotificationSendEmailChangeEmailTemplateSet(c *Client, if des == nil { return nw } - var reorderedNew []ConfigNotificationSendEmailChangeEmailTemplate + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigNotificationSendEmailChangeEmailTemplate for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigNotificationSendEmailChangeEmailTemplateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigNotificationSendEmailChangeEmailTemplate(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigNotificationSendEmailChangeEmailTemplateSlice(c *Client, des, nw []ConfigNotificationSendEmailChangeEmailTemplate) []ConfigNotificationSendEmailChangeEmailTemplate { @@ -2221,23 +2257,26 @@ func canonicalizeNewConfigNotificationSendEmailDnsInfoSet(c *Client, des, nw []C if des == nil { return nw } - var reorderedNew []ConfigNotificationSendEmailDnsInfo + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigNotificationSendEmailDnsInfo for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigNotificationSendEmailDnsInfoNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigNotificationSendEmailDnsInfo(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigNotificationSendEmailDnsInfoSlice(c *Client, des, nw []ConfigNotificationSendEmailDnsInfo) []ConfigNotificationSendEmailDnsInfo { @@ -2377,23 +2416,26 @@ func canonicalizeNewConfigNotificationSendEmailRevertSecondFactorAdditionTemplat if des == nil { return nw } - var reorderedNew []ConfigNotificationSendEmailRevertSecondFactorAdditionTemplate + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigNotificationSendEmailRevertSecondFactorAdditionTemplate for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigNotificationSendEmailRevertSecondFactorAdditionTemplateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigNotificationSendEmailRevertSecondFactorAdditionTemplate(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigNotificationSendEmailRevertSecondFactorAdditionTemplateSlice(c *Client, des, nw []ConfigNotificationSendEmailRevertSecondFactorAdditionTemplate) []ConfigNotificationSendEmailRevertSecondFactorAdditionTemplate { @@ -2493,23 +2535,26 @@ func canonicalizeNewConfigNotificationSendSmsSet(c *Client, des, nw []ConfigNoti if des == nil { return nw } - var reorderedNew []ConfigNotificationSendSms + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigNotificationSendSms for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigNotificationSendSmsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigNotificationSendSms(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigNotificationSendSmsSlice(c *Client, des, nw []ConfigNotificationSendSms) []ConfigNotificationSendSms { @@ -2602,23 +2647,26 @@ func canonicalizeNewConfigNotificationSendSmsSmsTemplateSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []ConfigNotificationSendSmsSmsTemplate + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigNotificationSendSmsSmsTemplate for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigNotificationSendSmsSmsTemplateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigNotificationSendSmsSmsTemplate(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigNotificationSendSmsSmsTemplateSlice(c *Client, des, nw []ConfigNotificationSendSmsSmsTemplate) []ConfigNotificationSendSmsSmsTemplate { @@ -2711,23 +2759,26 @@ func canonicalizeNewConfigQuotaSet(c *Client, des, nw []ConfigQuota) []ConfigQuo if des == nil { return nw } - var reorderedNew []ConfigQuota + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigQuota for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigQuotaNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigQuota(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigQuotaSlice(c *Client, des, nw []ConfigQuota) []ConfigQuota { @@ -2838,23 +2889,26 @@ func canonicalizeNewConfigQuotaSignUpQuotaConfigSet(c *Client, des, nw []ConfigQ if des == nil { return nw } - var reorderedNew []ConfigQuotaSignUpQuotaConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigQuotaSignUpQuotaConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigQuotaSignUpQuotaConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigQuotaSignUpQuotaConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigQuotaSignUpQuotaConfigSlice(c *Client, des, nw []ConfigQuotaSignUpQuotaConfig) []ConfigQuotaSignUpQuotaConfig { @@ -2947,23 +3001,26 @@ func canonicalizeNewConfigMonitoringSet(c *Client, des, nw []ConfigMonitoring) [ if des == nil { return nw } - var reorderedNew []ConfigMonitoring + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigMonitoring for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigMonitoringNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigMonitoring(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigMonitoringSlice(c *Client, des, nw []ConfigMonitoring) []ConfigMonitoring { @@ -3062,23 +3119,26 @@ func canonicalizeNewConfigMonitoringRequestLoggingSet(c *Client, des, nw []Confi if des == nil { return nw } - var reorderedNew []ConfigMonitoringRequestLogging + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigMonitoringRequestLogging for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigMonitoringRequestLoggingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigMonitoringRequestLogging(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigMonitoringRequestLoggingSlice(c *Client, des, nw []ConfigMonitoringRequestLogging) []ConfigMonitoringRequestLogging { @@ -3183,23 +3243,26 @@ func canonicalizeNewConfigMultiTenantSet(c *Client, des, nw []ConfigMultiTenant) if des == nil { return nw } - var reorderedNew []ConfigMultiTenant + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigMultiTenant for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigMultiTenantNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigMultiTenant(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigMultiTenantSlice(c *Client, des, nw []ConfigMultiTenant) []ConfigMultiTenant { @@ -3298,23 +3361,26 @@ func canonicalizeNewConfigClientSet(c *Client, des, nw []ConfigClient) []ConfigC if des == nil { return nw } - var reorderedNew []ConfigClient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigClient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigClientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigClient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigClientSlice(c *Client, des, nw []ConfigClient) []ConfigClient { @@ -3421,23 +3487,26 @@ func canonicalizeNewConfigClientPermissionsSet(c *Client, des, nw []ConfigClient if des == nil { return nw } - var reorderedNew []ConfigClientPermissions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigClientPermissions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigClientPermissionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigClientPermissions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigClientPermissionsSlice(c *Client, des, nw []ConfigClientPermissions) []ConfigClientPermissions { @@ -3533,23 +3602,26 @@ func canonicalizeNewConfigMfaSet(c *Client, des, nw []ConfigMfa) []ConfigMfa { if des == nil { return nw } - var reorderedNew []ConfigMfa + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigMfa for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigMfaNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigMfa(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigMfaSlice(c *Client, des, nw []ConfigMfa) []ConfigMfa { @@ -3645,23 +3717,26 @@ func canonicalizeNewConfigBlockingFunctionsSet(c *Client, des, nw []ConfigBlocki if des == nil { return nw } - var reorderedNew []ConfigBlockingFunctions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigBlockingFunctions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigBlockingFunctionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigBlockingFunctions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigBlockingFunctionsSlice(c *Client, des, nw []ConfigBlockingFunctions) []ConfigBlockingFunctions { @@ -3757,23 +3832,26 @@ func canonicalizeNewConfigBlockingFunctionsTriggersSet(c *Client, des, nw []Conf if des == nil { return nw } - var reorderedNew []ConfigBlockingFunctionsTriggers + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigBlockingFunctionsTriggers for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigBlockingFunctionsTriggersNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigBlockingFunctionsTriggers(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigBlockingFunctionsTriggersSlice(c *Client, des, nw []ConfigBlockingFunctionsTriggers) []ConfigBlockingFunctionsTriggers { diff --git a/services/google/identitytoolkit/beta/oauth_idp_config_internal.go b/services/google/identitytoolkit/beta/oauth_idp_config_internal.go index 59736e5551..ec18882a79 100755 --- a/services/google/identitytoolkit/beta/oauth_idp_config_internal.go +++ b/services/google/identitytoolkit/beta/oauth_idp_config_internal.go @@ -619,23 +619,26 @@ func canonicalizeNewOAuthIdpConfigResponseTypeSet(c *Client, des, nw []OAuthIdpC if des == nil { return nw } - var reorderedNew []OAuthIdpConfigResponseType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OAuthIdpConfigResponseType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOAuthIdpConfigResponseTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOAuthIdpConfigResponseType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOAuthIdpConfigResponseTypeSlice(c *Client, des, nw []OAuthIdpConfigResponseType) []OAuthIdpConfigResponseType { diff --git a/services/google/identitytoolkit/beta/tenant_internal.go b/services/google/identitytoolkit/beta/tenant_internal.go index 39437f9d3e..d1b74e4251 100755 --- a/services/google/identitytoolkit/beta/tenant_internal.go +++ b/services/google/identitytoolkit/beta/tenant_internal.go @@ -623,23 +623,26 @@ func canonicalizeNewTenantMfaConfigSet(c *Client, des, nw []TenantMfaConfig) []T if des == nil { return nw } - var reorderedNew []TenantMfaConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TenantMfaConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTenantMfaConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTenantMfaConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTenantMfaConfigSlice(c *Client, des, nw []TenantMfaConfig) []TenantMfaConfig { diff --git a/services/google/identitytoolkit/beta/tenant_oauth_idp_config_internal.go b/services/google/identitytoolkit/beta/tenant_oauth_idp_config_internal.go index ab096c8ed6..dc1ff8aa5b 100755 --- a/services/google/identitytoolkit/beta/tenant_oauth_idp_config_internal.go +++ b/services/google/identitytoolkit/beta/tenant_oauth_idp_config_internal.go @@ -634,23 +634,26 @@ func canonicalizeNewTenantOAuthIdpConfigResponseTypeSet(c *Client, des, nw []Ten if des == nil { return nw } - var reorderedNew []TenantOAuthIdpConfigResponseType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TenantOAuthIdpConfigResponseType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTenantOAuthIdpConfigResponseTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTenantOAuthIdpConfigResponseType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTenantOAuthIdpConfigResponseTypeSlice(c *Client, des, nw []TenantOAuthIdpConfigResponseType) []TenantOAuthIdpConfigResponseType { diff --git a/services/google/identitytoolkit/config_internal.go b/services/google/identitytoolkit/config_internal.go index c2a0868126..2b1d1198e2 100755 --- a/services/google/identitytoolkit/config_internal.go +++ b/services/google/identitytoolkit/config_internal.go @@ -645,23 +645,26 @@ func canonicalizeNewConfigSignInSet(c *Client, des, nw []ConfigSignIn) []ConfigS if des == nil { return nw } - var reorderedNew []ConfigSignIn + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigSignIn for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigSignInNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigSignIn(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigSignInSlice(c *Client, des, nw []ConfigSignIn) []ConfigSignIn { @@ -769,23 +772,26 @@ func canonicalizeNewConfigSignInEmailSet(c *Client, des, nw []ConfigSignInEmail) if des == nil { return nw } - var reorderedNew []ConfigSignInEmail + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigSignInEmail for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigSignInEmailNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigSignInEmail(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigSignInEmailSlice(c *Client, des, nw []ConfigSignInEmail) []ConfigSignInEmail { @@ -881,23 +887,26 @@ func canonicalizeNewConfigSignInEmailHashConfigSet(c *Client, des, nw []ConfigSi if des == nil { return nw } - var reorderedNew []ConfigSignInEmailHashConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigSignInEmailHashConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigSignInEmailHashConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigSignInEmailHashConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigSignInEmailHashConfigSlice(c *Client, des, nw []ConfigSignInEmailHashConfig) []ConfigSignInEmailHashConfig { @@ -1004,23 +1013,26 @@ func canonicalizeNewConfigSignInPhoneNumberSet(c *Client, des, nw []ConfigSignIn if des == nil { return nw } - var reorderedNew []ConfigSignInPhoneNumber + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigSignInPhoneNumber for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigSignInPhoneNumberNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigSignInPhoneNumber(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigSignInPhoneNumberSlice(c *Client, des, nw []ConfigSignInPhoneNumber) []ConfigSignInPhoneNumber { @@ -1119,23 +1131,26 @@ func canonicalizeNewConfigSignInAnonymousSet(c *Client, des, nw []ConfigSignInAn if des == nil { return nw } - var reorderedNew []ConfigSignInAnonymous + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigSignInAnonymous for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigSignInAnonymousNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigSignInAnonymous(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigSignInAnonymousSlice(c *Client, des, nw []ConfigSignInAnonymous) []ConfigSignInAnonymous { @@ -1231,23 +1246,26 @@ func canonicalizeNewConfigSignInHashConfigSet(c *Client, des, nw []ConfigSignInH if des == nil { return nw } - var reorderedNew []ConfigSignInHashConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigSignInHashConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigSignInHashConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigSignInHashConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigSignInHashConfigSlice(c *Client, des, nw []ConfigSignInHashConfig) []ConfigSignInHashConfig { @@ -1350,23 +1368,26 @@ func canonicalizeNewConfigNotificationSet(c *Client, des, nw []ConfigNotificatio if des == nil { return nw } - var reorderedNew []ConfigNotification + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigNotification for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigNotificationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigNotification(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigNotificationSlice(c *Client, des, nw []ConfigNotification) []ConfigNotification { @@ -1483,23 +1504,26 @@ func canonicalizeNewConfigNotificationSendEmailSet(c *Client, des, nw []ConfigNo if des == nil { return nw } - var reorderedNew []ConfigNotificationSendEmail + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigNotificationSendEmail for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigNotificationSendEmailNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigNotificationSendEmail(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigNotificationSendEmailSlice(c *Client, des, nw []ConfigNotificationSendEmail) []ConfigNotificationSendEmail { @@ -1632,23 +1656,26 @@ func canonicalizeNewConfigNotificationSendEmailSmtpSet(c *Client, des, nw []Conf if des == nil { return nw } - var reorderedNew []ConfigNotificationSendEmailSmtp + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigNotificationSendEmailSmtp for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigNotificationSendEmailSmtpNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigNotificationSendEmailSmtp(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigNotificationSendEmailSmtpSlice(c *Client, des, nw []ConfigNotificationSendEmailSmtp) []ConfigNotificationSendEmailSmtp { @@ -1788,23 +1815,26 @@ func canonicalizeNewConfigNotificationSendEmailResetPasswordTemplateSet(c *Clien if des == nil { return nw } - var reorderedNew []ConfigNotificationSendEmailResetPasswordTemplate + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigNotificationSendEmailResetPasswordTemplate for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigNotificationSendEmailResetPasswordTemplateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigNotificationSendEmailResetPasswordTemplate(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigNotificationSendEmailResetPasswordTemplateSlice(c *Client, des, nw []ConfigNotificationSendEmailResetPasswordTemplate) []ConfigNotificationSendEmailResetPasswordTemplate { @@ -1944,23 +1974,26 @@ func canonicalizeNewConfigNotificationSendEmailVerifyEmailTemplateSet(c *Client, if des == nil { return nw } - var reorderedNew []ConfigNotificationSendEmailVerifyEmailTemplate + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigNotificationSendEmailVerifyEmailTemplate for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigNotificationSendEmailVerifyEmailTemplateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigNotificationSendEmailVerifyEmailTemplate(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigNotificationSendEmailVerifyEmailTemplateSlice(c *Client, des, nw []ConfigNotificationSendEmailVerifyEmailTemplate) []ConfigNotificationSendEmailVerifyEmailTemplate { @@ -2100,23 +2133,26 @@ func canonicalizeNewConfigNotificationSendEmailChangeEmailTemplateSet(c *Client, if des == nil { return nw } - var reorderedNew []ConfigNotificationSendEmailChangeEmailTemplate + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigNotificationSendEmailChangeEmailTemplate for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigNotificationSendEmailChangeEmailTemplateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigNotificationSendEmailChangeEmailTemplate(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigNotificationSendEmailChangeEmailTemplateSlice(c *Client, des, nw []ConfigNotificationSendEmailChangeEmailTemplate) []ConfigNotificationSendEmailChangeEmailTemplate { @@ -2221,23 +2257,26 @@ func canonicalizeNewConfigNotificationSendEmailDnsInfoSet(c *Client, des, nw []C if des == nil { return nw } - var reorderedNew []ConfigNotificationSendEmailDnsInfo + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigNotificationSendEmailDnsInfo for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigNotificationSendEmailDnsInfoNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigNotificationSendEmailDnsInfo(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigNotificationSendEmailDnsInfoSlice(c *Client, des, nw []ConfigNotificationSendEmailDnsInfo) []ConfigNotificationSendEmailDnsInfo { @@ -2377,23 +2416,26 @@ func canonicalizeNewConfigNotificationSendEmailRevertSecondFactorAdditionTemplat if des == nil { return nw } - var reorderedNew []ConfigNotificationSendEmailRevertSecondFactorAdditionTemplate + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigNotificationSendEmailRevertSecondFactorAdditionTemplate for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigNotificationSendEmailRevertSecondFactorAdditionTemplateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigNotificationSendEmailRevertSecondFactorAdditionTemplate(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigNotificationSendEmailRevertSecondFactorAdditionTemplateSlice(c *Client, des, nw []ConfigNotificationSendEmailRevertSecondFactorAdditionTemplate) []ConfigNotificationSendEmailRevertSecondFactorAdditionTemplate { @@ -2493,23 +2535,26 @@ func canonicalizeNewConfigNotificationSendSmsSet(c *Client, des, nw []ConfigNoti if des == nil { return nw } - var reorderedNew []ConfigNotificationSendSms + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigNotificationSendSms for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigNotificationSendSmsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigNotificationSendSms(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigNotificationSendSmsSlice(c *Client, des, nw []ConfigNotificationSendSms) []ConfigNotificationSendSms { @@ -2602,23 +2647,26 @@ func canonicalizeNewConfigNotificationSendSmsSmsTemplateSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []ConfigNotificationSendSmsSmsTemplate + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigNotificationSendSmsSmsTemplate for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigNotificationSendSmsSmsTemplateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigNotificationSendSmsSmsTemplate(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigNotificationSendSmsSmsTemplateSlice(c *Client, des, nw []ConfigNotificationSendSmsSmsTemplate) []ConfigNotificationSendSmsSmsTemplate { @@ -2711,23 +2759,26 @@ func canonicalizeNewConfigQuotaSet(c *Client, des, nw []ConfigQuota) []ConfigQuo if des == nil { return nw } - var reorderedNew []ConfigQuota + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigQuota for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigQuotaNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigQuota(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigQuotaSlice(c *Client, des, nw []ConfigQuota) []ConfigQuota { @@ -2838,23 +2889,26 @@ func canonicalizeNewConfigQuotaSignUpQuotaConfigSet(c *Client, des, nw []ConfigQ if des == nil { return nw } - var reorderedNew []ConfigQuotaSignUpQuotaConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigQuotaSignUpQuotaConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigQuotaSignUpQuotaConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigQuotaSignUpQuotaConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigQuotaSignUpQuotaConfigSlice(c *Client, des, nw []ConfigQuotaSignUpQuotaConfig) []ConfigQuotaSignUpQuotaConfig { @@ -2947,23 +3001,26 @@ func canonicalizeNewConfigMonitoringSet(c *Client, des, nw []ConfigMonitoring) [ if des == nil { return nw } - var reorderedNew []ConfigMonitoring + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigMonitoring for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigMonitoringNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigMonitoring(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigMonitoringSlice(c *Client, des, nw []ConfigMonitoring) []ConfigMonitoring { @@ -3062,23 +3119,26 @@ func canonicalizeNewConfigMonitoringRequestLoggingSet(c *Client, des, nw []Confi if des == nil { return nw } - var reorderedNew []ConfigMonitoringRequestLogging + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigMonitoringRequestLogging for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigMonitoringRequestLoggingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigMonitoringRequestLogging(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigMonitoringRequestLoggingSlice(c *Client, des, nw []ConfigMonitoringRequestLogging) []ConfigMonitoringRequestLogging { @@ -3183,23 +3243,26 @@ func canonicalizeNewConfigMultiTenantSet(c *Client, des, nw []ConfigMultiTenant) if des == nil { return nw } - var reorderedNew []ConfigMultiTenant + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigMultiTenant for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigMultiTenantNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigMultiTenant(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigMultiTenantSlice(c *Client, des, nw []ConfigMultiTenant) []ConfigMultiTenant { @@ -3298,23 +3361,26 @@ func canonicalizeNewConfigClientSet(c *Client, des, nw []ConfigClient) []ConfigC if des == nil { return nw } - var reorderedNew []ConfigClient + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigClient for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigClientNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigClient(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigClientSlice(c *Client, des, nw []ConfigClient) []ConfigClient { @@ -3421,23 +3487,26 @@ func canonicalizeNewConfigClientPermissionsSet(c *Client, des, nw []ConfigClient if des == nil { return nw } - var reorderedNew []ConfigClientPermissions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigClientPermissions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigClientPermissionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigClientPermissions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigClientPermissionsSlice(c *Client, des, nw []ConfigClientPermissions) []ConfigClientPermissions { @@ -3533,23 +3602,26 @@ func canonicalizeNewConfigMfaSet(c *Client, des, nw []ConfigMfa) []ConfigMfa { if des == nil { return nw } - var reorderedNew []ConfigMfa + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigMfa for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigMfaNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigMfa(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigMfaSlice(c *Client, des, nw []ConfigMfa) []ConfigMfa { @@ -3645,23 +3717,26 @@ func canonicalizeNewConfigBlockingFunctionsSet(c *Client, des, nw []ConfigBlocki if des == nil { return nw } - var reorderedNew []ConfigBlockingFunctions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigBlockingFunctions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigBlockingFunctionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigBlockingFunctions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigBlockingFunctionsSlice(c *Client, des, nw []ConfigBlockingFunctions) []ConfigBlockingFunctions { @@ -3757,23 +3832,26 @@ func canonicalizeNewConfigBlockingFunctionsTriggersSet(c *Client, des, nw []Conf if des == nil { return nw } - var reorderedNew []ConfigBlockingFunctionsTriggers + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConfigBlockingFunctionsTriggers for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConfigBlockingFunctionsTriggersNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConfigBlockingFunctionsTriggers(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConfigBlockingFunctionsTriggersSlice(c *Client, des, nw []ConfigBlockingFunctionsTriggers) []ConfigBlockingFunctionsTriggers { diff --git a/services/google/identitytoolkit/oauth_idp_config_internal.go b/services/google/identitytoolkit/oauth_idp_config_internal.go index 05d7247be5..653c88f8d0 100755 --- a/services/google/identitytoolkit/oauth_idp_config_internal.go +++ b/services/google/identitytoolkit/oauth_idp_config_internal.go @@ -619,23 +619,26 @@ func canonicalizeNewOAuthIdpConfigResponseTypeSet(c *Client, des, nw []OAuthIdpC if des == nil { return nw } - var reorderedNew []OAuthIdpConfigResponseType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OAuthIdpConfigResponseType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOAuthIdpConfigResponseTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOAuthIdpConfigResponseType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOAuthIdpConfigResponseTypeSlice(c *Client, des, nw []OAuthIdpConfigResponseType) []OAuthIdpConfigResponseType { diff --git a/services/google/identitytoolkit/tenant_internal.go b/services/google/identitytoolkit/tenant_internal.go index 985e6a3640..18e2ba2169 100755 --- a/services/google/identitytoolkit/tenant_internal.go +++ b/services/google/identitytoolkit/tenant_internal.go @@ -623,23 +623,26 @@ func canonicalizeNewTenantMfaConfigSet(c *Client, des, nw []TenantMfaConfig) []T if des == nil { return nw } - var reorderedNew []TenantMfaConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TenantMfaConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTenantMfaConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTenantMfaConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTenantMfaConfigSlice(c *Client, des, nw []TenantMfaConfig) []TenantMfaConfig { diff --git a/services/google/identitytoolkit/tenant_oauth_idp_config_internal.go b/services/google/identitytoolkit/tenant_oauth_idp_config_internal.go index c072d74cbc..80dbf475b4 100755 --- a/services/google/identitytoolkit/tenant_oauth_idp_config_internal.go +++ b/services/google/identitytoolkit/tenant_oauth_idp_config_internal.go @@ -634,23 +634,26 @@ func canonicalizeNewTenantOAuthIdpConfigResponseTypeSet(c *Client, des, nw []Ten if des == nil { return nw } - var reorderedNew []TenantOAuthIdpConfigResponseType + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TenantOAuthIdpConfigResponseType for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTenantOAuthIdpConfigResponseTypeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTenantOAuthIdpConfigResponseType(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTenantOAuthIdpConfigResponseTypeSlice(c *Client, des, nw []TenantOAuthIdpConfigResponseType) []TenantOAuthIdpConfigResponseType { diff --git a/services/google/logging/alpha/log_metric_internal.go b/services/google/logging/alpha/log_metric_internal.go index 4dbdb50072..51600caac4 100755 --- a/services/google/logging/alpha/log_metric_internal.go +++ b/services/google/logging/alpha/log_metric_internal.go @@ -712,23 +712,26 @@ func canonicalizeNewLogMetricMetricDescriptorSet(c *Client, des, nw []LogMetricM if des == nil { return nw } - var reorderedNew []LogMetricMetricDescriptor + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []LogMetricMetricDescriptor for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareLogMetricMetricDescriptorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewLogMetricMetricDescriptor(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewLogMetricMetricDescriptorSlice(c *Client, des, nw []LogMetricMetricDescriptor) []LogMetricMetricDescriptor { @@ -843,23 +846,26 @@ func canonicalizeNewLogMetricMetricDescriptorLabelsSet(c *Client, des, nw []LogM if des == nil { return nw } - var reorderedNew []LogMetricMetricDescriptorLabels + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []LogMetricMetricDescriptorLabels for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareLogMetricMetricDescriptorLabelsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewLogMetricMetricDescriptorLabels(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewLogMetricMetricDescriptorLabelsSlice(c *Client, des, nw []LogMetricMetricDescriptorLabels) []LogMetricMetricDescriptorLabels { @@ -966,23 +972,26 @@ func canonicalizeNewLogMetricMetricDescriptorMetadataSet(c *Client, des, nw []Lo if des == nil { return nw } - var reorderedNew []LogMetricMetricDescriptorMetadata + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []LogMetricMetricDescriptorMetadata for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareLogMetricMetricDescriptorMetadataNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewLogMetricMetricDescriptorMetadata(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewLogMetricMetricDescriptorMetadataSlice(c *Client, des, nw []LogMetricMetricDescriptorMetadata) []LogMetricMetricDescriptorMetadata { @@ -1109,23 +1118,26 @@ func canonicalizeNewLogMetricBucketOptionsSet(c *Client, des, nw []LogMetricBuck if des == nil { return nw } - var reorderedNew []LogMetricBucketOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []LogMetricBucketOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareLogMetricBucketOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewLogMetricBucketOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewLogMetricBucketOptionsSlice(c *Client, des, nw []LogMetricBucketOptions) []LogMetricBucketOptions { @@ -1233,23 +1245,26 @@ func canonicalizeNewLogMetricBucketOptionsLinearBucketsSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []LogMetricBucketOptionsLinearBuckets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []LogMetricBucketOptionsLinearBuckets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareLogMetricBucketOptionsLinearBucketsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewLogMetricBucketOptionsLinearBuckets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewLogMetricBucketOptionsLinearBucketsSlice(c *Client, des, nw []LogMetricBucketOptionsLinearBuckets) []LogMetricBucketOptionsLinearBuckets { @@ -1357,23 +1372,26 @@ func canonicalizeNewLogMetricBucketOptionsExponentialBucketsSet(c *Client, des, if des == nil { return nw } - var reorderedNew []LogMetricBucketOptionsExponentialBuckets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []LogMetricBucketOptionsExponentialBuckets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareLogMetricBucketOptionsExponentialBucketsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewLogMetricBucketOptionsExponentialBuckets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewLogMetricBucketOptionsExponentialBucketsSlice(c *Client, des, nw []LogMetricBucketOptionsExponentialBuckets) []LogMetricBucketOptionsExponentialBuckets { @@ -1469,23 +1487,26 @@ func canonicalizeNewLogMetricBucketOptionsExplicitBucketsSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []LogMetricBucketOptionsExplicitBuckets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []LogMetricBucketOptionsExplicitBuckets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareLogMetricBucketOptionsExplicitBucketsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewLogMetricBucketOptionsExplicitBuckets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewLogMetricBucketOptionsExplicitBucketsSlice(c *Client, des, nw []LogMetricBucketOptionsExplicitBuckets) []LogMetricBucketOptionsExplicitBuckets { diff --git a/services/google/logging/beta/log_metric_internal.go b/services/google/logging/beta/log_metric_internal.go index 2ea259a745..218cb9fd36 100755 --- a/services/google/logging/beta/log_metric_internal.go +++ b/services/google/logging/beta/log_metric_internal.go @@ -712,23 +712,26 @@ func canonicalizeNewLogMetricMetricDescriptorSet(c *Client, des, nw []LogMetricM if des == nil { return nw } - var reorderedNew []LogMetricMetricDescriptor + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []LogMetricMetricDescriptor for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareLogMetricMetricDescriptorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewLogMetricMetricDescriptor(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewLogMetricMetricDescriptorSlice(c *Client, des, nw []LogMetricMetricDescriptor) []LogMetricMetricDescriptor { @@ -843,23 +846,26 @@ func canonicalizeNewLogMetricMetricDescriptorLabelsSet(c *Client, des, nw []LogM if des == nil { return nw } - var reorderedNew []LogMetricMetricDescriptorLabels + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []LogMetricMetricDescriptorLabels for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareLogMetricMetricDescriptorLabelsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewLogMetricMetricDescriptorLabels(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewLogMetricMetricDescriptorLabelsSlice(c *Client, des, nw []LogMetricMetricDescriptorLabels) []LogMetricMetricDescriptorLabels { @@ -966,23 +972,26 @@ func canonicalizeNewLogMetricMetricDescriptorMetadataSet(c *Client, des, nw []Lo if des == nil { return nw } - var reorderedNew []LogMetricMetricDescriptorMetadata + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []LogMetricMetricDescriptorMetadata for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareLogMetricMetricDescriptorMetadataNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewLogMetricMetricDescriptorMetadata(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewLogMetricMetricDescriptorMetadataSlice(c *Client, des, nw []LogMetricMetricDescriptorMetadata) []LogMetricMetricDescriptorMetadata { @@ -1109,23 +1118,26 @@ func canonicalizeNewLogMetricBucketOptionsSet(c *Client, des, nw []LogMetricBuck if des == nil { return nw } - var reorderedNew []LogMetricBucketOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []LogMetricBucketOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareLogMetricBucketOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewLogMetricBucketOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewLogMetricBucketOptionsSlice(c *Client, des, nw []LogMetricBucketOptions) []LogMetricBucketOptions { @@ -1233,23 +1245,26 @@ func canonicalizeNewLogMetricBucketOptionsLinearBucketsSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []LogMetricBucketOptionsLinearBuckets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []LogMetricBucketOptionsLinearBuckets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareLogMetricBucketOptionsLinearBucketsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewLogMetricBucketOptionsLinearBuckets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewLogMetricBucketOptionsLinearBucketsSlice(c *Client, des, nw []LogMetricBucketOptionsLinearBuckets) []LogMetricBucketOptionsLinearBuckets { @@ -1357,23 +1372,26 @@ func canonicalizeNewLogMetricBucketOptionsExponentialBucketsSet(c *Client, des, if des == nil { return nw } - var reorderedNew []LogMetricBucketOptionsExponentialBuckets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []LogMetricBucketOptionsExponentialBuckets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareLogMetricBucketOptionsExponentialBucketsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewLogMetricBucketOptionsExponentialBuckets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewLogMetricBucketOptionsExponentialBucketsSlice(c *Client, des, nw []LogMetricBucketOptionsExponentialBuckets) []LogMetricBucketOptionsExponentialBuckets { @@ -1469,23 +1487,26 @@ func canonicalizeNewLogMetricBucketOptionsExplicitBucketsSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []LogMetricBucketOptionsExplicitBuckets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []LogMetricBucketOptionsExplicitBuckets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareLogMetricBucketOptionsExplicitBucketsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewLogMetricBucketOptionsExplicitBuckets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewLogMetricBucketOptionsExplicitBucketsSlice(c *Client, des, nw []LogMetricBucketOptionsExplicitBuckets) []LogMetricBucketOptionsExplicitBuckets { diff --git a/services/google/logging/log_metric_internal.go b/services/google/logging/log_metric_internal.go index 7ef63ecf9c..2101760533 100755 --- a/services/google/logging/log_metric_internal.go +++ b/services/google/logging/log_metric_internal.go @@ -712,23 +712,26 @@ func canonicalizeNewLogMetricMetricDescriptorSet(c *Client, des, nw []LogMetricM if des == nil { return nw } - var reorderedNew []LogMetricMetricDescriptor + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []LogMetricMetricDescriptor for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareLogMetricMetricDescriptorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewLogMetricMetricDescriptor(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewLogMetricMetricDescriptorSlice(c *Client, des, nw []LogMetricMetricDescriptor) []LogMetricMetricDescriptor { @@ -843,23 +846,26 @@ func canonicalizeNewLogMetricMetricDescriptorLabelsSet(c *Client, des, nw []LogM if des == nil { return nw } - var reorderedNew []LogMetricMetricDescriptorLabels + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []LogMetricMetricDescriptorLabels for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareLogMetricMetricDescriptorLabelsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewLogMetricMetricDescriptorLabels(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewLogMetricMetricDescriptorLabelsSlice(c *Client, des, nw []LogMetricMetricDescriptorLabels) []LogMetricMetricDescriptorLabels { @@ -966,23 +972,26 @@ func canonicalizeNewLogMetricMetricDescriptorMetadataSet(c *Client, des, nw []Lo if des == nil { return nw } - var reorderedNew []LogMetricMetricDescriptorMetadata + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []LogMetricMetricDescriptorMetadata for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareLogMetricMetricDescriptorMetadataNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewLogMetricMetricDescriptorMetadata(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewLogMetricMetricDescriptorMetadataSlice(c *Client, des, nw []LogMetricMetricDescriptorMetadata) []LogMetricMetricDescriptorMetadata { @@ -1109,23 +1118,26 @@ func canonicalizeNewLogMetricBucketOptionsSet(c *Client, des, nw []LogMetricBuck if des == nil { return nw } - var reorderedNew []LogMetricBucketOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []LogMetricBucketOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareLogMetricBucketOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewLogMetricBucketOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewLogMetricBucketOptionsSlice(c *Client, des, nw []LogMetricBucketOptions) []LogMetricBucketOptions { @@ -1233,23 +1245,26 @@ func canonicalizeNewLogMetricBucketOptionsLinearBucketsSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []LogMetricBucketOptionsLinearBuckets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []LogMetricBucketOptionsLinearBuckets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareLogMetricBucketOptionsLinearBucketsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewLogMetricBucketOptionsLinearBuckets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewLogMetricBucketOptionsLinearBucketsSlice(c *Client, des, nw []LogMetricBucketOptionsLinearBuckets) []LogMetricBucketOptionsLinearBuckets { @@ -1357,23 +1372,26 @@ func canonicalizeNewLogMetricBucketOptionsExponentialBucketsSet(c *Client, des, if des == nil { return nw } - var reorderedNew []LogMetricBucketOptionsExponentialBuckets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []LogMetricBucketOptionsExponentialBuckets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareLogMetricBucketOptionsExponentialBucketsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewLogMetricBucketOptionsExponentialBuckets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewLogMetricBucketOptionsExponentialBucketsSlice(c *Client, des, nw []LogMetricBucketOptionsExponentialBuckets) []LogMetricBucketOptionsExponentialBuckets { @@ -1469,23 +1487,26 @@ func canonicalizeNewLogMetricBucketOptionsExplicitBucketsSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []LogMetricBucketOptionsExplicitBuckets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []LogMetricBucketOptionsExplicitBuckets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareLogMetricBucketOptionsExplicitBucketsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewLogMetricBucketOptionsExplicitBuckets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewLogMetricBucketOptionsExplicitBucketsSlice(c *Client, des, nw []LogMetricBucketOptionsExplicitBuckets) []LogMetricBucketOptionsExplicitBuckets { diff --git a/services/google/monitoring/alpha/dashboard_internal.go b/services/google/monitoring/alpha/dashboard_internal.go index f2064075b7..8b36034491 100755 --- a/services/google/monitoring/alpha/dashboard_internal.go +++ b/services/google/monitoring/alpha/dashboard_internal.go @@ -1978,23 +1978,26 @@ func canonicalizeNewDashboardGridLayoutSet(c *Client, des, nw []DashboardGridLay if des == nil { return nw } - var reorderedNew []DashboardGridLayout + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayout for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayout(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutSlice(c *Client, des, nw []DashboardGridLayout) []DashboardGridLayout { @@ -2153,23 +2156,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsSet(c *Client, des, nw []Dashboard if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsSlice(c *Client, des, nw []DashboardGridLayoutWidgets) []DashboardGridLayoutWidgets { @@ -2278,23 +2284,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartSet(c *Client, des, nw []Da if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChart + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChart for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChart(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChart) []DashboardGridLayoutWidgetsXyChart { @@ -2409,23 +2418,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsSet(c *Client, des, if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSets) []DashboardGridLayoutWidgetsXyChartDataSets { @@ -2536,23 +2548,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQuerySet( if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQuery + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQuery for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQuery(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQuerySlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQuery) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQuery { @@ -2657,23 +2672,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter { @@ -2792,23 +2810,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregationSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation { @@ -2927,23 +2948,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation { @@ -3051,23 +3075,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter { @@ -3166,23 +3193,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio { @@ -3283,23 +3313,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator { @@ -3418,23 +3451,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation { @@ -3535,23 +3571,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator { @@ -3670,23 +3709,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation { @@ -3805,23 +3847,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation { @@ -3929,23 +3974,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter { @@ -4062,23 +4110,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartThresholdsSet(c *Client, de if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartThresholds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartThresholds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartThresholdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartThresholds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartThresholdsSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartThresholds) []DashboardGridLayoutWidgetsXyChartThresholds { @@ -4183,23 +4234,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartXAxisSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartXAxis + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartXAxis for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartXAxisNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartXAxis(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartXAxisSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartXAxis) []DashboardGridLayoutWidgetsXyChartXAxis { @@ -4304,23 +4358,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartYAxisSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartYAxis + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartYAxis for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartYAxisNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartYAxis(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartYAxisSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartYAxis) []DashboardGridLayoutWidgetsXyChartYAxis { @@ -4416,23 +4473,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartChartOptionsSet(c *Client, if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartChartOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartChartOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartChartOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartChartOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartChartOptionsSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartChartOptions) []DashboardGridLayoutWidgetsXyChartChartOptions { @@ -4531,23 +4591,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecard + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecard for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecard(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecard) []DashboardGridLayoutWidgetsScorecard { @@ -4658,23 +4721,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQuerySet(c *Cli if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQuery + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQuery for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQuery(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQuerySlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQuery) []DashboardGridLayoutWidgetsScorecardTimeSeriesQuery { @@ -4779,23 +4845,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeries if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilter) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilter { @@ -4914,23 +4983,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeries if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation { @@ -5049,23 +5121,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeries if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation { @@ -5173,23 +5248,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeries if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter { @@ -5288,23 +5366,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeries if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio { @@ -5405,23 +5486,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeries if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator { @@ -5540,23 +5624,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeries if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation { @@ -5657,23 +5744,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeries if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator { @@ -5792,23 +5882,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeries if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation { @@ -5927,23 +6020,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeries if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation { @@ -6051,23 +6147,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeries if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter { @@ -6169,23 +6268,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardGaugeViewSet(c *Client, d if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardGaugeView + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardGaugeView for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardGaugeViewNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardGaugeView(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardGaugeViewSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardGaugeView) []DashboardGridLayoutWidgetsScorecardGaugeView { @@ -6290,23 +6392,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardSparkChartViewSet(c *Clie if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardSparkChartView + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardSparkChartView for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardSparkChartViewNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardSparkChartView(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardSparkChartViewSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardSparkChartView) []DashboardGridLayoutWidgetsScorecardSparkChartView { @@ -6423,23 +6528,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardThresholdsSet(c *Client, if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardThresholds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardThresholds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardThresholdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardThresholds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardThresholdsSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardThresholds) []DashboardGridLayoutWidgetsScorecardThresholds { @@ -6544,23 +6652,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsTextSet(c *Client, des, nw []Dashb if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsText + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsText for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsTextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsText(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsTextSlice(c *Client, des, nw []DashboardGridLayoutWidgetsText) []DashboardGridLayoutWidgetsText { @@ -6648,23 +6759,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsBlankSet(c *Client, des, nw []Dash if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsBlank + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsBlank for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsBlankNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsBlank(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsBlankSlice(c *Client, des, nw []DashboardGridLayoutWidgetsBlank) []DashboardGridLayoutWidgetsBlank { @@ -6771,23 +6885,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsLogsPanelSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsLogsPanel + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsLogsPanel for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsLogsPanelNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsLogsPanel(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsLogsPanelSlice(c *Client, des, nw []DashboardGridLayoutWidgetsLogsPanel) []DashboardGridLayoutWidgetsLogsPanel { @@ -6886,23 +7003,26 @@ func canonicalizeNewDashboardMosaicLayoutSet(c *Client, des, nw []DashboardMosai if des == nil { return nw } - var reorderedNew []DashboardMosaicLayout + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayout for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayout(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutSlice(c *Client, des, nw []DashboardMosaicLayout) []DashboardMosaicLayout { @@ -7019,23 +7139,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesSet(c *Client, des, nw []Dashboard if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTiles + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTiles for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTiles(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesSlice(c *Client, des, nw []DashboardMosaicLayoutTiles) []DashboardMosaicLayoutTiles { @@ -7194,23 +7317,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetSet(c *Client, des, nw []Das if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidget + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidget for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidget(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidget) []DashboardMosaicLayoutTilesWidget { @@ -7319,23 +7445,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChart + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChart for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChart(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChart) []DashboardMosaicLayoutTilesWidgetXyChart { @@ -7450,23 +7579,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsSet(c *Client if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSets) []DashboardMosaicLayoutTilesWidgetXyChartDataSets { @@ -7577,23 +7709,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQuery + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQuery for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQuery(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQuerySlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQuery) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQuery { @@ -7698,23 +7833,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilter) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilter { @@ -7833,23 +7971,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregationSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation { @@ -7968,23 +8109,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation { @@ -8092,23 +8236,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter { @@ -8207,23 +8354,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio { @@ -8324,23 +8474,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator { @@ -8459,23 +8612,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation { @@ -8576,23 +8732,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator { @@ -8711,23 +8870,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation { @@ -8846,23 +9008,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation { @@ -8970,23 +9135,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter { @@ -9103,23 +9271,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartThresholdsSet(c *Clie if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartThresholds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartThresholds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartThresholdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartThresholds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartThresholdsSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartThresholds) []DashboardMosaicLayoutTilesWidgetXyChartThresholds { @@ -9224,23 +9395,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartXAxisSet(c *Client, d if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartXAxis + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartXAxis for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartXAxisNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartXAxis(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartXAxisSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartXAxis) []DashboardMosaicLayoutTilesWidgetXyChartXAxis { @@ -9345,23 +9519,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartYAxisSet(c *Client, d if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartYAxis + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartYAxis for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartYAxisNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartYAxis(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartYAxisSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartYAxis) []DashboardMosaicLayoutTilesWidgetXyChartYAxis { @@ -9457,23 +9634,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartChartOptionsSet(c *Cl if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartChartOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartChartOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartChartOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartChartOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartChartOptionsSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartChartOptions) []DashboardMosaicLayoutTilesWidgetXyChartChartOptions { @@ -9572,23 +9752,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardSet(c *Client, des, if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecard + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecard for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecard(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecard) []DashboardMosaicLayoutTilesWidgetScorecard { @@ -9699,23 +9882,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQuerySet( if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQuery + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQuery for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQuery(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQuerySlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQuery) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQuery { @@ -9820,23 +10006,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilter) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilter { @@ -9955,23 +10144,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterAggregationSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterAggregation) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterAggregation { @@ -10090,23 +10282,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation { @@ -10214,23 +10409,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter { @@ -10329,23 +10527,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatio + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatio for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatio(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatio) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatio { @@ -10446,23 +10647,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator { @@ -10581,23 +10785,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation { @@ -10698,23 +10905,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator { @@ -10833,23 +11043,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation { @@ -10968,23 +11181,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation { @@ -11092,23 +11308,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter { @@ -11210,23 +11429,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardGaugeViewSet(c *Cli if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardGaugeView + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardGaugeView for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardGaugeViewNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardGaugeView(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardGaugeViewSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardGaugeView) []DashboardMosaicLayoutTilesWidgetScorecardGaugeView { @@ -11331,23 +11553,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardSparkChartViewSet(c if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardSparkChartView + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardSparkChartView for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardSparkChartViewNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardSparkChartView(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardSparkChartViewSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardSparkChartView) []DashboardMosaicLayoutTilesWidgetScorecardSparkChartView { @@ -11464,23 +11689,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardThresholdsSet(c *Cl if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardThresholds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardThresholds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardThresholdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardThresholds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardThresholdsSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardThresholds) []DashboardMosaicLayoutTilesWidgetScorecardThresholds { @@ -11585,23 +11813,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetTextSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetText + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetText for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetTextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetText(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetTextSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetText) []DashboardMosaicLayoutTilesWidgetText { @@ -11689,23 +11920,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetBlankSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetBlank + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetBlank for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetBlankNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetBlank(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetBlankSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetBlank) []DashboardMosaicLayoutTilesWidgetBlank { @@ -11812,23 +12046,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetLogsPanelSet(c *Client, des, if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetLogsPanel + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetLogsPanel for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetLogsPanelNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetLogsPanel(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetLogsPanelSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetLogsPanel) []DashboardMosaicLayoutTilesWidgetLogsPanel { @@ -11921,23 +12158,26 @@ func canonicalizeNewDashboardRowLayoutSet(c *Client, des, nw []DashboardRowLayou if des == nil { return nw } - var reorderedNew []DashboardRowLayout + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayout for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayout(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutSlice(c *Client, des, nw []DashboardRowLayout) []DashboardRowLayout { @@ -12036,23 +12276,26 @@ func canonicalizeNewDashboardRowLayoutRowsSet(c *Client, des, nw []DashboardRowL if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRows + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRows for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRows(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsSlice(c *Client, des, nw []DashboardRowLayoutRows) []DashboardRowLayoutRows { @@ -12211,23 +12454,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsSet(c *Client, des, nw []Dashbo if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgets) []DashboardRowLayoutRowsWidgets { @@ -12336,23 +12582,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChart + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChart for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChart(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChart) []DashboardRowLayoutRowsWidgetsXyChart { @@ -12467,23 +12716,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsSet(c *Client, d if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSets) []DashboardRowLayoutRowsWidgetsXyChartDataSets { @@ -12594,23 +12846,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryS if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQuery + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQuery for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQuery(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQuerySlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQuery) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQuery { @@ -12715,23 +12970,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter { @@ -12850,23 +13108,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregationSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation { @@ -12985,23 +13246,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation { @@ -13109,23 +13373,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter { @@ -13224,23 +13491,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio { @@ -13341,23 +13611,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator { @@ -13476,23 +13749,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation { @@ -13593,23 +13869,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator { @@ -13728,23 +14007,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation { @@ -13863,23 +14145,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation { @@ -13987,23 +14272,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter { @@ -14120,23 +14408,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartThresholdsSet(c *Client, if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartThresholds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartThresholds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartThresholdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartThresholds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartThresholdsSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartThresholds) []DashboardRowLayoutRowsWidgetsXyChartThresholds { @@ -14241,23 +14532,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartXAxisSet(c *Client, des, if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartXAxis + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartXAxis for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartXAxisNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartXAxis(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartXAxisSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartXAxis) []DashboardRowLayoutRowsWidgetsXyChartXAxis { @@ -14362,23 +14656,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartYAxisSet(c *Client, des, if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartYAxis + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartYAxis for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartYAxisNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartYAxis(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartYAxisSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartYAxis) []DashboardRowLayoutRowsWidgetsXyChartYAxis { @@ -14474,23 +14771,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartChartOptionsSet(c *Clien if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartChartOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartChartOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartChartOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartChartOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartChartOptionsSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartChartOptions) []DashboardRowLayoutRowsWidgetsXyChartChartOptions { @@ -14589,23 +14889,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecard + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecard for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecard(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecard) []DashboardRowLayoutRowsWidgetsScorecard { @@ -14716,23 +15019,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQuerySet(c * if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQuery + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQuery for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQuery(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQuerySlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQuery) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQuery { @@ -14837,23 +15143,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSer if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilter) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilter { @@ -14972,23 +15281,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSer if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation { @@ -15107,23 +15419,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSer if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation { @@ -15231,23 +15546,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSer if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter { @@ -15346,23 +15664,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSer if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio { @@ -15463,23 +15784,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSer if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator { @@ -15598,23 +15922,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSer if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation { @@ -15715,23 +16042,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSer if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator { @@ -15850,23 +16180,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSer if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation { @@ -15985,23 +16318,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSer if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation { @@ -16109,23 +16445,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSer if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter { @@ -16227,23 +16566,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardGaugeViewSet(c *Client if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardGaugeView + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardGaugeView for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardGaugeViewNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardGaugeView(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardGaugeViewSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardGaugeView) []DashboardRowLayoutRowsWidgetsScorecardGaugeView { @@ -16348,23 +16690,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardSparkChartViewSet(c *C if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardSparkChartView + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardSparkChartView for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardSparkChartViewNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardSparkChartView(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardSparkChartViewSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardSparkChartView) []DashboardRowLayoutRowsWidgetsScorecardSparkChartView { @@ -16481,23 +16826,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardThresholdsSet(c *Clien if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardThresholds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardThresholds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardThresholdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardThresholds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardThresholdsSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardThresholds) []DashboardRowLayoutRowsWidgetsScorecardThresholds { @@ -16602,23 +16950,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsTextSet(c *Client, des, nw []Da if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsText + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsText for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsTextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsText(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsTextSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsText) []DashboardRowLayoutRowsWidgetsText { @@ -16706,23 +17057,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsBlankSet(c *Client, des, nw []D if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsBlank + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsBlank for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsBlankNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsBlank(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsBlankSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsBlank) []DashboardRowLayoutRowsWidgetsBlank { @@ -16829,23 +17183,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsLogsPanelSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsLogsPanel + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsLogsPanel for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsLogsPanelNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsLogsPanel(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsLogsPanelSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsLogsPanel) []DashboardRowLayoutRowsWidgetsLogsPanel { @@ -16938,23 +17295,26 @@ func canonicalizeNewDashboardColumnLayoutSet(c *Client, des, nw []DashboardColum if des == nil { return nw } - var reorderedNew []DashboardColumnLayout + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayout for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayout(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutSlice(c *Client, des, nw []DashboardColumnLayout) []DashboardColumnLayout { @@ -17053,23 +17413,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsSet(c *Client, des, nw []Dashboa if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumns + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumns for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumns(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsSlice(c *Client, des, nw []DashboardColumnLayoutColumns) []DashboardColumnLayoutColumns { @@ -17228,23 +17591,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgets) []DashboardColumnLayoutColumnsWidgets { @@ -17353,23 +17719,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartSet(c *Client, des if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChart + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChart for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChart(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChart) []DashboardColumnLayoutColumnsWidgetsXyChart { @@ -17484,23 +17853,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsSet(c *Cli if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSets) []DashboardColumnLayoutColumnsWidgetsXyChartDataSets { @@ -17611,23 +17983,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQuery + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQuery for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQuery(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQuerySlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQuery) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQuery { @@ -17732,23 +18107,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter { @@ -17867,23 +18245,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregationSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation { @@ -18002,23 +18383,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation { @@ -18126,23 +18510,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter { @@ -18241,23 +18628,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio { @@ -18358,23 +18748,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator { @@ -18493,23 +18886,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation { @@ -18610,23 +19006,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator { @@ -18745,23 +19144,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation { @@ -18880,23 +19282,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation { @@ -19004,23 +19409,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter { @@ -19137,23 +19545,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartThresholdsSet(c *C if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartThresholds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartThresholds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartThresholdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartThresholds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartThresholdsSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartThresholds) []DashboardColumnLayoutColumnsWidgetsXyChartThresholds { @@ -19258,23 +19669,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartXAxisSet(c *Client if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartXAxis + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartXAxis for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartXAxisNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartXAxis(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartXAxisSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartXAxis) []DashboardColumnLayoutColumnsWidgetsXyChartXAxis { @@ -19379,23 +19793,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartYAxisSet(c *Client if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartYAxis + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartYAxis for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartYAxisNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartYAxis(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartYAxisSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartYAxis) []DashboardColumnLayoutColumnsWidgetsXyChartYAxis { @@ -19491,23 +19908,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartChartOptionsSet(c if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartChartOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartChartOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartChartOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartChartOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartChartOptionsSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartChartOptions) []DashboardColumnLayoutColumnsWidgetsXyChartChartOptions { @@ -19606,23 +20026,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardSet(c *Client, d if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecard + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecard for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecard(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecard) []DashboardColumnLayoutColumnsWidgetsScorecard { @@ -19733,23 +20156,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryS if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQuery + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQuery for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQuery(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQuerySlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQuery) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQuery { @@ -19854,23 +20280,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilter) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilter { @@ -19989,23 +20418,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation { @@ -20124,23 +20556,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation { @@ -20248,23 +20683,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter { @@ -20363,23 +20801,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio { @@ -20480,23 +20921,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator { @@ -20615,23 +21059,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation { @@ -20732,23 +21179,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator { @@ -20867,23 +21317,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation { @@ -21002,23 +21455,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation { @@ -21126,23 +21582,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter { @@ -21244,23 +21703,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardGaugeViewSet(c * if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardGaugeView + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardGaugeView for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardGaugeViewNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardGaugeView(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardGaugeViewSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardGaugeView) []DashboardColumnLayoutColumnsWidgetsScorecardGaugeView { @@ -21365,23 +21827,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardSparkChartViewSe if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardSparkChartView + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardSparkChartView for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardSparkChartViewNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardSparkChartView(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardSparkChartViewSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardSparkChartView) []DashboardColumnLayoutColumnsWidgetsScorecardSparkChartView { @@ -21498,23 +21963,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardThresholdsSet(c if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardThresholds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardThresholds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardThresholdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardThresholds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardThresholdsSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardThresholds) []DashboardColumnLayoutColumnsWidgetsScorecardThresholds { @@ -21619,23 +22087,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsTextSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsText + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsText for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsTextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsText(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsTextSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsText) []DashboardColumnLayoutColumnsWidgetsText { @@ -21723,23 +22194,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsBlankSet(c *Client, des, if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsBlank + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsBlank for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsBlankNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsBlank(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsBlankSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsBlank) []DashboardColumnLayoutColumnsWidgetsBlank { @@ -21846,23 +22320,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsLogsPanelSet(c *Client, d if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsLogsPanel + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsLogsPanel for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsLogsPanelNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsLogsPanel(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsLogsPanelSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsLogsPanel) []DashboardColumnLayoutColumnsWidgetsLogsPanel { diff --git a/services/google/monitoring/alpha/metric_descriptor_internal.go b/services/google/monitoring/alpha/metric_descriptor_internal.go index 97a3c6f9b3..62d4404ebf 100755 --- a/services/google/monitoring/alpha/metric_descriptor_internal.go +++ b/services/google/monitoring/alpha/metric_descriptor_internal.go @@ -595,23 +595,26 @@ func canonicalizeNewMetricDescriptorLabelsSet(c *Client, des, nw []MetricDescrip if des == nil { return nw } - var reorderedNew []MetricDescriptorLabels + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MetricDescriptorLabels for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMetricDescriptorLabelsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMetricDescriptorLabels(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMetricDescriptorLabelsSlice(c *Client, des, nw []MetricDescriptorLabels) []MetricDescriptorLabels { @@ -724,23 +727,26 @@ func canonicalizeNewMetricDescriptorMetadataSet(c *Client, des, nw []MetricDescr if des == nil { return nw } - var reorderedNew []MetricDescriptorMetadata + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MetricDescriptorMetadata for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMetricDescriptorMetadataNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMetricDescriptorMetadata(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMetricDescriptorMetadataSlice(c *Client, des, nw []MetricDescriptorMetadata) []MetricDescriptorMetadata { diff --git a/services/google/monitoring/alpha/metrics_scope_internal.go b/services/google/monitoring/alpha/metrics_scope_internal.go index d362acd9b2..362fc1c928 100755 --- a/services/google/monitoring/alpha/metrics_scope_internal.go +++ b/services/google/monitoring/alpha/metrics_scope_internal.go @@ -271,23 +271,26 @@ func canonicalizeNewMetricsScopeMonitoredProjectsSet(c *Client, des, nw []Metric if des == nil { return nw } - var reorderedNew []MetricsScopeMonitoredProjects + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MetricsScopeMonitoredProjects for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMetricsScopeMonitoredProjectsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMetricsScopeMonitoredProjects(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMetricsScopeMonitoredProjectsSlice(c *Client, des, nw []MetricsScopeMonitoredProjects) []MetricsScopeMonitoredProjects { diff --git a/services/google/monitoring/alpha/service_internal.go b/services/google/monitoring/alpha/service_internal.go index 2da9f495c4..91e30bab43 100755 --- a/services/google/monitoring/alpha/service_internal.go +++ b/services/google/monitoring/alpha/service_internal.go @@ -555,23 +555,26 @@ func canonicalizeNewServiceCustomSet(c *Client, des, nw []ServiceCustom) []Servi if des == nil { return nw } - var reorderedNew []ServiceCustom + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceCustom for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceCustomNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceCustom(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceCustomSlice(c *Client, des, nw []ServiceCustom) []ServiceCustom { @@ -670,23 +673,26 @@ func canonicalizeNewServiceTelemetrySet(c *Client, des, nw []ServiceTelemetry) [ if des == nil { return nw } - var reorderedNew []ServiceTelemetry + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceTelemetry for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceTelemetryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceTelemetry(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceTelemetrySlice(c *Client, des, nw []ServiceTelemetry) []ServiceTelemetry { diff --git a/services/google/monitoring/alpha/service_level_objective_internal.go b/services/google/monitoring/alpha/service_level_objective_internal.go index b2f208f8f9..ab41e52c84 100755 --- a/services/google/monitoring/alpha/service_level_objective_internal.go +++ b/services/google/monitoring/alpha/service_level_objective_internal.go @@ -894,23 +894,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorSet(c *Client, des if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicator) []ServiceLevelObjectiveServiceLevelIndicator { @@ -1073,23 +1076,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliSet(c *Cli if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorBasicSli + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorBasicSli for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorBasicSliNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSli(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorBasicSli) []ServiceLevelObjectiveServiceLevelIndicatorBasicSli { @@ -1177,23 +1183,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliAvailabili if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorBasicSliAvailability + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorBasicSliAvailability for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorBasicSliAvailabilityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliAvailability(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliAvailabilitySlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorBasicSliAvailability) []ServiceLevelObjectiveServiceLevelIndicatorBasicSliAvailability { @@ -1298,23 +1307,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliLatencySet if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorBasicSliLatency + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorBasicSliLatency for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorBasicSliLatencyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliLatency(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliLatencySlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorBasicSliLatency) []ServiceLevelObjectiveServiceLevelIndicatorBasicSliLatency { @@ -1402,23 +1414,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationA if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationAvailability + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationAvailability for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationAvailabilityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationAvailability(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationAvailabilitySlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationAvailability) []ServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationAvailability { @@ -1523,23 +1538,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationL if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationLatency + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationLatency for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationLatencyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationLatency(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationLatencySlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationLatency) []ServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationLatency { @@ -1654,23 +1672,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBasedSet(c if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorRequestBased + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorRequestBased for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorRequestBasedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBased(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBasedSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorRequestBased) []ServiceLevelObjectiveServiceLevelIndicatorRequestBased { @@ -1785,23 +1806,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBasedGoodTo if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedGoodTotalRatio + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedGoodTotalRatio for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorRequestBasedGoodTotalRatioNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBasedGoodTotalRatio(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBasedGoodTotalRatioSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedGoodTotalRatio) []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedGoodTotalRatio { @@ -1902,23 +1926,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistri if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCut + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCut for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCutNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCut(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCutSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCut) []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCut { @@ -2020,23 +2047,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistri if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCutRange + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCutRange for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCutRangeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCutRange(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCutRangeSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCutRange) []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCutRange { @@ -2189,23 +2219,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedSet(c if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBased + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBased for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBased(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBased) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBased { @@ -2326,23 +2359,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTo if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThreshold + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThreshold for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThreshold(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThreshold) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThreshold { @@ -2457,23 +2493,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTo if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformance + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformance for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformance(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformance) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformance { @@ -2588,23 +2627,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTo if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceGoodTotalRatio + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceGoodTotalRatio for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceGoodTotalRatioNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceGoodTotalRatio(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceGoodTotalRatioSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceGoodTotalRatio) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceGoodTotalRatio { @@ -2705,23 +2747,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTo if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCut + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCut for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCutNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCut(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCutSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCut) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCut { @@ -2823,23 +2868,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTo if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCutRange + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCutRange for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCutRangeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCutRange(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCutRangeSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCutRange) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCutRange { @@ -3002,23 +3050,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTo if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformance + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformance for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformance(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformance) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformance { @@ -3106,23 +3157,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTo if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceAvailability + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceAvailability for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceAvailabilityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceAvailability(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceAvailabilitySlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceAvailability) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceAvailability { @@ -3227,23 +3281,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTo if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceLatency + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceLatency for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceLatencyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceLatency(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceLatencySlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceLatency) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceLatency { @@ -3331,23 +3388,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTo if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationAvailability + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationAvailability for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationAvailabilityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationAvailability(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationAvailabilitySlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationAvailability) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationAvailability { @@ -3452,23 +3512,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTo if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationLatency + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationLatency for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationLatencyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationLatency(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationLatencySlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationLatency) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationLatency { @@ -3569,23 +3632,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetric if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRange + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRange for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRangeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRange(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRangeSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRange) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRange { @@ -3687,23 +3753,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetric if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRangeRange + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRangeRange for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRangeRangeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRangeRange(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRangeRangeSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRangeRange) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRangeRange { @@ -3804,23 +3873,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetric if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRange + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRange for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRangeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRange(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRangeSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRange) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRange { @@ -3922,23 +3994,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetric if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRangeRange + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRangeRange for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRangeRangeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRangeRange(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRangeRangeSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRangeRange) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRangeRange { diff --git a/services/google/monitoring/alpha/uptime_check_config_internal.go b/services/google/monitoring/alpha/uptime_check_config_internal.go index 984dd23f1e..eef7cc9540 100755 --- a/services/google/monitoring/alpha/uptime_check_config_internal.go +++ b/services/google/monitoring/alpha/uptime_check_config_internal.go @@ -775,23 +775,26 @@ func canonicalizeNewUptimeCheckConfigMonitoredResourceSet(c *Client, des, nw []U if des == nil { return nw } - var reorderedNew []UptimeCheckConfigMonitoredResource + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []UptimeCheckConfigMonitoredResource for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareUptimeCheckConfigMonitoredResourceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewUptimeCheckConfigMonitoredResource(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewUptimeCheckConfigMonitoredResourceSlice(c *Client, des, nw []UptimeCheckConfigMonitoredResource) []UptimeCheckConfigMonitoredResource { @@ -893,23 +896,26 @@ func canonicalizeNewUptimeCheckConfigResourceGroupSet(c *Client, des, nw []Uptim if des == nil { return nw } - var reorderedNew []UptimeCheckConfigResourceGroup + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []UptimeCheckConfigResourceGroup for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareUptimeCheckConfigResourceGroupNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewUptimeCheckConfigResourceGroup(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewUptimeCheckConfigResourceGroupSlice(c *Client, des, nw []UptimeCheckConfigResourceGroup) []UptimeCheckConfigResourceGroup { @@ -1083,23 +1089,26 @@ func canonicalizeNewUptimeCheckConfigHttpCheckSet(c *Client, des, nw []UptimeChe if des == nil { return nw } - var reorderedNew []UptimeCheckConfigHttpCheck + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []UptimeCheckConfigHttpCheck for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareUptimeCheckConfigHttpCheckNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewUptimeCheckConfigHttpCheck(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewUptimeCheckConfigHttpCheckSlice(c *Client, des, nw []UptimeCheckConfigHttpCheck) []UptimeCheckConfigHttpCheck { @@ -1204,23 +1213,26 @@ func canonicalizeNewUptimeCheckConfigHttpCheckAuthInfoSet(c *Client, des, nw []U if des == nil { return nw } - var reorderedNew []UptimeCheckConfigHttpCheckAuthInfo + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []UptimeCheckConfigHttpCheckAuthInfo for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareUptimeCheckConfigHttpCheckAuthInfoNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewUptimeCheckConfigHttpCheckAuthInfo(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewUptimeCheckConfigHttpCheckAuthInfoSlice(c *Client, des, nw []UptimeCheckConfigHttpCheckAuthInfo) []UptimeCheckConfigHttpCheckAuthInfo { @@ -1316,23 +1328,26 @@ func canonicalizeNewUptimeCheckConfigTcpCheckSet(c *Client, des, nw []UptimeChec if des == nil { return nw } - var reorderedNew []UptimeCheckConfigTcpCheck + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []UptimeCheckConfigTcpCheck for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareUptimeCheckConfigTcpCheckNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewUptimeCheckConfigTcpCheck(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewUptimeCheckConfigTcpCheckSlice(c *Client, des, nw []UptimeCheckConfigTcpCheck) []UptimeCheckConfigTcpCheck { @@ -1445,23 +1460,26 @@ func canonicalizeNewUptimeCheckConfigContentMatchersSet(c *Client, des, nw []Upt if des == nil { return nw } - var reorderedNew []UptimeCheckConfigContentMatchers + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []UptimeCheckConfigContentMatchers for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareUptimeCheckConfigContentMatchersNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewUptimeCheckConfigContentMatchers(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewUptimeCheckConfigContentMatchersSlice(c *Client, des, nw []UptimeCheckConfigContentMatchers) []UptimeCheckConfigContentMatchers { diff --git a/services/google/monitoring/beta/dashboard_internal.go b/services/google/monitoring/beta/dashboard_internal.go index f9ae96ec44..a0bdb6da0c 100755 --- a/services/google/monitoring/beta/dashboard_internal.go +++ b/services/google/monitoring/beta/dashboard_internal.go @@ -1978,23 +1978,26 @@ func canonicalizeNewDashboardGridLayoutSet(c *Client, des, nw []DashboardGridLay if des == nil { return nw } - var reorderedNew []DashboardGridLayout + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayout for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayout(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutSlice(c *Client, des, nw []DashboardGridLayout) []DashboardGridLayout { @@ -2153,23 +2156,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsSet(c *Client, des, nw []Dashboard if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsSlice(c *Client, des, nw []DashboardGridLayoutWidgets) []DashboardGridLayoutWidgets { @@ -2278,23 +2284,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartSet(c *Client, des, nw []Da if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChart + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChart for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChart(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChart) []DashboardGridLayoutWidgetsXyChart { @@ -2409,23 +2418,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsSet(c *Client, des, if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSets) []DashboardGridLayoutWidgetsXyChartDataSets { @@ -2536,23 +2548,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQuerySet( if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQuery + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQuery for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQuery(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQuerySlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQuery) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQuery { @@ -2657,23 +2672,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter { @@ -2792,23 +2810,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregationSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation { @@ -2927,23 +2948,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation { @@ -3051,23 +3075,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter { @@ -3166,23 +3193,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio { @@ -3283,23 +3313,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator { @@ -3418,23 +3451,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation { @@ -3535,23 +3571,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator { @@ -3670,23 +3709,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation { @@ -3805,23 +3847,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation { @@ -3929,23 +3974,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter { @@ -4062,23 +4110,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartThresholdsSet(c *Client, de if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartThresholds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartThresholds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartThresholdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartThresholds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartThresholdsSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartThresholds) []DashboardGridLayoutWidgetsXyChartThresholds { @@ -4183,23 +4234,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartXAxisSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartXAxis + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartXAxis for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartXAxisNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartXAxis(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartXAxisSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartXAxis) []DashboardGridLayoutWidgetsXyChartXAxis { @@ -4304,23 +4358,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartYAxisSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartYAxis + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartYAxis for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartYAxisNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartYAxis(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartYAxisSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartYAxis) []DashboardGridLayoutWidgetsXyChartYAxis { @@ -4416,23 +4473,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartChartOptionsSet(c *Client, if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartChartOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartChartOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartChartOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartChartOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartChartOptionsSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartChartOptions) []DashboardGridLayoutWidgetsXyChartChartOptions { @@ -4531,23 +4591,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecard + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecard for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecard(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecard) []DashboardGridLayoutWidgetsScorecard { @@ -4658,23 +4721,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQuerySet(c *Cli if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQuery + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQuery for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQuery(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQuerySlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQuery) []DashboardGridLayoutWidgetsScorecardTimeSeriesQuery { @@ -4779,23 +4845,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeries if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilter) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilter { @@ -4914,23 +4983,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeries if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation { @@ -5049,23 +5121,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeries if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation { @@ -5173,23 +5248,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeries if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter { @@ -5288,23 +5366,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeries if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio { @@ -5405,23 +5486,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeries if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator { @@ -5540,23 +5624,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeries if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation { @@ -5657,23 +5744,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeries if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator { @@ -5792,23 +5882,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeries if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation { @@ -5927,23 +6020,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeries if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation { @@ -6051,23 +6147,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeries if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter { @@ -6169,23 +6268,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardGaugeViewSet(c *Client, d if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardGaugeView + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardGaugeView for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardGaugeViewNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardGaugeView(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardGaugeViewSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardGaugeView) []DashboardGridLayoutWidgetsScorecardGaugeView { @@ -6290,23 +6392,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardSparkChartViewSet(c *Clie if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardSparkChartView + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardSparkChartView for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardSparkChartViewNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardSparkChartView(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardSparkChartViewSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardSparkChartView) []DashboardGridLayoutWidgetsScorecardSparkChartView { @@ -6423,23 +6528,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardThresholdsSet(c *Client, if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardThresholds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardThresholds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardThresholdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardThresholds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardThresholdsSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardThresholds) []DashboardGridLayoutWidgetsScorecardThresholds { @@ -6544,23 +6652,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsTextSet(c *Client, des, nw []Dashb if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsText + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsText for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsTextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsText(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsTextSlice(c *Client, des, nw []DashboardGridLayoutWidgetsText) []DashboardGridLayoutWidgetsText { @@ -6648,23 +6759,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsBlankSet(c *Client, des, nw []Dash if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsBlank + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsBlank for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsBlankNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsBlank(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsBlankSlice(c *Client, des, nw []DashboardGridLayoutWidgetsBlank) []DashboardGridLayoutWidgetsBlank { @@ -6771,23 +6885,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsLogsPanelSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsLogsPanel + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsLogsPanel for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsLogsPanelNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsLogsPanel(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsLogsPanelSlice(c *Client, des, nw []DashboardGridLayoutWidgetsLogsPanel) []DashboardGridLayoutWidgetsLogsPanel { @@ -6886,23 +7003,26 @@ func canonicalizeNewDashboardMosaicLayoutSet(c *Client, des, nw []DashboardMosai if des == nil { return nw } - var reorderedNew []DashboardMosaicLayout + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayout for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayout(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutSlice(c *Client, des, nw []DashboardMosaicLayout) []DashboardMosaicLayout { @@ -7019,23 +7139,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesSet(c *Client, des, nw []Dashboard if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTiles + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTiles for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTiles(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesSlice(c *Client, des, nw []DashboardMosaicLayoutTiles) []DashboardMosaicLayoutTiles { @@ -7194,23 +7317,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetSet(c *Client, des, nw []Das if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidget + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidget for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidget(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidget) []DashboardMosaicLayoutTilesWidget { @@ -7319,23 +7445,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChart + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChart for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChart(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChart) []DashboardMosaicLayoutTilesWidgetXyChart { @@ -7450,23 +7579,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsSet(c *Client if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSets) []DashboardMosaicLayoutTilesWidgetXyChartDataSets { @@ -7577,23 +7709,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQuery + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQuery for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQuery(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQuerySlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQuery) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQuery { @@ -7698,23 +7833,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilter) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilter { @@ -7833,23 +7971,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregationSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation { @@ -7968,23 +8109,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation { @@ -8092,23 +8236,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter { @@ -8207,23 +8354,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio { @@ -8324,23 +8474,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator { @@ -8459,23 +8612,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation { @@ -8576,23 +8732,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator { @@ -8711,23 +8870,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation { @@ -8846,23 +9008,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation { @@ -8970,23 +9135,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter { @@ -9103,23 +9271,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartThresholdsSet(c *Clie if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartThresholds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartThresholds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartThresholdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartThresholds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartThresholdsSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartThresholds) []DashboardMosaicLayoutTilesWidgetXyChartThresholds { @@ -9224,23 +9395,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartXAxisSet(c *Client, d if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartXAxis + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartXAxis for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartXAxisNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartXAxis(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartXAxisSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartXAxis) []DashboardMosaicLayoutTilesWidgetXyChartXAxis { @@ -9345,23 +9519,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartYAxisSet(c *Client, d if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartYAxis + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartYAxis for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartYAxisNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartYAxis(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartYAxisSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartYAxis) []DashboardMosaicLayoutTilesWidgetXyChartYAxis { @@ -9457,23 +9634,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartChartOptionsSet(c *Cl if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartChartOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartChartOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartChartOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartChartOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartChartOptionsSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartChartOptions) []DashboardMosaicLayoutTilesWidgetXyChartChartOptions { @@ -9572,23 +9752,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardSet(c *Client, des, if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecard + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecard for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecard(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecard) []DashboardMosaicLayoutTilesWidgetScorecard { @@ -9699,23 +9882,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQuerySet( if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQuery + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQuery for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQuery(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQuerySlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQuery) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQuery { @@ -9820,23 +10006,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilter) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilter { @@ -9955,23 +10144,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterAggregationSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterAggregation) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterAggregation { @@ -10090,23 +10282,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation { @@ -10214,23 +10409,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter { @@ -10329,23 +10527,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatio + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatio for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatio(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatio) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatio { @@ -10446,23 +10647,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator { @@ -10581,23 +10785,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation { @@ -10698,23 +10905,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator { @@ -10833,23 +11043,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation { @@ -10968,23 +11181,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation { @@ -11092,23 +11308,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter { @@ -11210,23 +11429,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardGaugeViewSet(c *Cli if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardGaugeView + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardGaugeView for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardGaugeViewNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardGaugeView(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardGaugeViewSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardGaugeView) []DashboardMosaicLayoutTilesWidgetScorecardGaugeView { @@ -11331,23 +11553,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardSparkChartViewSet(c if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardSparkChartView + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardSparkChartView for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardSparkChartViewNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardSparkChartView(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardSparkChartViewSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardSparkChartView) []DashboardMosaicLayoutTilesWidgetScorecardSparkChartView { @@ -11464,23 +11689,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardThresholdsSet(c *Cl if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardThresholds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardThresholds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardThresholdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardThresholds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardThresholdsSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardThresholds) []DashboardMosaicLayoutTilesWidgetScorecardThresholds { @@ -11585,23 +11813,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetTextSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetText + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetText for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetTextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetText(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetTextSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetText) []DashboardMosaicLayoutTilesWidgetText { @@ -11689,23 +11920,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetBlankSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetBlank + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetBlank for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetBlankNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetBlank(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetBlankSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetBlank) []DashboardMosaicLayoutTilesWidgetBlank { @@ -11812,23 +12046,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetLogsPanelSet(c *Client, des, if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetLogsPanel + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetLogsPanel for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetLogsPanelNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetLogsPanel(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetLogsPanelSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetLogsPanel) []DashboardMosaicLayoutTilesWidgetLogsPanel { @@ -11921,23 +12158,26 @@ func canonicalizeNewDashboardRowLayoutSet(c *Client, des, nw []DashboardRowLayou if des == nil { return nw } - var reorderedNew []DashboardRowLayout + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayout for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayout(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutSlice(c *Client, des, nw []DashboardRowLayout) []DashboardRowLayout { @@ -12036,23 +12276,26 @@ func canonicalizeNewDashboardRowLayoutRowsSet(c *Client, des, nw []DashboardRowL if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRows + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRows for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRows(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsSlice(c *Client, des, nw []DashboardRowLayoutRows) []DashboardRowLayoutRows { @@ -12211,23 +12454,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsSet(c *Client, des, nw []Dashbo if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgets) []DashboardRowLayoutRowsWidgets { @@ -12336,23 +12582,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChart + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChart for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChart(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChart) []DashboardRowLayoutRowsWidgetsXyChart { @@ -12467,23 +12716,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsSet(c *Client, d if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSets) []DashboardRowLayoutRowsWidgetsXyChartDataSets { @@ -12594,23 +12846,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryS if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQuery + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQuery for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQuery(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQuerySlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQuery) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQuery { @@ -12715,23 +12970,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter { @@ -12850,23 +13108,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregationSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation { @@ -12985,23 +13246,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation { @@ -13109,23 +13373,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter { @@ -13224,23 +13491,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio { @@ -13341,23 +13611,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator { @@ -13476,23 +13749,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation { @@ -13593,23 +13869,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator { @@ -13728,23 +14007,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation { @@ -13863,23 +14145,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation { @@ -13987,23 +14272,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter { @@ -14120,23 +14408,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartThresholdsSet(c *Client, if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartThresholds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartThresholds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartThresholdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartThresholds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartThresholdsSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartThresholds) []DashboardRowLayoutRowsWidgetsXyChartThresholds { @@ -14241,23 +14532,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartXAxisSet(c *Client, des, if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartXAxis + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartXAxis for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartXAxisNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartXAxis(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartXAxisSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartXAxis) []DashboardRowLayoutRowsWidgetsXyChartXAxis { @@ -14362,23 +14656,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartYAxisSet(c *Client, des, if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartYAxis + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartYAxis for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartYAxisNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartYAxis(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartYAxisSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartYAxis) []DashboardRowLayoutRowsWidgetsXyChartYAxis { @@ -14474,23 +14771,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartChartOptionsSet(c *Clien if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartChartOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartChartOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartChartOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartChartOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartChartOptionsSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartChartOptions) []DashboardRowLayoutRowsWidgetsXyChartChartOptions { @@ -14589,23 +14889,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecard + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecard for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecard(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecard) []DashboardRowLayoutRowsWidgetsScorecard { @@ -14716,23 +15019,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQuerySet(c * if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQuery + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQuery for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQuery(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQuerySlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQuery) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQuery { @@ -14837,23 +15143,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSer if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilter) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilter { @@ -14972,23 +15281,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSer if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation { @@ -15107,23 +15419,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSer if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation { @@ -15231,23 +15546,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSer if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter { @@ -15346,23 +15664,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSer if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio { @@ -15463,23 +15784,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSer if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator { @@ -15598,23 +15922,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSer if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation { @@ -15715,23 +16042,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSer if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator { @@ -15850,23 +16180,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSer if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation { @@ -15985,23 +16318,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSer if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation { @@ -16109,23 +16445,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSer if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter { @@ -16227,23 +16566,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardGaugeViewSet(c *Client if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardGaugeView + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardGaugeView for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardGaugeViewNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardGaugeView(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardGaugeViewSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardGaugeView) []DashboardRowLayoutRowsWidgetsScorecardGaugeView { @@ -16348,23 +16690,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardSparkChartViewSet(c *C if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardSparkChartView + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardSparkChartView for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardSparkChartViewNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardSparkChartView(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardSparkChartViewSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardSparkChartView) []DashboardRowLayoutRowsWidgetsScorecardSparkChartView { @@ -16481,23 +16826,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardThresholdsSet(c *Clien if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardThresholds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardThresholds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardThresholdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardThresholds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardThresholdsSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardThresholds) []DashboardRowLayoutRowsWidgetsScorecardThresholds { @@ -16602,23 +16950,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsTextSet(c *Client, des, nw []Da if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsText + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsText for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsTextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsText(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsTextSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsText) []DashboardRowLayoutRowsWidgetsText { @@ -16706,23 +17057,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsBlankSet(c *Client, des, nw []D if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsBlank + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsBlank for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsBlankNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsBlank(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsBlankSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsBlank) []DashboardRowLayoutRowsWidgetsBlank { @@ -16829,23 +17183,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsLogsPanelSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsLogsPanel + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsLogsPanel for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsLogsPanelNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsLogsPanel(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsLogsPanelSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsLogsPanel) []DashboardRowLayoutRowsWidgetsLogsPanel { @@ -16938,23 +17295,26 @@ func canonicalizeNewDashboardColumnLayoutSet(c *Client, des, nw []DashboardColum if des == nil { return nw } - var reorderedNew []DashboardColumnLayout + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayout for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayout(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutSlice(c *Client, des, nw []DashboardColumnLayout) []DashboardColumnLayout { @@ -17053,23 +17413,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsSet(c *Client, des, nw []Dashboa if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumns + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumns for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumns(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsSlice(c *Client, des, nw []DashboardColumnLayoutColumns) []DashboardColumnLayoutColumns { @@ -17228,23 +17591,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgets) []DashboardColumnLayoutColumnsWidgets { @@ -17353,23 +17719,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartSet(c *Client, des if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChart + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChart for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChart(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChart) []DashboardColumnLayoutColumnsWidgetsXyChart { @@ -17484,23 +17853,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsSet(c *Cli if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSets) []DashboardColumnLayoutColumnsWidgetsXyChartDataSets { @@ -17611,23 +17983,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQuery + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQuery for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQuery(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQuerySlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQuery) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQuery { @@ -17732,23 +18107,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter { @@ -17867,23 +18245,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregationSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation { @@ -18002,23 +18383,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation { @@ -18126,23 +18510,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter { @@ -18241,23 +18628,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio { @@ -18358,23 +18748,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator { @@ -18493,23 +18886,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation { @@ -18610,23 +19006,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator { @@ -18745,23 +19144,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation { @@ -18880,23 +19282,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation { @@ -19004,23 +19409,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter { @@ -19137,23 +19545,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartThresholdsSet(c *C if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartThresholds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartThresholds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartThresholdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartThresholds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartThresholdsSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartThresholds) []DashboardColumnLayoutColumnsWidgetsXyChartThresholds { @@ -19258,23 +19669,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartXAxisSet(c *Client if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartXAxis + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartXAxis for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartXAxisNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartXAxis(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartXAxisSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartXAxis) []DashboardColumnLayoutColumnsWidgetsXyChartXAxis { @@ -19379,23 +19793,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartYAxisSet(c *Client if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartYAxis + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartYAxis for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartYAxisNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartYAxis(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartYAxisSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartYAxis) []DashboardColumnLayoutColumnsWidgetsXyChartYAxis { @@ -19491,23 +19908,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartChartOptionsSet(c if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartChartOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartChartOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartChartOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartChartOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartChartOptionsSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartChartOptions) []DashboardColumnLayoutColumnsWidgetsXyChartChartOptions { @@ -19606,23 +20026,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardSet(c *Client, d if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecard + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecard for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecard(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecard) []DashboardColumnLayoutColumnsWidgetsScorecard { @@ -19733,23 +20156,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryS if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQuery + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQuery for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQuery(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQuerySlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQuery) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQuery { @@ -19854,23 +20280,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilter) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilter { @@ -19989,23 +20418,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation { @@ -20124,23 +20556,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation { @@ -20248,23 +20683,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter { @@ -20363,23 +20801,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio { @@ -20480,23 +20921,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator { @@ -20615,23 +21059,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation { @@ -20732,23 +21179,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator { @@ -20867,23 +21317,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation { @@ -21002,23 +21455,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation { @@ -21126,23 +21582,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter { @@ -21244,23 +21703,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardGaugeViewSet(c * if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardGaugeView + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardGaugeView for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardGaugeViewNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardGaugeView(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardGaugeViewSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardGaugeView) []DashboardColumnLayoutColumnsWidgetsScorecardGaugeView { @@ -21365,23 +21827,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardSparkChartViewSe if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardSparkChartView + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardSparkChartView for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardSparkChartViewNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardSparkChartView(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardSparkChartViewSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardSparkChartView) []DashboardColumnLayoutColumnsWidgetsScorecardSparkChartView { @@ -21498,23 +21963,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardThresholdsSet(c if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardThresholds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardThresholds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardThresholdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardThresholds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardThresholdsSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardThresholds) []DashboardColumnLayoutColumnsWidgetsScorecardThresholds { @@ -21619,23 +22087,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsTextSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsText + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsText for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsTextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsText(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsTextSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsText) []DashboardColumnLayoutColumnsWidgetsText { @@ -21723,23 +22194,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsBlankSet(c *Client, des, if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsBlank + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsBlank for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsBlankNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsBlank(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsBlankSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsBlank) []DashboardColumnLayoutColumnsWidgetsBlank { @@ -21846,23 +22320,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsLogsPanelSet(c *Client, d if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsLogsPanel + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsLogsPanel for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsLogsPanelNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsLogsPanel(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsLogsPanelSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsLogsPanel) []DashboardColumnLayoutColumnsWidgetsLogsPanel { diff --git a/services/google/monitoring/beta/metric_descriptor_internal.go b/services/google/monitoring/beta/metric_descriptor_internal.go index 4da01147b0..88bd06d18f 100755 --- a/services/google/monitoring/beta/metric_descriptor_internal.go +++ b/services/google/monitoring/beta/metric_descriptor_internal.go @@ -595,23 +595,26 @@ func canonicalizeNewMetricDescriptorLabelsSet(c *Client, des, nw []MetricDescrip if des == nil { return nw } - var reorderedNew []MetricDescriptorLabels + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MetricDescriptorLabels for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMetricDescriptorLabelsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMetricDescriptorLabels(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMetricDescriptorLabelsSlice(c *Client, des, nw []MetricDescriptorLabels) []MetricDescriptorLabels { @@ -724,23 +727,26 @@ func canonicalizeNewMetricDescriptorMetadataSet(c *Client, des, nw []MetricDescr if des == nil { return nw } - var reorderedNew []MetricDescriptorMetadata + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MetricDescriptorMetadata for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMetricDescriptorMetadataNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMetricDescriptorMetadata(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMetricDescriptorMetadataSlice(c *Client, des, nw []MetricDescriptorMetadata) []MetricDescriptorMetadata { diff --git a/services/google/monitoring/beta/metrics_scope_internal.go b/services/google/monitoring/beta/metrics_scope_internal.go index 0f5b9fd8a9..5bc1c173aa 100755 --- a/services/google/monitoring/beta/metrics_scope_internal.go +++ b/services/google/monitoring/beta/metrics_scope_internal.go @@ -271,23 +271,26 @@ func canonicalizeNewMetricsScopeMonitoredProjectsSet(c *Client, des, nw []Metric if des == nil { return nw } - var reorderedNew []MetricsScopeMonitoredProjects + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MetricsScopeMonitoredProjects for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMetricsScopeMonitoredProjectsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMetricsScopeMonitoredProjects(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMetricsScopeMonitoredProjectsSlice(c *Client, des, nw []MetricsScopeMonitoredProjects) []MetricsScopeMonitoredProjects { diff --git a/services/google/monitoring/beta/service_internal.go b/services/google/monitoring/beta/service_internal.go index 24f6030da0..9a42d29775 100755 --- a/services/google/monitoring/beta/service_internal.go +++ b/services/google/monitoring/beta/service_internal.go @@ -555,23 +555,26 @@ func canonicalizeNewServiceCustomSet(c *Client, des, nw []ServiceCustom) []Servi if des == nil { return nw } - var reorderedNew []ServiceCustom + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceCustom for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceCustomNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceCustom(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceCustomSlice(c *Client, des, nw []ServiceCustom) []ServiceCustom { @@ -670,23 +673,26 @@ func canonicalizeNewServiceTelemetrySet(c *Client, des, nw []ServiceTelemetry) [ if des == nil { return nw } - var reorderedNew []ServiceTelemetry + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceTelemetry for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceTelemetryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceTelemetry(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceTelemetrySlice(c *Client, des, nw []ServiceTelemetry) []ServiceTelemetry { diff --git a/services/google/monitoring/beta/service_level_objective_internal.go b/services/google/monitoring/beta/service_level_objective_internal.go index 278b44e559..f4aed7a273 100755 --- a/services/google/monitoring/beta/service_level_objective_internal.go +++ b/services/google/monitoring/beta/service_level_objective_internal.go @@ -894,23 +894,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorSet(c *Client, des if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicator) []ServiceLevelObjectiveServiceLevelIndicator { @@ -1073,23 +1076,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliSet(c *Cli if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorBasicSli + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorBasicSli for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorBasicSliNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSli(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorBasicSli) []ServiceLevelObjectiveServiceLevelIndicatorBasicSli { @@ -1177,23 +1183,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliAvailabili if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorBasicSliAvailability + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorBasicSliAvailability for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorBasicSliAvailabilityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliAvailability(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliAvailabilitySlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorBasicSliAvailability) []ServiceLevelObjectiveServiceLevelIndicatorBasicSliAvailability { @@ -1298,23 +1307,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliLatencySet if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorBasicSliLatency + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorBasicSliLatency for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorBasicSliLatencyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliLatency(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliLatencySlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorBasicSliLatency) []ServiceLevelObjectiveServiceLevelIndicatorBasicSliLatency { @@ -1402,23 +1414,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationA if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationAvailability + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationAvailability for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationAvailabilityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationAvailability(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationAvailabilitySlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationAvailability) []ServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationAvailability { @@ -1523,23 +1538,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationL if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationLatency + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationLatency for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationLatencyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationLatency(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationLatencySlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationLatency) []ServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationLatency { @@ -1654,23 +1672,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBasedSet(c if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorRequestBased + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorRequestBased for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorRequestBasedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBased(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBasedSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorRequestBased) []ServiceLevelObjectiveServiceLevelIndicatorRequestBased { @@ -1785,23 +1806,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBasedGoodTo if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedGoodTotalRatio + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedGoodTotalRatio for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorRequestBasedGoodTotalRatioNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBasedGoodTotalRatio(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBasedGoodTotalRatioSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedGoodTotalRatio) []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedGoodTotalRatio { @@ -1902,23 +1926,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistri if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCut + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCut for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCutNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCut(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCutSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCut) []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCut { @@ -2020,23 +2047,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistri if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCutRange + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCutRange for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCutRangeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCutRange(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCutRangeSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCutRange) []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCutRange { @@ -2189,23 +2219,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedSet(c if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBased + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBased for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBased(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBased) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBased { @@ -2326,23 +2359,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTo if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThreshold + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThreshold for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThreshold(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThreshold) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThreshold { @@ -2457,23 +2493,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTo if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformance + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformance for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformance(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformance) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformance { @@ -2588,23 +2627,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTo if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceGoodTotalRatio + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceGoodTotalRatio for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceGoodTotalRatioNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceGoodTotalRatio(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceGoodTotalRatioSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceGoodTotalRatio) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceGoodTotalRatio { @@ -2705,23 +2747,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTo if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCut + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCut for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCutNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCut(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCutSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCut) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCut { @@ -2823,23 +2868,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTo if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCutRange + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCutRange for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCutRangeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCutRange(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCutRangeSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCutRange) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCutRange { @@ -3002,23 +3050,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTo if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformance + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformance for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformance(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformance) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformance { @@ -3106,23 +3157,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTo if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceAvailability + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceAvailability for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceAvailabilityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceAvailability(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceAvailabilitySlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceAvailability) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceAvailability { @@ -3227,23 +3281,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTo if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceLatency + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceLatency for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceLatencyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceLatency(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceLatencySlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceLatency) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceLatency { @@ -3331,23 +3388,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTo if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationAvailability + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationAvailability for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationAvailabilityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationAvailability(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationAvailabilitySlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationAvailability) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationAvailability { @@ -3452,23 +3512,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTo if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationLatency + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationLatency for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationLatencyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationLatency(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationLatencySlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationLatency) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationLatency { @@ -3569,23 +3632,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetric if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRange + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRange for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRangeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRange(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRangeSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRange) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRange { @@ -3687,23 +3753,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetric if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRangeRange + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRangeRange for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRangeRangeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRangeRange(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRangeRangeSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRangeRange) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRangeRange { @@ -3804,23 +3873,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetric if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRange + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRange for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRangeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRange(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRangeSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRange) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRange { @@ -3922,23 +3994,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetric if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRangeRange + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRangeRange for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRangeRangeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRangeRange(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRangeRangeSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRangeRange) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRangeRange { diff --git a/services/google/monitoring/beta/uptime_check_config_internal.go b/services/google/monitoring/beta/uptime_check_config_internal.go index 190d4fd005..7be8db713a 100755 --- a/services/google/monitoring/beta/uptime_check_config_internal.go +++ b/services/google/monitoring/beta/uptime_check_config_internal.go @@ -775,23 +775,26 @@ func canonicalizeNewUptimeCheckConfigMonitoredResourceSet(c *Client, des, nw []U if des == nil { return nw } - var reorderedNew []UptimeCheckConfigMonitoredResource + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []UptimeCheckConfigMonitoredResource for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareUptimeCheckConfigMonitoredResourceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewUptimeCheckConfigMonitoredResource(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewUptimeCheckConfigMonitoredResourceSlice(c *Client, des, nw []UptimeCheckConfigMonitoredResource) []UptimeCheckConfigMonitoredResource { @@ -893,23 +896,26 @@ func canonicalizeNewUptimeCheckConfigResourceGroupSet(c *Client, des, nw []Uptim if des == nil { return nw } - var reorderedNew []UptimeCheckConfigResourceGroup + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []UptimeCheckConfigResourceGroup for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareUptimeCheckConfigResourceGroupNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewUptimeCheckConfigResourceGroup(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewUptimeCheckConfigResourceGroupSlice(c *Client, des, nw []UptimeCheckConfigResourceGroup) []UptimeCheckConfigResourceGroup { @@ -1083,23 +1089,26 @@ func canonicalizeNewUptimeCheckConfigHttpCheckSet(c *Client, des, nw []UptimeChe if des == nil { return nw } - var reorderedNew []UptimeCheckConfigHttpCheck + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []UptimeCheckConfigHttpCheck for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareUptimeCheckConfigHttpCheckNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewUptimeCheckConfigHttpCheck(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewUptimeCheckConfigHttpCheckSlice(c *Client, des, nw []UptimeCheckConfigHttpCheck) []UptimeCheckConfigHttpCheck { @@ -1204,23 +1213,26 @@ func canonicalizeNewUptimeCheckConfigHttpCheckAuthInfoSet(c *Client, des, nw []U if des == nil { return nw } - var reorderedNew []UptimeCheckConfigHttpCheckAuthInfo + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []UptimeCheckConfigHttpCheckAuthInfo for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareUptimeCheckConfigHttpCheckAuthInfoNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewUptimeCheckConfigHttpCheckAuthInfo(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewUptimeCheckConfigHttpCheckAuthInfoSlice(c *Client, des, nw []UptimeCheckConfigHttpCheckAuthInfo) []UptimeCheckConfigHttpCheckAuthInfo { @@ -1316,23 +1328,26 @@ func canonicalizeNewUptimeCheckConfigTcpCheckSet(c *Client, des, nw []UptimeChec if des == nil { return nw } - var reorderedNew []UptimeCheckConfigTcpCheck + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []UptimeCheckConfigTcpCheck for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareUptimeCheckConfigTcpCheckNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewUptimeCheckConfigTcpCheck(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewUptimeCheckConfigTcpCheckSlice(c *Client, des, nw []UptimeCheckConfigTcpCheck) []UptimeCheckConfigTcpCheck { @@ -1445,23 +1460,26 @@ func canonicalizeNewUptimeCheckConfigContentMatchersSet(c *Client, des, nw []Upt if des == nil { return nw } - var reorderedNew []UptimeCheckConfigContentMatchers + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []UptimeCheckConfigContentMatchers for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareUptimeCheckConfigContentMatchersNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewUptimeCheckConfigContentMatchers(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewUptimeCheckConfigContentMatchersSlice(c *Client, des, nw []UptimeCheckConfigContentMatchers) []UptimeCheckConfigContentMatchers { diff --git a/services/google/monitoring/dashboard_internal.go b/services/google/monitoring/dashboard_internal.go index eb10367683..1a0590cf8c 100755 --- a/services/google/monitoring/dashboard_internal.go +++ b/services/google/monitoring/dashboard_internal.go @@ -1978,23 +1978,26 @@ func canonicalizeNewDashboardGridLayoutSet(c *Client, des, nw []DashboardGridLay if des == nil { return nw } - var reorderedNew []DashboardGridLayout + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayout for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayout(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutSlice(c *Client, des, nw []DashboardGridLayout) []DashboardGridLayout { @@ -2153,23 +2156,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsSet(c *Client, des, nw []Dashboard if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsSlice(c *Client, des, nw []DashboardGridLayoutWidgets) []DashboardGridLayoutWidgets { @@ -2278,23 +2284,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartSet(c *Client, des, nw []Da if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChart + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChart for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChart(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChart) []DashboardGridLayoutWidgetsXyChart { @@ -2409,23 +2418,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsSet(c *Client, des, if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSets) []DashboardGridLayoutWidgetsXyChartDataSets { @@ -2536,23 +2548,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQuerySet( if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQuery + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQuery for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQuery(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQuerySlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQuery) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQuery { @@ -2657,23 +2672,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter { @@ -2792,23 +2810,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregationSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation { @@ -2927,23 +2948,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation { @@ -3051,23 +3075,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter { @@ -3166,23 +3193,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio { @@ -3283,23 +3313,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator { @@ -3418,23 +3451,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation { @@ -3535,23 +3571,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator { @@ -3670,23 +3709,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation { @@ -3805,23 +3847,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation { @@ -3929,23 +3974,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter) []DashboardGridLayoutWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter { @@ -4062,23 +4110,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartThresholdsSet(c *Client, de if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartThresholds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartThresholds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartThresholdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartThresholds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartThresholdsSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartThresholds) []DashboardGridLayoutWidgetsXyChartThresholds { @@ -4183,23 +4234,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartXAxisSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartXAxis + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartXAxis for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartXAxisNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartXAxis(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartXAxisSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartXAxis) []DashboardGridLayoutWidgetsXyChartXAxis { @@ -4304,23 +4358,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartYAxisSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartYAxis + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartYAxis for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartYAxisNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartYAxis(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartYAxisSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartYAxis) []DashboardGridLayoutWidgetsXyChartYAxis { @@ -4416,23 +4473,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsXyChartChartOptionsSet(c *Client, if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsXyChartChartOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsXyChartChartOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsXyChartChartOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsXyChartChartOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsXyChartChartOptionsSlice(c *Client, des, nw []DashboardGridLayoutWidgetsXyChartChartOptions) []DashboardGridLayoutWidgetsXyChartChartOptions { @@ -4531,23 +4591,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecard + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecard for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecard(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecard) []DashboardGridLayoutWidgetsScorecard { @@ -4658,23 +4721,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQuerySet(c *Cli if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQuery + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQuery for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQuery(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQuerySlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQuery) []DashboardGridLayoutWidgetsScorecardTimeSeriesQuery { @@ -4779,23 +4845,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeries if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilter) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilter { @@ -4914,23 +4983,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeries if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation { @@ -5049,23 +5121,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeries if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation { @@ -5173,23 +5248,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeries if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter { @@ -5288,23 +5366,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeries if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio { @@ -5405,23 +5486,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeries if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator { @@ -5540,23 +5624,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeries if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation { @@ -5657,23 +5744,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeries if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator { @@ -5792,23 +5882,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeries if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation { @@ -5927,23 +6020,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeries if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation { @@ -6051,23 +6147,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeries if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter) []DashboardGridLayoutWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter { @@ -6169,23 +6268,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardGaugeViewSet(c *Client, d if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardGaugeView + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardGaugeView for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardGaugeViewNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardGaugeView(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardGaugeViewSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardGaugeView) []DashboardGridLayoutWidgetsScorecardGaugeView { @@ -6290,23 +6392,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardSparkChartViewSet(c *Clie if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardSparkChartView + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardSparkChartView for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardSparkChartViewNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardSparkChartView(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardSparkChartViewSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardSparkChartView) []DashboardGridLayoutWidgetsScorecardSparkChartView { @@ -6423,23 +6528,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsScorecardThresholdsSet(c *Client, if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsScorecardThresholds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsScorecardThresholds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsScorecardThresholdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsScorecardThresholds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsScorecardThresholdsSlice(c *Client, des, nw []DashboardGridLayoutWidgetsScorecardThresholds) []DashboardGridLayoutWidgetsScorecardThresholds { @@ -6544,23 +6652,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsTextSet(c *Client, des, nw []Dashb if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsText + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsText for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsTextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsText(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsTextSlice(c *Client, des, nw []DashboardGridLayoutWidgetsText) []DashboardGridLayoutWidgetsText { @@ -6648,23 +6759,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsBlankSet(c *Client, des, nw []Dash if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsBlank + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsBlank for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsBlankNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsBlank(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsBlankSlice(c *Client, des, nw []DashboardGridLayoutWidgetsBlank) []DashboardGridLayoutWidgetsBlank { @@ -6771,23 +6885,26 @@ func canonicalizeNewDashboardGridLayoutWidgetsLogsPanelSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []DashboardGridLayoutWidgetsLogsPanel + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardGridLayoutWidgetsLogsPanel for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardGridLayoutWidgetsLogsPanelNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardGridLayoutWidgetsLogsPanel(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardGridLayoutWidgetsLogsPanelSlice(c *Client, des, nw []DashboardGridLayoutWidgetsLogsPanel) []DashboardGridLayoutWidgetsLogsPanel { @@ -6886,23 +7003,26 @@ func canonicalizeNewDashboardMosaicLayoutSet(c *Client, des, nw []DashboardMosai if des == nil { return nw } - var reorderedNew []DashboardMosaicLayout + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayout for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayout(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutSlice(c *Client, des, nw []DashboardMosaicLayout) []DashboardMosaicLayout { @@ -7019,23 +7139,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesSet(c *Client, des, nw []Dashboard if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTiles + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTiles for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTiles(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesSlice(c *Client, des, nw []DashboardMosaicLayoutTiles) []DashboardMosaicLayoutTiles { @@ -7194,23 +7317,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetSet(c *Client, des, nw []Das if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidget + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidget for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidget(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidget) []DashboardMosaicLayoutTilesWidget { @@ -7319,23 +7445,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChart + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChart for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChart(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChart) []DashboardMosaicLayoutTilesWidgetXyChart { @@ -7450,23 +7579,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsSet(c *Client if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSets) []DashboardMosaicLayoutTilesWidgetXyChartDataSets { @@ -7577,23 +7709,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQuery + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQuery for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQuery(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQuerySlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQuery) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQuery { @@ -7698,23 +7833,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilter) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilter { @@ -7833,23 +7971,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregationSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation { @@ -7968,23 +8109,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation { @@ -8092,23 +8236,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter { @@ -8207,23 +8354,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio { @@ -8324,23 +8474,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator { @@ -8459,23 +8612,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation { @@ -8576,23 +8732,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator { @@ -8711,23 +8870,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation { @@ -8846,23 +9008,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation { @@ -8970,23 +9135,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQue if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter) []DashboardMosaicLayoutTilesWidgetXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter { @@ -9103,23 +9271,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartThresholdsSet(c *Clie if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartThresholds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartThresholds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartThresholdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartThresholds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartThresholdsSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartThresholds) []DashboardMosaicLayoutTilesWidgetXyChartThresholds { @@ -9224,23 +9395,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartXAxisSet(c *Client, d if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartXAxis + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartXAxis for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartXAxisNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartXAxis(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartXAxisSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartXAxis) []DashboardMosaicLayoutTilesWidgetXyChartXAxis { @@ -9345,23 +9519,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartYAxisSet(c *Client, d if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartYAxis + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartYAxis for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartYAxisNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartYAxis(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartYAxisSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartYAxis) []DashboardMosaicLayoutTilesWidgetXyChartYAxis { @@ -9457,23 +9634,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartChartOptionsSet(c *Cl if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetXyChartChartOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetXyChartChartOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetXyChartChartOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartChartOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetXyChartChartOptionsSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetXyChartChartOptions) []DashboardMosaicLayoutTilesWidgetXyChartChartOptions { @@ -9572,23 +9752,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardSet(c *Client, des, if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecard + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecard for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecard(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecard) []DashboardMosaicLayoutTilesWidgetScorecard { @@ -9699,23 +9882,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQuerySet( if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQuery + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQuery for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQuery(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQuerySlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQuery) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQuery { @@ -9820,23 +10006,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilter) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilter { @@ -9955,23 +10144,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterAggregationSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterAggregation) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterAggregation { @@ -10090,23 +10282,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation { @@ -10214,23 +10409,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter { @@ -10329,23 +10527,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatio + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatio for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatio(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatio) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatio { @@ -10446,23 +10647,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator { @@ -10581,23 +10785,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation { @@ -10698,23 +10905,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator { @@ -10833,23 +11043,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation { @@ -10968,23 +11181,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation { @@ -11092,23 +11308,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTime if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter) []DashboardMosaicLayoutTilesWidgetScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter { @@ -11210,23 +11429,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardGaugeViewSet(c *Cli if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardGaugeView + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardGaugeView for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardGaugeViewNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardGaugeView(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardGaugeViewSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardGaugeView) []DashboardMosaicLayoutTilesWidgetScorecardGaugeView { @@ -11331,23 +11553,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardSparkChartViewSet(c if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardSparkChartView + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardSparkChartView for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardSparkChartViewNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardSparkChartView(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardSparkChartViewSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardSparkChartView) []DashboardMosaicLayoutTilesWidgetScorecardSparkChartView { @@ -11464,23 +11689,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardThresholdsSet(c *Cl if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetScorecardThresholds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetScorecardThresholds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetScorecardThresholdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardThresholds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetScorecardThresholdsSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetScorecardThresholds) []DashboardMosaicLayoutTilesWidgetScorecardThresholds { @@ -11585,23 +11813,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetTextSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetText + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetText for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetTextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetText(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetTextSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetText) []DashboardMosaicLayoutTilesWidgetText { @@ -11689,23 +11920,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetBlankSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetBlank + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetBlank for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetBlankNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetBlank(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetBlankSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetBlank) []DashboardMosaicLayoutTilesWidgetBlank { @@ -11812,23 +12046,26 @@ func canonicalizeNewDashboardMosaicLayoutTilesWidgetLogsPanelSet(c *Client, des, if des == nil { return nw } - var reorderedNew []DashboardMosaicLayoutTilesWidgetLogsPanel + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardMosaicLayoutTilesWidgetLogsPanel for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardMosaicLayoutTilesWidgetLogsPanelNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardMosaicLayoutTilesWidgetLogsPanel(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardMosaicLayoutTilesWidgetLogsPanelSlice(c *Client, des, nw []DashboardMosaicLayoutTilesWidgetLogsPanel) []DashboardMosaicLayoutTilesWidgetLogsPanel { @@ -11921,23 +12158,26 @@ func canonicalizeNewDashboardRowLayoutSet(c *Client, des, nw []DashboardRowLayou if des == nil { return nw } - var reorderedNew []DashboardRowLayout + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayout for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayout(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutSlice(c *Client, des, nw []DashboardRowLayout) []DashboardRowLayout { @@ -12036,23 +12276,26 @@ func canonicalizeNewDashboardRowLayoutRowsSet(c *Client, des, nw []DashboardRowL if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRows + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRows for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRows(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsSlice(c *Client, des, nw []DashboardRowLayoutRows) []DashboardRowLayoutRows { @@ -12211,23 +12454,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsSet(c *Client, des, nw []Dashbo if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgets) []DashboardRowLayoutRowsWidgets { @@ -12336,23 +12582,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChart + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChart for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChart(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChart) []DashboardRowLayoutRowsWidgetsXyChart { @@ -12467,23 +12716,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsSet(c *Client, d if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSets) []DashboardRowLayoutRowsWidgetsXyChartDataSets { @@ -12594,23 +12846,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryS if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQuery + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQuery for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQuery(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQuerySlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQuery) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQuery { @@ -12715,23 +12970,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter { @@ -12850,23 +13108,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregationSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation { @@ -12985,23 +13246,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation { @@ -13109,23 +13373,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter { @@ -13224,23 +13491,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio { @@ -13341,23 +13611,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator { @@ -13476,23 +13749,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation { @@ -13593,23 +13869,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator { @@ -13728,23 +14007,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation { @@ -13863,23 +14145,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation { @@ -13987,23 +14272,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter) []DashboardRowLayoutRowsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter { @@ -14120,23 +14408,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartThresholdsSet(c *Client, if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartThresholds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartThresholds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartThresholdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartThresholds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartThresholdsSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartThresholds) []DashboardRowLayoutRowsWidgetsXyChartThresholds { @@ -14241,23 +14532,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartXAxisSet(c *Client, des, if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartXAxis + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartXAxis for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartXAxisNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartXAxis(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartXAxisSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartXAxis) []DashboardRowLayoutRowsWidgetsXyChartXAxis { @@ -14362,23 +14656,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartYAxisSet(c *Client, des, if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartYAxis + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartYAxis for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartYAxisNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartYAxis(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartYAxisSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartYAxis) []DashboardRowLayoutRowsWidgetsXyChartYAxis { @@ -14474,23 +14771,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartChartOptionsSet(c *Clien if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsXyChartChartOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsXyChartChartOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsXyChartChartOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartChartOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsXyChartChartOptionsSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsXyChartChartOptions) []DashboardRowLayoutRowsWidgetsXyChartChartOptions { @@ -14589,23 +14889,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecard + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecard for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecard(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecard) []DashboardRowLayoutRowsWidgetsScorecard { @@ -14716,23 +15019,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQuerySet(c * if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQuery + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQuery for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQuery(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQuerySlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQuery) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQuery { @@ -14837,23 +15143,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSer if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilter) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilter { @@ -14972,23 +15281,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSer if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation { @@ -15107,23 +15419,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSer if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation { @@ -15231,23 +15546,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSer if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter { @@ -15346,23 +15664,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSer if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio { @@ -15463,23 +15784,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSer if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator { @@ -15598,23 +15922,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSer if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation { @@ -15715,23 +16042,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSer if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator { @@ -15850,23 +16180,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSer if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation { @@ -15985,23 +16318,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSer if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation { @@ -16109,23 +16445,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSer if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter) []DashboardRowLayoutRowsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter { @@ -16227,23 +16566,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardGaugeViewSet(c *Client if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardGaugeView + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardGaugeView for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardGaugeViewNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardGaugeView(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardGaugeViewSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardGaugeView) []DashboardRowLayoutRowsWidgetsScorecardGaugeView { @@ -16348,23 +16690,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardSparkChartViewSet(c *C if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardSparkChartView + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardSparkChartView for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardSparkChartViewNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardSparkChartView(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardSparkChartViewSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardSparkChartView) []DashboardRowLayoutRowsWidgetsScorecardSparkChartView { @@ -16481,23 +16826,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardThresholdsSet(c *Clien if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsScorecardThresholds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsScorecardThresholds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsScorecardThresholdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardThresholds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsScorecardThresholdsSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsScorecardThresholds) []DashboardRowLayoutRowsWidgetsScorecardThresholds { @@ -16602,23 +16950,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsTextSet(c *Client, des, nw []Da if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsText + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsText for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsTextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsText(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsTextSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsText) []DashboardRowLayoutRowsWidgetsText { @@ -16706,23 +17057,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsBlankSet(c *Client, des, nw []D if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsBlank + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsBlank for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsBlankNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsBlank(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsBlankSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsBlank) []DashboardRowLayoutRowsWidgetsBlank { @@ -16829,23 +17183,26 @@ func canonicalizeNewDashboardRowLayoutRowsWidgetsLogsPanelSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []DashboardRowLayoutRowsWidgetsLogsPanel + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardRowLayoutRowsWidgetsLogsPanel for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardRowLayoutRowsWidgetsLogsPanelNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardRowLayoutRowsWidgetsLogsPanel(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardRowLayoutRowsWidgetsLogsPanelSlice(c *Client, des, nw []DashboardRowLayoutRowsWidgetsLogsPanel) []DashboardRowLayoutRowsWidgetsLogsPanel { @@ -16938,23 +17295,26 @@ func canonicalizeNewDashboardColumnLayoutSet(c *Client, des, nw []DashboardColum if des == nil { return nw } - var reorderedNew []DashboardColumnLayout + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayout for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayout(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutSlice(c *Client, des, nw []DashboardColumnLayout) []DashboardColumnLayout { @@ -17053,23 +17413,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsSet(c *Client, des, nw []Dashboa if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumns + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumns for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumns(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsSlice(c *Client, des, nw []DashboardColumnLayoutColumns) []DashboardColumnLayoutColumns { @@ -17228,23 +17591,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgets) []DashboardColumnLayoutColumnsWidgets { @@ -17353,23 +17719,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartSet(c *Client, des if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChart + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChart for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChart(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChart) []DashboardColumnLayoutColumnsWidgetsXyChart { @@ -17484,23 +17853,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsSet(c *Cli if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSets + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSets for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSets(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSets) []DashboardColumnLayoutColumnsWidgetsXyChartDataSets { @@ -17611,23 +17983,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQuery + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQuery for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQuery(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQuerySlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQuery) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQuery { @@ -17732,23 +18107,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilter { @@ -17867,23 +18245,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregationSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterAggregation { @@ -18002,23 +18383,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregationSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterSecondaryAggregation { @@ -18126,23 +18510,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter { @@ -18241,23 +18628,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatio { @@ -18358,23 +18748,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumerator { @@ -18493,23 +18886,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation { @@ -18610,23 +19006,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominator { @@ -18745,23 +19144,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation { @@ -18880,23 +19282,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation { @@ -19004,23 +19409,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeries if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter) []DashboardColumnLayoutColumnsWidgetsXyChartDataSetsTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter { @@ -19137,23 +19545,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartThresholdsSet(c *C if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartThresholds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartThresholds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartThresholdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartThresholds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartThresholdsSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartThresholds) []DashboardColumnLayoutColumnsWidgetsXyChartThresholds { @@ -19258,23 +19669,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartXAxisSet(c *Client if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartXAxis + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartXAxis for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartXAxisNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartXAxis(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartXAxisSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartXAxis) []DashboardColumnLayoutColumnsWidgetsXyChartXAxis { @@ -19379,23 +19793,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartYAxisSet(c *Client if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartYAxis + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartYAxis for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartYAxisNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartYAxis(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartYAxisSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartYAxis) []DashboardColumnLayoutColumnsWidgetsXyChartYAxis { @@ -19491,23 +19908,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartChartOptionsSet(c if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsXyChartChartOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsXyChartChartOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsXyChartChartOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartChartOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsXyChartChartOptionsSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsXyChartChartOptions) []DashboardColumnLayoutColumnsWidgetsXyChartChartOptions { @@ -19606,23 +20026,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardSet(c *Client, d if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecard + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecard for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecard(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecard) []DashboardColumnLayoutColumnsWidgetsScorecard { @@ -19733,23 +20156,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryS if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQuery + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQuery for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQuery(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQuerySlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQuery) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQuery { @@ -19854,23 +20280,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilter) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilter { @@ -19989,23 +20418,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregationSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterAggregation { @@ -20124,23 +20556,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregationSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterSecondaryAggregation { @@ -20248,23 +20683,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterPickTimeSeriesFilter { @@ -20363,23 +20801,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatio { @@ -20480,23 +20921,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumerator { @@ -20615,23 +21059,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregationSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioNumeratorAggregation { @@ -20732,23 +21179,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominator { @@ -20867,23 +21317,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregationSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioDenominatorAggregation { @@ -21002,23 +21455,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregationSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioSecondaryAggregation { @@ -21126,23 +21582,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryT if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilterSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter) []DashboardColumnLayoutColumnsWidgetsScorecardTimeSeriesQueryTimeSeriesFilterRatioPickTimeSeriesFilter { @@ -21244,23 +21703,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardGaugeViewSet(c * if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardGaugeView + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardGaugeView for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardGaugeViewNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardGaugeView(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardGaugeViewSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardGaugeView) []DashboardColumnLayoutColumnsWidgetsScorecardGaugeView { @@ -21365,23 +21827,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardSparkChartViewSe if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardSparkChartView + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardSparkChartView for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardSparkChartViewNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardSparkChartView(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardSparkChartViewSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardSparkChartView) []DashboardColumnLayoutColumnsWidgetsScorecardSparkChartView { @@ -21498,23 +21963,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardThresholdsSet(c if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsScorecardThresholds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsScorecardThresholds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsScorecardThresholdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardThresholds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsScorecardThresholdsSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsScorecardThresholds) []DashboardColumnLayoutColumnsWidgetsScorecardThresholds { @@ -21619,23 +22087,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsTextSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsText + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsText for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsTextNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsText(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsTextSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsText) []DashboardColumnLayoutColumnsWidgetsText { @@ -21723,23 +22194,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsBlankSet(c *Client, des, if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsBlank + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsBlank for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsBlankNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsBlank(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsBlankSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsBlank) []DashboardColumnLayoutColumnsWidgetsBlank { @@ -21846,23 +22320,26 @@ func canonicalizeNewDashboardColumnLayoutColumnsWidgetsLogsPanelSet(c *Client, d if des == nil { return nw } - var reorderedNew []DashboardColumnLayoutColumnsWidgetsLogsPanel + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []DashboardColumnLayoutColumnsWidgetsLogsPanel for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareDashboardColumnLayoutColumnsWidgetsLogsPanelNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewDashboardColumnLayoutColumnsWidgetsLogsPanel(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewDashboardColumnLayoutColumnsWidgetsLogsPanelSlice(c *Client, des, nw []DashboardColumnLayoutColumnsWidgetsLogsPanel) []DashboardColumnLayoutColumnsWidgetsLogsPanel { diff --git a/services/google/monitoring/metric_descriptor_internal.go b/services/google/monitoring/metric_descriptor_internal.go index e8995acea4..98d5a98fd2 100755 --- a/services/google/monitoring/metric_descriptor_internal.go +++ b/services/google/monitoring/metric_descriptor_internal.go @@ -595,23 +595,26 @@ func canonicalizeNewMetricDescriptorLabelsSet(c *Client, des, nw []MetricDescrip if des == nil { return nw } - var reorderedNew []MetricDescriptorLabels + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MetricDescriptorLabels for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMetricDescriptorLabelsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMetricDescriptorLabels(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMetricDescriptorLabelsSlice(c *Client, des, nw []MetricDescriptorLabels) []MetricDescriptorLabels { @@ -724,23 +727,26 @@ func canonicalizeNewMetricDescriptorMetadataSet(c *Client, des, nw []MetricDescr if des == nil { return nw } - var reorderedNew []MetricDescriptorMetadata + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MetricDescriptorMetadata for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMetricDescriptorMetadataNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMetricDescriptorMetadata(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMetricDescriptorMetadataSlice(c *Client, des, nw []MetricDescriptorMetadata) []MetricDescriptorMetadata { diff --git a/services/google/monitoring/metrics_scope_internal.go b/services/google/monitoring/metrics_scope_internal.go index b3b75b41f6..818c939e3e 100755 --- a/services/google/monitoring/metrics_scope_internal.go +++ b/services/google/monitoring/metrics_scope_internal.go @@ -271,23 +271,26 @@ func canonicalizeNewMetricsScopeMonitoredProjectsSet(c *Client, des, nw []Metric if des == nil { return nw } - var reorderedNew []MetricsScopeMonitoredProjects + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []MetricsScopeMonitoredProjects for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareMetricsScopeMonitoredProjectsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewMetricsScopeMonitoredProjects(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewMetricsScopeMonitoredProjectsSlice(c *Client, des, nw []MetricsScopeMonitoredProjects) []MetricsScopeMonitoredProjects { diff --git a/services/google/monitoring/service_internal.go b/services/google/monitoring/service_internal.go index 1b0e646907..45f32e582c 100755 --- a/services/google/monitoring/service_internal.go +++ b/services/google/monitoring/service_internal.go @@ -555,23 +555,26 @@ func canonicalizeNewServiceCustomSet(c *Client, des, nw []ServiceCustom) []Servi if des == nil { return nw } - var reorderedNew []ServiceCustom + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceCustom for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceCustomNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceCustom(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceCustomSlice(c *Client, des, nw []ServiceCustom) []ServiceCustom { @@ -670,23 +673,26 @@ func canonicalizeNewServiceTelemetrySet(c *Client, des, nw []ServiceTelemetry) [ if des == nil { return nw } - var reorderedNew []ServiceTelemetry + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceTelemetry for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceTelemetryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceTelemetry(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceTelemetrySlice(c *Client, des, nw []ServiceTelemetry) []ServiceTelemetry { diff --git a/services/google/monitoring/service_level_objective_internal.go b/services/google/monitoring/service_level_objective_internal.go index 7052b8898f..53146506bf 100755 --- a/services/google/monitoring/service_level_objective_internal.go +++ b/services/google/monitoring/service_level_objective_internal.go @@ -894,23 +894,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorSet(c *Client, des if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicator + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicator for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicator(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicator) []ServiceLevelObjectiveServiceLevelIndicator { @@ -1073,23 +1076,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliSet(c *Cli if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorBasicSli + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorBasicSli for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorBasicSliNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSli(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorBasicSli) []ServiceLevelObjectiveServiceLevelIndicatorBasicSli { @@ -1177,23 +1183,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliAvailabili if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorBasicSliAvailability + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorBasicSliAvailability for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorBasicSliAvailabilityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliAvailability(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliAvailabilitySlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorBasicSliAvailability) []ServiceLevelObjectiveServiceLevelIndicatorBasicSliAvailability { @@ -1298,23 +1307,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliLatencySet if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorBasicSliLatency + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorBasicSliLatency for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorBasicSliLatencyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliLatency(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliLatencySlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorBasicSliLatency) []ServiceLevelObjectiveServiceLevelIndicatorBasicSliLatency { @@ -1402,23 +1414,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationA if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationAvailability + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationAvailability for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationAvailabilityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationAvailability(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationAvailabilitySlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationAvailability) []ServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationAvailability { @@ -1523,23 +1538,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationL if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationLatency + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationLatency for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationLatencyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationLatency(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationLatencySlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationLatency) []ServiceLevelObjectiveServiceLevelIndicatorBasicSliOperationLatency { @@ -1654,23 +1672,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBasedSet(c if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorRequestBased + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorRequestBased for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorRequestBasedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBased(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBasedSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorRequestBased) []ServiceLevelObjectiveServiceLevelIndicatorRequestBased { @@ -1785,23 +1806,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBasedGoodTo if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedGoodTotalRatio + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedGoodTotalRatio for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorRequestBasedGoodTotalRatioNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBasedGoodTotalRatio(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBasedGoodTotalRatioSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedGoodTotalRatio) []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedGoodTotalRatio { @@ -1902,23 +1926,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistri if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCut + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCut for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCutNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCut(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCutSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCut) []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCut { @@ -2020,23 +2047,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistri if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCutRange + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCutRange for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCutRangeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCutRange(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCutRangeSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCutRange) []ServiceLevelObjectiveServiceLevelIndicatorRequestBasedDistributionCutRange { @@ -2189,23 +2219,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedSet(c if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBased + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBased for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBased(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBased) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBased { @@ -2326,23 +2359,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTo if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThreshold + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThreshold for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThreshold(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThreshold) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThreshold { @@ -2457,23 +2493,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTo if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformance + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformance for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformance(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformance) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformance { @@ -2588,23 +2627,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTo if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceGoodTotalRatio + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceGoodTotalRatio for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceGoodTotalRatioNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceGoodTotalRatio(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceGoodTotalRatioSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceGoodTotalRatio) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceGoodTotalRatio { @@ -2705,23 +2747,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTo if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCut + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCut for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCutNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCut(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCutSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCut) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCut { @@ -2823,23 +2868,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTo if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCutRange + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCutRange for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCutRangeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCutRange(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCutRangeSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCutRange) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdPerformanceDistributionCutRange { @@ -3002,23 +3050,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTo if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformance + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformance for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformance(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformance) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformance { @@ -3106,23 +3157,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTo if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceAvailability + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceAvailability for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceAvailabilityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceAvailability(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceAvailabilitySlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceAvailability) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceAvailability { @@ -3227,23 +3281,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTo if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceLatency + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceLatency for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceLatencyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceLatency(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceLatencySlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceLatency) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceLatency { @@ -3331,23 +3388,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTo if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationAvailability + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationAvailability for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationAvailabilityNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationAvailability(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationAvailabilitySlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationAvailability) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationAvailability { @@ -3452,23 +3512,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTo if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationLatency + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationLatency for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationLatencyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationLatency(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationLatencySlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationLatency) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedGoodTotalRatioThresholdBasicSliPerformanceOperationLatency { @@ -3569,23 +3632,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetric if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRange + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRange for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRangeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRange(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRangeSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRange) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRange { @@ -3687,23 +3753,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetric if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRangeRange + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRangeRange for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRangeRangeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRangeRange(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRangeRangeSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRangeRange) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricMeanInRangeRange { @@ -3804,23 +3873,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetric if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRange + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRange for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRangeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRange(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRangeSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRange) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRange { @@ -3922,23 +3994,26 @@ func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetric if des == nil { return nw } - var reorderedNew []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRangeRange + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRangeRange for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRangeRangeNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRangeRange(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRangeRangeSlice(c *Client, des, nw []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRangeRange) []ServiceLevelObjectiveServiceLevelIndicatorWindowsBasedMetricSumInRangeRange { diff --git a/services/google/monitoring/uptime_check_config_internal.go b/services/google/monitoring/uptime_check_config_internal.go index 09bcb54c93..3c9ad4c003 100755 --- a/services/google/monitoring/uptime_check_config_internal.go +++ b/services/google/monitoring/uptime_check_config_internal.go @@ -775,23 +775,26 @@ func canonicalizeNewUptimeCheckConfigMonitoredResourceSet(c *Client, des, nw []U if des == nil { return nw } - var reorderedNew []UptimeCheckConfigMonitoredResource + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []UptimeCheckConfigMonitoredResource for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareUptimeCheckConfigMonitoredResourceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewUptimeCheckConfigMonitoredResource(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewUptimeCheckConfigMonitoredResourceSlice(c *Client, des, nw []UptimeCheckConfigMonitoredResource) []UptimeCheckConfigMonitoredResource { @@ -893,23 +896,26 @@ func canonicalizeNewUptimeCheckConfigResourceGroupSet(c *Client, des, nw []Uptim if des == nil { return nw } - var reorderedNew []UptimeCheckConfigResourceGroup + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []UptimeCheckConfigResourceGroup for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareUptimeCheckConfigResourceGroupNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewUptimeCheckConfigResourceGroup(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewUptimeCheckConfigResourceGroupSlice(c *Client, des, nw []UptimeCheckConfigResourceGroup) []UptimeCheckConfigResourceGroup { @@ -1083,23 +1089,26 @@ func canonicalizeNewUptimeCheckConfigHttpCheckSet(c *Client, des, nw []UptimeChe if des == nil { return nw } - var reorderedNew []UptimeCheckConfigHttpCheck + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []UptimeCheckConfigHttpCheck for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareUptimeCheckConfigHttpCheckNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewUptimeCheckConfigHttpCheck(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewUptimeCheckConfigHttpCheckSlice(c *Client, des, nw []UptimeCheckConfigHttpCheck) []UptimeCheckConfigHttpCheck { @@ -1204,23 +1213,26 @@ func canonicalizeNewUptimeCheckConfigHttpCheckAuthInfoSet(c *Client, des, nw []U if des == nil { return nw } - var reorderedNew []UptimeCheckConfigHttpCheckAuthInfo + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []UptimeCheckConfigHttpCheckAuthInfo for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareUptimeCheckConfigHttpCheckAuthInfoNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewUptimeCheckConfigHttpCheckAuthInfo(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewUptimeCheckConfigHttpCheckAuthInfoSlice(c *Client, des, nw []UptimeCheckConfigHttpCheckAuthInfo) []UptimeCheckConfigHttpCheckAuthInfo { @@ -1316,23 +1328,26 @@ func canonicalizeNewUptimeCheckConfigTcpCheckSet(c *Client, des, nw []UptimeChec if des == nil { return nw } - var reorderedNew []UptimeCheckConfigTcpCheck + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []UptimeCheckConfigTcpCheck for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareUptimeCheckConfigTcpCheckNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewUptimeCheckConfigTcpCheck(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewUptimeCheckConfigTcpCheckSlice(c *Client, des, nw []UptimeCheckConfigTcpCheck) []UptimeCheckConfigTcpCheck { @@ -1445,23 +1460,26 @@ func canonicalizeNewUptimeCheckConfigContentMatchersSet(c *Client, des, nw []Upt if des == nil { return nw } - var reorderedNew []UptimeCheckConfigContentMatchers + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []UptimeCheckConfigContentMatchers for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareUptimeCheckConfigContentMatchersNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewUptimeCheckConfigContentMatchers(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewUptimeCheckConfigContentMatchersSlice(c *Client, des, nw []UptimeCheckConfigContentMatchers) []UptimeCheckConfigContentMatchers { diff --git a/services/google/networkconnectivity/alpha/hub_internal.go b/services/google/networkconnectivity/alpha/hub_internal.go index 55118275e3..390c225d6d 100755 --- a/services/google/networkconnectivity/alpha/hub_internal.go +++ b/services/google/networkconnectivity/alpha/hub_internal.go @@ -586,23 +586,26 @@ func canonicalizeNewHubRoutingVpcsSet(c *Client, des, nw []HubRoutingVpcs) []Hub if des == nil { return nw } - var reorderedNew []HubRoutingVpcs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HubRoutingVpcs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHubRoutingVpcsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHubRoutingVpcs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHubRoutingVpcsSlice(c *Client, des, nw []HubRoutingVpcs) []HubRoutingVpcs { diff --git a/services/google/networkconnectivity/alpha/spoke_internal.go b/services/google/networkconnectivity/alpha/spoke_internal.go index 1dbf5040d4..89855d2004 100755 --- a/services/google/networkconnectivity/alpha/spoke_internal.go +++ b/services/google/networkconnectivity/alpha/spoke_internal.go @@ -736,23 +736,26 @@ func canonicalizeNewSpokeLinkedVpnTunnelsSet(c *Client, des, nw []SpokeLinkedVpn if des == nil { return nw } - var reorderedNew []SpokeLinkedVpnTunnels + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []SpokeLinkedVpnTunnels for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareSpokeLinkedVpnTunnelsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewSpokeLinkedVpnTunnels(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewSpokeLinkedVpnTunnelsSlice(c *Client, des, nw []SpokeLinkedVpnTunnels) []SpokeLinkedVpnTunnels { @@ -859,23 +862,26 @@ func canonicalizeNewSpokeLinkedInterconnectAttachmentsSet(c *Client, des, nw []S if des == nil { return nw } - var reorderedNew []SpokeLinkedInterconnectAttachments + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []SpokeLinkedInterconnectAttachments for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareSpokeLinkedInterconnectAttachmentsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewSpokeLinkedInterconnectAttachments(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewSpokeLinkedInterconnectAttachmentsSlice(c *Client, des, nw []SpokeLinkedInterconnectAttachments) []SpokeLinkedInterconnectAttachments { @@ -976,23 +982,26 @@ func canonicalizeNewSpokeLinkedRouterApplianceInstancesSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []SpokeLinkedRouterApplianceInstances + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []SpokeLinkedRouterApplianceInstances for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareSpokeLinkedRouterApplianceInstancesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewSpokeLinkedRouterApplianceInstances(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewSpokeLinkedRouterApplianceInstancesSlice(c *Client, des, nw []SpokeLinkedRouterApplianceInstances) []SpokeLinkedRouterApplianceInstances { @@ -1097,23 +1106,26 @@ func canonicalizeNewSpokeLinkedRouterApplianceInstancesInstancesSet(c *Client, d if des == nil { return nw } - var reorderedNew []SpokeLinkedRouterApplianceInstancesInstances + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []SpokeLinkedRouterApplianceInstancesInstances for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareSpokeLinkedRouterApplianceInstancesInstancesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewSpokeLinkedRouterApplianceInstancesInstances(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewSpokeLinkedRouterApplianceInstancesInstancesSlice(c *Client, des, nw []SpokeLinkedRouterApplianceInstancesInstances) []SpokeLinkedRouterApplianceInstancesInstances { diff --git a/services/google/networkconnectivity/beta/hub_internal.go b/services/google/networkconnectivity/beta/hub_internal.go index b5a140de97..951b7dfd2b 100755 --- a/services/google/networkconnectivity/beta/hub_internal.go +++ b/services/google/networkconnectivity/beta/hub_internal.go @@ -586,23 +586,26 @@ func canonicalizeNewHubRoutingVpcsSet(c *Client, des, nw []HubRoutingVpcs) []Hub if des == nil { return nw } - var reorderedNew []HubRoutingVpcs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HubRoutingVpcs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHubRoutingVpcsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHubRoutingVpcs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHubRoutingVpcsSlice(c *Client, des, nw []HubRoutingVpcs) []HubRoutingVpcs { diff --git a/services/google/networkconnectivity/beta/spoke_internal.go b/services/google/networkconnectivity/beta/spoke_internal.go index 9799db673c..be5bd89cbd 100755 --- a/services/google/networkconnectivity/beta/spoke_internal.go +++ b/services/google/networkconnectivity/beta/spoke_internal.go @@ -736,23 +736,26 @@ func canonicalizeNewSpokeLinkedVpnTunnelsSet(c *Client, des, nw []SpokeLinkedVpn if des == nil { return nw } - var reorderedNew []SpokeLinkedVpnTunnels + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []SpokeLinkedVpnTunnels for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareSpokeLinkedVpnTunnelsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewSpokeLinkedVpnTunnels(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewSpokeLinkedVpnTunnelsSlice(c *Client, des, nw []SpokeLinkedVpnTunnels) []SpokeLinkedVpnTunnels { @@ -859,23 +862,26 @@ func canonicalizeNewSpokeLinkedInterconnectAttachmentsSet(c *Client, des, nw []S if des == nil { return nw } - var reorderedNew []SpokeLinkedInterconnectAttachments + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []SpokeLinkedInterconnectAttachments for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareSpokeLinkedInterconnectAttachmentsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewSpokeLinkedInterconnectAttachments(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewSpokeLinkedInterconnectAttachmentsSlice(c *Client, des, nw []SpokeLinkedInterconnectAttachments) []SpokeLinkedInterconnectAttachments { @@ -976,23 +982,26 @@ func canonicalizeNewSpokeLinkedRouterApplianceInstancesSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []SpokeLinkedRouterApplianceInstances + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []SpokeLinkedRouterApplianceInstances for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareSpokeLinkedRouterApplianceInstancesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewSpokeLinkedRouterApplianceInstances(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewSpokeLinkedRouterApplianceInstancesSlice(c *Client, des, nw []SpokeLinkedRouterApplianceInstances) []SpokeLinkedRouterApplianceInstances { @@ -1097,23 +1106,26 @@ func canonicalizeNewSpokeLinkedRouterApplianceInstancesInstancesSet(c *Client, d if des == nil { return nw } - var reorderedNew []SpokeLinkedRouterApplianceInstancesInstances + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []SpokeLinkedRouterApplianceInstancesInstances for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareSpokeLinkedRouterApplianceInstancesInstancesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewSpokeLinkedRouterApplianceInstancesInstances(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewSpokeLinkedRouterApplianceInstancesInstancesSlice(c *Client, des, nw []SpokeLinkedRouterApplianceInstancesInstances) []SpokeLinkedRouterApplianceInstancesInstances { diff --git a/services/google/networkconnectivity/hub_internal.go b/services/google/networkconnectivity/hub_internal.go index 3d1c60ef09..67f4bc9e90 100755 --- a/services/google/networkconnectivity/hub_internal.go +++ b/services/google/networkconnectivity/hub_internal.go @@ -586,23 +586,26 @@ func canonicalizeNewHubRoutingVpcsSet(c *Client, des, nw []HubRoutingVpcs) []Hub if des == nil { return nw } - var reorderedNew []HubRoutingVpcs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HubRoutingVpcs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHubRoutingVpcsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHubRoutingVpcs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHubRoutingVpcsSlice(c *Client, des, nw []HubRoutingVpcs) []HubRoutingVpcs { diff --git a/services/google/networkconnectivity/spoke_internal.go b/services/google/networkconnectivity/spoke_internal.go index 4ce893f5b5..d2d4d5aa3f 100755 --- a/services/google/networkconnectivity/spoke_internal.go +++ b/services/google/networkconnectivity/spoke_internal.go @@ -736,23 +736,26 @@ func canonicalizeNewSpokeLinkedVpnTunnelsSet(c *Client, des, nw []SpokeLinkedVpn if des == nil { return nw } - var reorderedNew []SpokeLinkedVpnTunnels + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []SpokeLinkedVpnTunnels for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareSpokeLinkedVpnTunnelsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewSpokeLinkedVpnTunnels(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewSpokeLinkedVpnTunnelsSlice(c *Client, des, nw []SpokeLinkedVpnTunnels) []SpokeLinkedVpnTunnels { @@ -859,23 +862,26 @@ func canonicalizeNewSpokeLinkedInterconnectAttachmentsSet(c *Client, des, nw []S if des == nil { return nw } - var reorderedNew []SpokeLinkedInterconnectAttachments + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []SpokeLinkedInterconnectAttachments for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareSpokeLinkedInterconnectAttachmentsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewSpokeLinkedInterconnectAttachments(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewSpokeLinkedInterconnectAttachmentsSlice(c *Client, des, nw []SpokeLinkedInterconnectAttachments) []SpokeLinkedInterconnectAttachments { @@ -976,23 +982,26 @@ func canonicalizeNewSpokeLinkedRouterApplianceInstancesSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []SpokeLinkedRouterApplianceInstances + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []SpokeLinkedRouterApplianceInstances for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareSpokeLinkedRouterApplianceInstancesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewSpokeLinkedRouterApplianceInstances(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewSpokeLinkedRouterApplianceInstancesSlice(c *Client, des, nw []SpokeLinkedRouterApplianceInstances) []SpokeLinkedRouterApplianceInstances { @@ -1097,23 +1106,26 @@ func canonicalizeNewSpokeLinkedRouterApplianceInstancesInstancesSet(c *Client, d if des == nil { return nw } - var reorderedNew []SpokeLinkedRouterApplianceInstancesInstances + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []SpokeLinkedRouterApplianceInstancesInstances for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareSpokeLinkedRouterApplianceInstancesInstancesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewSpokeLinkedRouterApplianceInstancesInstances(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewSpokeLinkedRouterApplianceInstancesInstancesSlice(c *Client, des, nw []SpokeLinkedRouterApplianceInstancesInstances) []SpokeLinkedRouterApplianceInstancesInstances { diff --git a/services/google/networksecurity/alpha/authorization_policy_internal.go b/services/google/networksecurity/alpha/authorization_policy_internal.go index 5bd259451f..4f2e8a4d07 100755 --- a/services/google/networksecurity/alpha/authorization_policy_internal.go +++ b/services/google/networksecurity/alpha/authorization_policy_internal.go @@ -659,23 +659,26 @@ func canonicalizeNewAuthorizationPolicyRulesSet(c *Client, des, nw []Authorizati if des == nil { return nw } - var reorderedNew []AuthorizationPolicyRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AuthorizationPolicyRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAuthorizationPolicyRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAuthorizationPolicyRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAuthorizationPolicyRulesSlice(c *Client, des, nw []AuthorizationPolicyRules) []AuthorizationPolicyRules { @@ -782,23 +785,26 @@ func canonicalizeNewAuthorizationPolicyRulesSourcesSet(c *Client, des, nw []Auth if des == nil { return nw } - var reorderedNew []AuthorizationPolicyRulesSources + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AuthorizationPolicyRulesSources for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAuthorizationPolicyRulesSourcesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAuthorizationPolicyRulesSources(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAuthorizationPolicyRulesSourcesSlice(c *Client, des, nw []AuthorizationPolicyRulesSources) []AuthorizationPolicyRulesSources { @@ -913,23 +919,26 @@ func canonicalizeNewAuthorizationPolicyRulesDestinationsSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []AuthorizationPolicyRulesDestinations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AuthorizationPolicyRulesDestinations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAuthorizationPolicyRulesDestinationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAuthorizationPolicyRulesDestinations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAuthorizationPolicyRulesDestinationsSlice(c *Client, des, nw []AuthorizationPolicyRulesDestinations) []AuthorizationPolicyRulesDestinations { @@ -1036,23 +1045,26 @@ func canonicalizeNewAuthorizationPolicyRulesDestinationsHttpHeaderMatchSet(c *Cl if des == nil { return nw } - var reorderedNew []AuthorizationPolicyRulesDestinationsHttpHeaderMatch + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AuthorizationPolicyRulesDestinationsHttpHeaderMatch for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAuthorizationPolicyRulesDestinationsHttpHeaderMatchNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAuthorizationPolicyRulesDestinationsHttpHeaderMatch(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAuthorizationPolicyRulesDestinationsHttpHeaderMatchSlice(c *Client, des, nw []AuthorizationPolicyRulesDestinationsHttpHeaderMatch) []AuthorizationPolicyRulesDestinationsHttpHeaderMatch { diff --git a/services/google/networksecurity/alpha/client_tls_policy_internal.go b/services/google/networksecurity/alpha/client_tls_policy_internal.go index e2d8401241..4a36359d3b 100755 --- a/services/google/networksecurity/alpha/client_tls_policy_internal.go +++ b/services/google/networksecurity/alpha/client_tls_policy_internal.go @@ -749,23 +749,26 @@ func canonicalizeNewClientTlsPolicyClientCertificateSet(c *Client, des, nw []Cli if des == nil { return nw } - var reorderedNew []ClientTlsPolicyClientCertificate + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClientTlsPolicyClientCertificate for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClientTlsPolicyClientCertificateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClientTlsPolicyClientCertificate(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClientTlsPolicyClientCertificateSlice(c *Client, des, nw []ClientTlsPolicyClientCertificate) []ClientTlsPolicyClientCertificate { @@ -872,23 +875,26 @@ func canonicalizeNewClientTlsPolicyClientCertificateLocalFilepathSet(c *Client, if des == nil { return nw } - var reorderedNew []ClientTlsPolicyClientCertificateLocalFilepath + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClientTlsPolicyClientCertificateLocalFilepath for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClientTlsPolicyClientCertificateLocalFilepathNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClientTlsPolicyClientCertificateLocalFilepath(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClientTlsPolicyClientCertificateLocalFilepathSlice(c *Client, des, nw []ClientTlsPolicyClientCertificateLocalFilepath) []ClientTlsPolicyClientCertificateLocalFilepath { @@ -987,23 +993,26 @@ func canonicalizeNewClientTlsPolicyClientCertificateGrpcEndpointSet(c *Client, d if des == nil { return nw } - var reorderedNew []ClientTlsPolicyClientCertificateGrpcEndpoint + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClientTlsPolicyClientCertificateGrpcEndpoint for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClientTlsPolicyClientCertificateGrpcEndpointNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClientTlsPolicyClientCertificateGrpcEndpoint(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClientTlsPolicyClientCertificateGrpcEndpointSlice(c *Client, des, nw []ClientTlsPolicyClientCertificateGrpcEndpoint) []ClientTlsPolicyClientCertificateGrpcEndpoint { @@ -1102,23 +1111,26 @@ func canonicalizeNewClientTlsPolicyClientCertificateCertificateProviderInstanceS if des == nil { return nw } - var reorderedNew []ClientTlsPolicyClientCertificateCertificateProviderInstance + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClientTlsPolicyClientCertificateCertificateProviderInstance for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClientTlsPolicyClientCertificateCertificateProviderInstanceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClientTlsPolicyClientCertificateCertificateProviderInstance(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClientTlsPolicyClientCertificateCertificateProviderInstanceSlice(c *Client, des, nw []ClientTlsPolicyClientCertificateCertificateProviderInstance) []ClientTlsPolicyClientCertificateCertificateProviderInstance { @@ -1251,23 +1263,26 @@ func canonicalizeNewClientTlsPolicyServerValidationCaSet(c *Client, des, nw []Cl if des == nil { return nw } - var reorderedNew []ClientTlsPolicyServerValidationCa + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClientTlsPolicyServerValidationCa for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClientTlsPolicyServerValidationCaNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClientTlsPolicyServerValidationCa(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClientTlsPolicyServerValidationCaSlice(c *Client, des, nw []ClientTlsPolicyServerValidationCa) []ClientTlsPolicyServerValidationCa { @@ -1366,23 +1381,26 @@ func canonicalizeNewClientTlsPolicyServerValidationCaGrpcEndpointSet(c *Client, if des == nil { return nw } - var reorderedNew []ClientTlsPolicyServerValidationCaGrpcEndpoint + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClientTlsPolicyServerValidationCaGrpcEndpoint for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClientTlsPolicyServerValidationCaGrpcEndpointNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClientTlsPolicyServerValidationCaGrpcEndpoint(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClientTlsPolicyServerValidationCaGrpcEndpointSlice(c *Client, des, nw []ClientTlsPolicyServerValidationCaGrpcEndpoint) []ClientTlsPolicyServerValidationCaGrpcEndpoint { @@ -1481,23 +1499,26 @@ func canonicalizeNewClientTlsPolicyServerValidationCaCertificateProviderInstance if des == nil { return nw } - var reorderedNew []ClientTlsPolicyServerValidationCaCertificateProviderInstance + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClientTlsPolicyServerValidationCaCertificateProviderInstance for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClientTlsPolicyServerValidationCaCertificateProviderInstanceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClientTlsPolicyServerValidationCaCertificateProviderInstance(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClientTlsPolicyServerValidationCaCertificateProviderInstanceSlice(c *Client, des, nw []ClientTlsPolicyServerValidationCaCertificateProviderInstance) []ClientTlsPolicyServerValidationCaCertificateProviderInstance { diff --git a/services/google/networksecurity/alpha/server_tls_policy_internal.go b/services/google/networksecurity/alpha/server_tls_policy_internal.go index e07e4c32bd..b120574f0e 100755 --- a/services/google/networksecurity/alpha/server_tls_policy_internal.go +++ b/services/google/networksecurity/alpha/server_tls_policy_internal.go @@ -761,23 +761,26 @@ func canonicalizeNewServerTlsPolicyServerCertificateSet(c *Client, des, nw []Ser if des == nil { return nw } - var reorderedNew []ServerTlsPolicyServerCertificate + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServerTlsPolicyServerCertificate for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServerTlsPolicyServerCertificateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServerTlsPolicyServerCertificate(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServerTlsPolicyServerCertificateSlice(c *Client, des, nw []ServerTlsPolicyServerCertificate) []ServerTlsPolicyServerCertificate { @@ -884,23 +887,26 @@ func canonicalizeNewServerTlsPolicyServerCertificateLocalFilepathSet(c *Client, if des == nil { return nw } - var reorderedNew []ServerTlsPolicyServerCertificateLocalFilepath + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServerTlsPolicyServerCertificateLocalFilepath for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServerTlsPolicyServerCertificateLocalFilepathNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServerTlsPolicyServerCertificateLocalFilepath(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServerTlsPolicyServerCertificateLocalFilepathSlice(c *Client, des, nw []ServerTlsPolicyServerCertificateLocalFilepath) []ServerTlsPolicyServerCertificateLocalFilepath { @@ -999,23 +1005,26 @@ func canonicalizeNewServerTlsPolicyServerCertificateGrpcEndpointSet(c *Client, d if des == nil { return nw } - var reorderedNew []ServerTlsPolicyServerCertificateGrpcEndpoint + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServerTlsPolicyServerCertificateGrpcEndpoint for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServerTlsPolicyServerCertificateGrpcEndpointNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServerTlsPolicyServerCertificateGrpcEndpoint(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServerTlsPolicyServerCertificateGrpcEndpointSlice(c *Client, des, nw []ServerTlsPolicyServerCertificateGrpcEndpoint) []ServerTlsPolicyServerCertificateGrpcEndpoint { @@ -1114,23 +1123,26 @@ func canonicalizeNewServerTlsPolicyServerCertificateCertificateProviderInstanceS if des == nil { return nw } - var reorderedNew []ServerTlsPolicyServerCertificateCertificateProviderInstance + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServerTlsPolicyServerCertificateCertificateProviderInstance for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServerTlsPolicyServerCertificateCertificateProviderInstanceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServerTlsPolicyServerCertificateCertificateProviderInstance(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServerTlsPolicyServerCertificateCertificateProviderInstanceSlice(c *Client, des, nw []ServerTlsPolicyServerCertificateCertificateProviderInstance) []ServerTlsPolicyServerCertificateCertificateProviderInstance { @@ -1223,23 +1235,26 @@ func canonicalizeNewServerTlsPolicyMtlsPolicySet(c *Client, des, nw []ServerTlsP if des == nil { return nw } - var reorderedNew []ServerTlsPolicyMtlsPolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServerTlsPolicyMtlsPolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServerTlsPolicyMtlsPolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServerTlsPolicyMtlsPolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServerTlsPolicyMtlsPolicySlice(c *Client, des, nw []ServerTlsPolicyMtlsPolicy) []ServerTlsPolicyMtlsPolicy { @@ -1372,23 +1387,26 @@ func canonicalizeNewServerTlsPolicyMtlsPolicyClientValidationCaSet(c *Client, de if des == nil { return nw } - var reorderedNew []ServerTlsPolicyMtlsPolicyClientValidationCa + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServerTlsPolicyMtlsPolicyClientValidationCa for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServerTlsPolicyMtlsPolicyClientValidationCaNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServerTlsPolicyMtlsPolicyClientValidationCa(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServerTlsPolicyMtlsPolicyClientValidationCaSlice(c *Client, des, nw []ServerTlsPolicyMtlsPolicyClientValidationCa) []ServerTlsPolicyMtlsPolicyClientValidationCa { @@ -1487,23 +1505,26 @@ func canonicalizeNewServerTlsPolicyMtlsPolicyClientValidationCaGrpcEndpointSet(c if des == nil { return nw } - var reorderedNew []ServerTlsPolicyMtlsPolicyClientValidationCaGrpcEndpoint + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServerTlsPolicyMtlsPolicyClientValidationCaGrpcEndpoint for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServerTlsPolicyMtlsPolicyClientValidationCaGrpcEndpointNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServerTlsPolicyMtlsPolicyClientValidationCaGrpcEndpoint(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServerTlsPolicyMtlsPolicyClientValidationCaGrpcEndpointSlice(c *Client, des, nw []ServerTlsPolicyMtlsPolicyClientValidationCaGrpcEndpoint) []ServerTlsPolicyMtlsPolicyClientValidationCaGrpcEndpoint { @@ -1602,23 +1623,26 @@ func canonicalizeNewServerTlsPolicyMtlsPolicyClientValidationCaCertificateProvid if des == nil { return nw } - var reorderedNew []ServerTlsPolicyMtlsPolicyClientValidationCaCertificateProviderInstance + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServerTlsPolicyMtlsPolicyClientValidationCaCertificateProviderInstance for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServerTlsPolicyMtlsPolicyClientValidationCaCertificateProviderInstanceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServerTlsPolicyMtlsPolicyClientValidationCaCertificateProviderInstance(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServerTlsPolicyMtlsPolicyClientValidationCaCertificateProviderInstanceSlice(c *Client, des, nw []ServerTlsPolicyMtlsPolicyClientValidationCaCertificateProviderInstance) []ServerTlsPolicyMtlsPolicyClientValidationCaCertificateProviderInstance { diff --git a/services/google/networksecurity/beta/authorization_policy_internal.go b/services/google/networksecurity/beta/authorization_policy_internal.go index f6dac06b85..1fd75281ad 100755 --- a/services/google/networksecurity/beta/authorization_policy_internal.go +++ b/services/google/networksecurity/beta/authorization_policy_internal.go @@ -659,23 +659,26 @@ func canonicalizeNewAuthorizationPolicyRulesSet(c *Client, des, nw []Authorizati if des == nil { return nw } - var reorderedNew []AuthorizationPolicyRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AuthorizationPolicyRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAuthorizationPolicyRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAuthorizationPolicyRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAuthorizationPolicyRulesSlice(c *Client, des, nw []AuthorizationPolicyRules) []AuthorizationPolicyRules { @@ -782,23 +785,26 @@ func canonicalizeNewAuthorizationPolicyRulesSourcesSet(c *Client, des, nw []Auth if des == nil { return nw } - var reorderedNew []AuthorizationPolicyRulesSources + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AuthorizationPolicyRulesSources for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAuthorizationPolicyRulesSourcesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAuthorizationPolicyRulesSources(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAuthorizationPolicyRulesSourcesSlice(c *Client, des, nw []AuthorizationPolicyRulesSources) []AuthorizationPolicyRulesSources { @@ -913,23 +919,26 @@ func canonicalizeNewAuthorizationPolicyRulesDestinationsSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []AuthorizationPolicyRulesDestinations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AuthorizationPolicyRulesDestinations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAuthorizationPolicyRulesDestinationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAuthorizationPolicyRulesDestinations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAuthorizationPolicyRulesDestinationsSlice(c *Client, des, nw []AuthorizationPolicyRulesDestinations) []AuthorizationPolicyRulesDestinations { @@ -1036,23 +1045,26 @@ func canonicalizeNewAuthorizationPolicyRulesDestinationsHttpHeaderMatchSet(c *Cl if des == nil { return nw } - var reorderedNew []AuthorizationPolicyRulesDestinationsHttpHeaderMatch + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []AuthorizationPolicyRulesDestinationsHttpHeaderMatch for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareAuthorizationPolicyRulesDestinationsHttpHeaderMatchNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewAuthorizationPolicyRulesDestinationsHttpHeaderMatch(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewAuthorizationPolicyRulesDestinationsHttpHeaderMatchSlice(c *Client, des, nw []AuthorizationPolicyRulesDestinationsHttpHeaderMatch) []AuthorizationPolicyRulesDestinationsHttpHeaderMatch { diff --git a/services/google/networksecurity/beta/client_tls_policy_internal.go b/services/google/networksecurity/beta/client_tls_policy_internal.go index 2797ab5012..f552c7c456 100755 --- a/services/google/networksecurity/beta/client_tls_policy_internal.go +++ b/services/google/networksecurity/beta/client_tls_policy_internal.go @@ -723,23 +723,26 @@ func canonicalizeNewClientTlsPolicyClientCertificateSet(c *Client, des, nw []Cli if des == nil { return nw } - var reorderedNew []ClientTlsPolicyClientCertificate + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClientTlsPolicyClientCertificate for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClientTlsPolicyClientCertificateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClientTlsPolicyClientCertificate(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClientTlsPolicyClientCertificateSlice(c *Client, des, nw []ClientTlsPolicyClientCertificate) []ClientTlsPolicyClientCertificate { @@ -838,23 +841,26 @@ func canonicalizeNewClientTlsPolicyClientCertificateGrpcEndpointSet(c *Client, d if des == nil { return nw } - var reorderedNew []ClientTlsPolicyClientCertificateGrpcEndpoint + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClientTlsPolicyClientCertificateGrpcEndpoint for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClientTlsPolicyClientCertificateGrpcEndpointNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClientTlsPolicyClientCertificateGrpcEndpoint(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClientTlsPolicyClientCertificateGrpcEndpointSlice(c *Client, des, nw []ClientTlsPolicyClientCertificateGrpcEndpoint) []ClientTlsPolicyClientCertificateGrpcEndpoint { @@ -953,23 +959,26 @@ func canonicalizeNewClientTlsPolicyClientCertificateCertificateProviderInstanceS if des == nil { return nw } - var reorderedNew []ClientTlsPolicyClientCertificateCertificateProviderInstance + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClientTlsPolicyClientCertificateCertificateProviderInstance for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClientTlsPolicyClientCertificateCertificateProviderInstanceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClientTlsPolicyClientCertificateCertificateProviderInstance(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClientTlsPolicyClientCertificateCertificateProviderInstanceSlice(c *Client, des, nw []ClientTlsPolicyClientCertificateCertificateProviderInstance) []ClientTlsPolicyClientCertificateCertificateProviderInstance { @@ -1084,23 +1093,26 @@ func canonicalizeNewClientTlsPolicyServerValidationCaSet(c *Client, des, nw []Cl if des == nil { return nw } - var reorderedNew []ClientTlsPolicyServerValidationCa + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClientTlsPolicyServerValidationCa for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClientTlsPolicyServerValidationCaNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClientTlsPolicyServerValidationCa(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClientTlsPolicyServerValidationCaSlice(c *Client, des, nw []ClientTlsPolicyServerValidationCa) []ClientTlsPolicyServerValidationCa { @@ -1199,23 +1211,26 @@ func canonicalizeNewClientTlsPolicyServerValidationCaGrpcEndpointSet(c *Client, if des == nil { return nw } - var reorderedNew []ClientTlsPolicyServerValidationCaGrpcEndpoint + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClientTlsPolicyServerValidationCaGrpcEndpoint for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClientTlsPolicyServerValidationCaGrpcEndpointNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClientTlsPolicyServerValidationCaGrpcEndpoint(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClientTlsPolicyServerValidationCaGrpcEndpointSlice(c *Client, des, nw []ClientTlsPolicyServerValidationCaGrpcEndpoint) []ClientTlsPolicyServerValidationCaGrpcEndpoint { @@ -1314,23 +1329,26 @@ func canonicalizeNewClientTlsPolicyServerValidationCaCertificateProviderInstance if des == nil { return nw } - var reorderedNew []ClientTlsPolicyServerValidationCaCertificateProviderInstance + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ClientTlsPolicyServerValidationCaCertificateProviderInstance for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareClientTlsPolicyServerValidationCaCertificateProviderInstanceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewClientTlsPolicyServerValidationCaCertificateProviderInstance(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewClientTlsPolicyServerValidationCaCertificateProviderInstanceSlice(c *Client, des, nw []ClientTlsPolicyServerValidationCaCertificateProviderInstance) []ClientTlsPolicyServerValidationCaCertificateProviderInstance { diff --git a/services/google/networksecurity/beta/server_tls_policy_internal.go b/services/google/networksecurity/beta/server_tls_policy_internal.go index 2a3b1d2754..8fcdf409ed 100755 --- a/services/google/networksecurity/beta/server_tls_policy_internal.go +++ b/services/google/networksecurity/beta/server_tls_policy_internal.go @@ -735,23 +735,26 @@ func canonicalizeNewServerTlsPolicyServerCertificateSet(c *Client, des, nw []Ser if des == nil { return nw } - var reorderedNew []ServerTlsPolicyServerCertificate + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServerTlsPolicyServerCertificate for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServerTlsPolicyServerCertificateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServerTlsPolicyServerCertificate(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServerTlsPolicyServerCertificateSlice(c *Client, des, nw []ServerTlsPolicyServerCertificate) []ServerTlsPolicyServerCertificate { @@ -850,23 +853,26 @@ func canonicalizeNewServerTlsPolicyServerCertificateGrpcEndpointSet(c *Client, d if des == nil { return nw } - var reorderedNew []ServerTlsPolicyServerCertificateGrpcEndpoint + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServerTlsPolicyServerCertificateGrpcEndpoint for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServerTlsPolicyServerCertificateGrpcEndpointNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServerTlsPolicyServerCertificateGrpcEndpoint(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServerTlsPolicyServerCertificateGrpcEndpointSlice(c *Client, des, nw []ServerTlsPolicyServerCertificateGrpcEndpoint) []ServerTlsPolicyServerCertificateGrpcEndpoint { @@ -965,23 +971,26 @@ func canonicalizeNewServerTlsPolicyServerCertificateCertificateProviderInstanceS if des == nil { return nw } - var reorderedNew []ServerTlsPolicyServerCertificateCertificateProviderInstance + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServerTlsPolicyServerCertificateCertificateProviderInstance for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServerTlsPolicyServerCertificateCertificateProviderInstanceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServerTlsPolicyServerCertificateCertificateProviderInstance(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServerTlsPolicyServerCertificateCertificateProviderInstanceSlice(c *Client, des, nw []ServerTlsPolicyServerCertificateCertificateProviderInstance) []ServerTlsPolicyServerCertificateCertificateProviderInstance { @@ -1074,23 +1083,26 @@ func canonicalizeNewServerTlsPolicyMtlsPolicySet(c *Client, des, nw []ServerTlsP if des == nil { return nw } - var reorderedNew []ServerTlsPolicyMtlsPolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServerTlsPolicyMtlsPolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServerTlsPolicyMtlsPolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServerTlsPolicyMtlsPolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServerTlsPolicyMtlsPolicySlice(c *Client, des, nw []ServerTlsPolicyMtlsPolicy) []ServerTlsPolicyMtlsPolicy { @@ -1205,23 +1217,26 @@ func canonicalizeNewServerTlsPolicyMtlsPolicyClientValidationCaSet(c *Client, de if des == nil { return nw } - var reorderedNew []ServerTlsPolicyMtlsPolicyClientValidationCa + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServerTlsPolicyMtlsPolicyClientValidationCa for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServerTlsPolicyMtlsPolicyClientValidationCaNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServerTlsPolicyMtlsPolicyClientValidationCa(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServerTlsPolicyMtlsPolicyClientValidationCaSlice(c *Client, des, nw []ServerTlsPolicyMtlsPolicyClientValidationCa) []ServerTlsPolicyMtlsPolicyClientValidationCa { @@ -1320,23 +1335,26 @@ func canonicalizeNewServerTlsPolicyMtlsPolicyClientValidationCaGrpcEndpointSet(c if des == nil { return nw } - var reorderedNew []ServerTlsPolicyMtlsPolicyClientValidationCaGrpcEndpoint + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServerTlsPolicyMtlsPolicyClientValidationCaGrpcEndpoint for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServerTlsPolicyMtlsPolicyClientValidationCaGrpcEndpointNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServerTlsPolicyMtlsPolicyClientValidationCaGrpcEndpoint(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServerTlsPolicyMtlsPolicyClientValidationCaGrpcEndpointSlice(c *Client, des, nw []ServerTlsPolicyMtlsPolicyClientValidationCaGrpcEndpoint) []ServerTlsPolicyMtlsPolicyClientValidationCaGrpcEndpoint { @@ -1435,23 +1453,26 @@ func canonicalizeNewServerTlsPolicyMtlsPolicyClientValidationCaCertificateProvid if des == nil { return nw } - var reorderedNew []ServerTlsPolicyMtlsPolicyClientValidationCaCertificateProviderInstance + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServerTlsPolicyMtlsPolicyClientValidationCaCertificateProviderInstance for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServerTlsPolicyMtlsPolicyClientValidationCaCertificateProviderInstanceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServerTlsPolicyMtlsPolicyClientValidationCaCertificateProviderInstance(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServerTlsPolicyMtlsPolicyClientValidationCaCertificateProviderInstanceSlice(c *Client, des, nw []ServerTlsPolicyMtlsPolicyClientValidationCaCertificateProviderInstance) []ServerTlsPolicyMtlsPolicyClientValidationCaCertificateProviderInstance { diff --git a/services/google/networkservices/alpha/endpoint_policy_internal.go b/services/google/networkservices/alpha/endpoint_policy_internal.go index 92c99afe67..73f340b623 100755 --- a/services/google/networkservices/alpha/endpoint_policy_internal.go +++ b/services/google/networkservices/alpha/endpoint_policy_internal.go @@ -692,23 +692,26 @@ func canonicalizeNewEndpointPolicyEndpointMatcherSet(c *Client, des, nw []Endpoi if des == nil { return nw } - var reorderedNew []EndpointPolicyEndpointMatcher + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []EndpointPolicyEndpointMatcher for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareEndpointPolicyEndpointMatcherNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewEndpointPolicyEndpointMatcher(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewEndpointPolicyEndpointMatcherSlice(c *Client, des, nw []EndpointPolicyEndpointMatcher) []EndpointPolicyEndpointMatcher { @@ -807,23 +810,26 @@ func canonicalizeNewEndpointPolicyEndpointMatcherMetadataLabelMatcherSet(c *Clie if des == nil { return nw } - var reorderedNew []EndpointPolicyEndpointMatcherMetadataLabelMatcher + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []EndpointPolicyEndpointMatcherMetadataLabelMatcher for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareEndpointPolicyEndpointMatcherMetadataLabelMatcherNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewEndpointPolicyEndpointMatcherMetadataLabelMatcher(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewEndpointPolicyEndpointMatcherMetadataLabelMatcherSlice(c *Client, des, nw []EndpointPolicyEndpointMatcherMetadataLabelMatcher) []EndpointPolicyEndpointMatcherMetadataLabelMatcher { @@ -930,23 +936,26 @@ func canonicalizeNewEndpointPolicyEndpointMatcherMetadataLabelMatcherMetadataLab if des == nil { return nw } - var reorderedNew []EndpointPolicyEndpointMatcherMetadataLabelMatcherMetadataLabels + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []EndpointPolicyEndpointMatcherMetadataLabelMatcherMetadataLabels for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareEndpointPolicyEndpointMatcherMetadataLabelMatcherMetadataLabelsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewEndpointPolicyEndpointMatcherMetadataLabelMatcherMetadataLabels(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewEndpointPolicyEndpointMatcherMetadataLabelMatcherMetadataLabelsSlice(c *Client, des, nw []EndpointPolicyEndpointMatcherMetadataLabelMatcherMetadataLabels) []EndpointPolicyEndpointMatcherMetadataLabelMatcherMetadataLabels { @@ -1045,23 +1054,26 @@ func canonicalizeNewEndpointPolicyTrafficPortSelectorSet(c *Client, des, nw []En if des == nil { return nw } - var reorderedNew []EndpointPolicyTrafficPortSelector + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []EndpointPolicyTrafficPortSelector for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareEndpointPolicyTrafficPortSelectorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewEndpointPolicyTrafficPortSelector(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewEndpointPolicyTrafficPortSelectorSlice(c *Client, des, nw []EndpointPolicyTrafficPortSelector) []EndpointPolicyTrafficPortSelector { diff --git a/services/google/networkservices/alpha/grpc_route_internal.go b/services/google/networkservices/alpha/grpc_route_internal.go index 4f32baf927..7b6d060d0f 100755 --- a/services/google/networkservices/alpha/grpc_route_internal.go +++ b/services/google/networkservices/alpha/grpc_route_internal.go @@ -764,23 +764,26 @@ func canonicalizeNewGrpcRouteRulesSet(c *Client, des, nw []GrpcRouteRules) []Grp if des == nil { return nw } - var reorderedNew []GrpcRouteRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GrpcRouteRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGrpcRouteRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGrpcRouteRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGrpcRouteRulesSlice(c *Client, des, nw []GrpcRouteRules) []GrpcRouteRules { @@ -885,23 +888,26 @@ func canonicalizeNewGrpcRouteRulesMatchesSet(c *Client, des, nw []GrpcRouteRules if des == nil { return nw } - var reorderedNew []GrpcRouteRulesMatches + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GrpcRouteRulesMatches for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGrpcRouteRulesMatchesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGrpcRouteRulesMatches(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGrpcRouteRulesMatchesSlice(c *Client, des, nw []GrpcRouteRulesMatches) []GrpcRouteRulesMatches { @@ -1032,23 +1038,26 @@ func canonicalizeNewGrpcRouteRulesMatchesMethodSet(c *Client, des, nw []GrpcRout if des == nil { return nw } - var reorderedNew []GrpcRouteRulesMatchesMethod + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GrpcRouteRulesMatchesMethod for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGrpcRouteRulesMatchesMethodNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGrpcRouteRulesMatchesMethod(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGrpcRouteRulesMatchesMethodSlice(c *Client, des, nw []GrpcRouteRulesMatchesMethod) []GrpcRouteRulesMatchesMethod { @@ -1161,23 +1170,26 @@ func canonicalizeNewGrpcRouteRulesMatchesHeadersSet(c *Client, des, nw []GrpcRou if des == nil { return nw } - var reorderedNew []GrpcRouteRulesMatchesHeaders + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GrpcRouteRulesMatchesHeaders for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGrpcRouteRulesMatchesHeadersNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGrpcRouteRulesMatchesHeaders(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGrpcRouteRulesMatchesHeadersSlice(c *Client, des, nw []GrpcRouteRulesMatchesHeaders) []GrpcRouteRulesMatchesHeaders { @@ -1282,23 +1294,26 @@ func canonicalizeNewGrpcRouteRulesActionSet(c *Client, des, nw []GrpcRouteRulesA if des == nil { return nw } - var reorderedNew []GrpcRouteRulesAction + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GrpcRouteRulesAction for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGrpcRouteRulesActionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGrpcRouteRulesAction(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGrpcRouteRulesActionSlice(c *Client, des, nw []GrpcRouteRulesAction) []GrpcRouteRulesAction { @@ -1410,23 +1425,26 @@ func canonicalizeNewGrpcRouteRulesActionDestinationsSet(c *Client, des, nw []Grp if des == nil { return nw } - var reorderedNew []GrpcRouteRulesActionDestinations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GrpcRouteRulesActionDestinations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGrpcRouteRulesActionDestinationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGrpcRouteRulesActionDestinations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGrpcRouteRulesActionDestinationsSlice(c *Client, des, nw []GrpcRouteRulesActionDestinations) []GrpcRouteRulesActionDestinations { @@ -1541,23 +1559,26 @@ func canonicalizeNewGrpcRouteRulesActionFaultInjectionPolicySet(c *Client, des, if des == nil { return nw } - var reorderedNew []GrpcRouteRulesActionFaultInjectionPolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GrpcRouteRulesActionFaultInjectionPolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGrpcRouteRulesActionFaultInjectionPolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGrpcRouteRulesActionFaultInjectionPolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGrpcRouteRulesActionFaultInjectionPolicySlice(c *Client, des, nw []GrpcRouteRulesActionFaultInjectionPolicy) []GrpcRouteRulesActionFaultInjectionPolicy { @@ -1682,23 +1703,26 @@ func canonicalizeNewGrpcRouteRulesActionFaultInjectionPolicyDelaySet(c *Client, if des == nil { return nw } - var reorderedNew []GrpcRouteRulesActionFaultInjectionPolicyDelay + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GrpcRouteRulesActionFaultInjectionPolicyDelay for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGrpcRouteRulesActionFaultInjectionPolicyDelayNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGrpcRouteRulesActionFaultInjectionPolicyDelay(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGrpcRouteRulesActionFaultInjectionPolicyDelaySlice(c *Client, des, nw []GrpcRouteRulesActionFaultInjectionPolicyDelay) []GrpcRouteRulesActionFaultInjectionPolicyDelay { @@ -1820,23 +1844,26 @@ func canonicalizeNewGrpcRouteRulesActionFaultInjectionPolicyAbortSet(c *Client, if des == nil { return nw } - var reorderedNew []GrpcRouteRulesActionFaultInjectionPolicyAbort + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GrpcRouteRulesActionFaultInjectionPolicyAbort for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGrpcRouteRulesActionFaultInjectionPolicyAbortNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGrpcRouteRulesActionFaultInjectionPolicyAbort(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGrpcRouteRulesActionFaultInjectionPolicyAbortSlice(c *Client, des, nw []GrpcRouteRulesActionFaultInjectionPolicyAbort) []GrpcRouteRulesActionFaultInjectionPolicyAbort { @@ -1941,23 +1968,26 @@ func canonicalizeNewGrpcRouteRulesActionRetryPolicySet(c *Client, des, nw []Grpc if des == nil { return nw } - var reorderedNew []GrpcRouteRulesActionRetryPolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GrpcRouteRulesActionRetryPolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGrpcRouteRulesActionRetryPolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGrpcRouteRulesActionRetryPolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGrpcRouteRulesActionRetryPolicySlice(c *Client, des, nw []GrpcRouteRulesActionRetryPolicy) []GrpcRouteRulesActionRetryPolicy { diff --git a/services/google/networkservices/alpha/http_route_internal.go b/services/google/networkservices/alpha/http_route_internal.go index 824c4a6332..ffa4144b1a 100755 --- a/services/google/networkservices/alpha/http_route_internal.go +++ b/services/google/networkservices/alpha/http_route_internal.go @@ -787,23 +787,26 @@ func canonicalizeNewHttpRouteRulesSet(c *Client, des, nw []HttpRouteRules) []Htt if des == nil { return nw } - var reorderedNew []HttpRouteRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesSlice(c *Client, des, nw []HttpRouteRules) []HttpRouteRules { @@ -960,23 +963,26 @@ func canonicalizeNewHttpRouteRulesMatchesSet(c *Client, des, nw []HttpRouteRules if des == nil { return nw } - var reorderedNew []HttpRouteRulesMatches + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesMatches for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesMatchesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesMatches(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesMatchesSlice(c *Client, des, nw []HttpRouteRulesMatches) []HttpRouteRulesMatches { @@ -1185,23 +1191,26 @@ func canonicalizeNewHttpRouteRulesMatchesHeadersSet(c *Client, des, nw []HttpRou if des == nil { return nw } - var reorderedNew []HttpRouteRulesMatchesHeaders + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesMatchesHeaders for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesMatchesHeadersNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesMatchesHeaders(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesMatchesHeadersSlice(c *Client, des, nw []HttpRouteRulesMatchesHeaders) []HttpRouteRulesMatchesHeaders { @@ -1303,23 +1312,26 @@ func canonicalizeNewHttpRouteRulesMatchesHeadersRangeMatchSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []HttpRouteRulesMatchesHeadersRangeMatch + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesMatchesHeadersRangeMatch for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesMatchesHeadersRangeMatchNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesMatchesHeadersRangeMatch(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesMatchesHeadersRangeMatchSlice(c *Client, des, nw []HttpRouteRulesMatchesHeadersRangeMatch) []HttpRouteRulesMatchesHeadersRangeMatch { @@ -1472,23 +1484,26 @@ func canonicalizeNewHttpRouteRulesMatchesQueryParametersSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []HttpRouteRulesMatchesQueryParameters + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesMatchesQueryParameters for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesMatchesQueryParametersNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesMatchesQueryParameters(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesMatchesQueryParametersSlice(c *Client, des, nw []HttpRouteRulesMatchesQueryParameters) []HttpRouteRulesMatchesQueryParameters { @@ -1605,23 +1620,26 @@ func canonicalizeNewHttpRouteRulesActionSet(c *Client, des, nw []HttpRouteRulesA if des == nil { return nw } - var reorderedNew []HttpRouteRulesAction + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesAction for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesAction(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionSlice(c *Client, des, nw []HttpRouteRulesAction) []HttpRouteRulesAction { @@ -1723,23 +1741,26 @@ func canonicalizeNewHttpRouteRulesActionDestinationsSet(c *Client, des, nw []Htt if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionDestinations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionDestinations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionDestinationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionDestinations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionDestinationsSlice(c *Client, des, nw []HttpRouteRulesActionDestinations) []HttpRouteRulesActionDestinations { @@ -1882,23 +1903,26 @@ func canonicalizeNewHttpRouteRulesActionRedirectSet(c *Client, des, nw []HttpRou if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionRedirect + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionRedirect for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionRedirectNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionRedirect(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionRedirectSlice(c *Client, des, nw []HttpRouteRulesActionRedirect) []HttpRouteRulesActionRedirect { @@ -1993,23 +2017,26 @@ func canonicalizeNewHttpRouteRulesActionFaultInjectionPolicySet(c *Client, des, if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionFaultInjectionPolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionFaultInjectionPolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionFaultInjectionPolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionFaultInjectionPolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionFaultInjectionPolicySlice(c *Client, des, nw []HttpRouteRulesActionFaultInjectionPolicy) []HttpRouteRulesActionFaultInjectionPolicy { @@ -2114,23 +2141,26 @@ func canonicalizeNewHttpRouteRulesActionFaultInjectionPolicyDelaySet(c *Client, if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionFaultInjectionPolicyDelay + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionFaultInjectionPolicyDelay for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionFaultInjectionPolicyDelayNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionFaultInjectionPolicyDelay(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionFaultInjectionPolicyDelaySlice(c *Client, des, nw []HttpRouteRulesActionFaultInjectionPolicyDelay) []HttpRouteRulesActionFaultInjectionPolicyDelay { @@ -2232,23 +2262,26 @@ func canonicalizeNewHttpRouteRulesActionFaultInjectionPolicyAbortSet(c *Client, if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionFaultInjectionPolicyAbort + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionFaultInjectionPolicyAbort for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionFaultInjectionPolicyAbortNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionFaultInjectionPolicyAbort(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionFaultInjectionPolicyAbortSlice(c *Client, des, nw []HttpRouteRulesActionFaultInjectionPolicyAbort) []HttpRouteRulesActionFaultInjectionPolicyAbort { @@ -2359,23 +2392,26 @@ func canonicalizeNewHttpRouteRulesActionRequestHeaderModifierSet(c *Client, des, if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionRequestHeaderModifier + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionRequestHeaderModifier for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionRequestHeaderModifierNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionRequestHeaderModifier(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionRequestHeaderModifierSlice(c *Client, des, nw []HttpRouteRulesActionRequestHeaderModifier) []HttpRouteRulesActionRequestHeaderModifier { @@ -2486,23 +2522,26 @@ func canonicalizeNewHttpRouteRulesActionResponseHeaderModifierSet(c *Client, des if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionResponseHeaderModifier + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionResponseHeaderModifier for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionResponseHeaderModifierNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionResponseHeaderModifier(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionResponseHeaderModifierSlice(c *Client, des, nw []HttpRouteRulesActionResponseHeaderModifier) []HttpRouteRulesActionResponseHeaderModifier { @@ -2609,23 +2648,26 @@ func canonicalizeNewHttpRouteRulesActionUrlRewriteSet(c *Client, des, nw []HttpR if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionUrlRewrite + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionUrlRewrite for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionUrlRewriteNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionUrlRewrite(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionUrlRewriteSlice(c *Client, des, nw []HttpRouteRulesActionUrlRewrite) []HttpRouteRulesActionUrlRewrite { @@ -2738,23 +2780,26 @@ func canonicalizeNewHttpRouteRulesActionRetryPolicySet(c *Client, des, nw []Http if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionRetryPolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionRetryPolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionRetryPolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionRetryPolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionRetryPolicySlice(c *Client, des, nw []HttpRouteRulesActionRetryPolicy) []HttpRouteRulesActionRetryPolicy { @@ -2847,23 +2892,26 @@ func canonicalizeNewHttpRouteRulesActionRequestMirrorPolicySet(c *Client, des, n if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionRequestMirrorPolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionRequestMirrorPolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionRequestMirrorPolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionRequestMirrorPolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionRequestMirrorPolicySlice(c *Client, des, nw []HttpRouteRulesActionRequestMirrorPolicy) []HttpRouteRulesActionRequestMirrorPolicy { @@ -2965,23 +3013,26 @@ func canonicalizeNewHttpRouteRulesActionRequestMirrorPolicyDestinationSet(c *Cli if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionRequestMirrorPolicyDestination + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionRequestMirrorPolicyDestination for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionRequestMirrorPolicyDestinationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionRequestMirrorPolicyDestination(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionRequestMirrorPolicyDestinationSlice(c *Client, des, nw []HttpRouteRulesActionRequestMirrorPolicyDestination) []HttpRouteRulesActionRequestMirrorPolicyDestination { @@ -3136,23 +3187,26 @@ func canonicalizeNewHttpRouteRulesActionCorsPolicySet(c *Client, des, nw []HttpR if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionCorsPolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionCorsPolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionCorsPolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionCorsPolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionCorsPolicySlice(c *Client, des, nw []HttpRouteRulesActionCorsPolicy) []HttpRouteRulesActionCorsPolicy { diff --git a/services/google/networkservices/alpha/tcp_route_internal.go b/services/google/networkservices/alpha/tcp_route_internal.go index 218d7b509b..923094a4cf 100755 --- a/services/google/networkservices/alpha/tcp_route_internal.go +++ b/services/google/networkservices/alpha/tcp_route_internal.go @@ -669,23 +669,26 @@ func canonicalizeNewTcpRouteRulesSet(c *Client, des, nw []TcpRouteRules) []TcpRo if des == nil { return nw } - var reorderedNew []TcpRouteRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TcpRouteRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTcpRouteRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTcpRouteRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTcpRouteRulesSlice(c *Client, des, nw []TcpRouteRules) []TcpRouteRules { @@ -792,23 +795,26 @@ func canonicalizeNewTcpRouteRulesMatchesSet(c *Client, des, nw []TcpRouteRulesMa if des == nil { return nw } - var reorderedNew []TcpRouteRulesMatches + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TcpRouteRulesMatches for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTcpRouteRulesMatchesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTcpRouteRulesMatches(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTcpRouteRulesMatchesSlice(c *Client, des, nw []TcpRouteRulesMatches) []TcpRouteRulesMatches { @@ -909,23 +915,26 @@ func canonicalizeNewTcpRouteRulesActionSet(c *Client, des, nw []TcpRouteRulesAct if des == nil { return nw } - var reorderedNew []TcpRouteRulesAction + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TcpRouteRulesAction for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTcpRouteRulesActionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTcpRouteRulesAction(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTcpRouteRulesActionSlice(c *Client, des, nw []TcpRouteRulesAction) []TcpRouteRulesAction { @@ -1027,23 +1036,26 @@ func canonicalizeNewTcpRouteRulesActionDestinationsSet(c *Client, des, nw []TcpR if des == nil { return nw } - var reorderedNew []TcpRouteRulesActionDestinations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TcpRouteRulesActionDestinations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTcpRouteRulesActionDestinationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTcpRouteRulesActionDestinations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTcpRouteRulesActionDestinationsSlice(c *Client, des, nw []TcpRouteRulesActionDestinations) []TcpRouteRulesActionDestinations { diff --git a/services/google/networkservices/alpha/tls_route_internal.go b/services/google/networkservices/alpha/tls_route_internal.go index fb7525fadf..422f10fb02 100755 --- a/services/google/networkservices/alpha/tls_route_internal.go +++ b/services/google/networkservices/alpha/tls_route_internal.go @@ -655,23 +655,26 @@ func canonicalizeNewTlsRouteRulesSet(c *Client, des, nw []TlsRouteRules) []TlsRo if des == nil { return nw } - var reorderedNew []TlsRouteRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TlsRouteRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTlsRouteRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTlsRouteRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTlsRouteRulesSlice(c *Client, des, nw []TlsRouteRules) []TlsRouteRules { @@ -778,23 +781,26 @@ func canonicalizeNewTlsRouteRulesMatchesSet(c *Client, des, nw []TlsRouteRulesMa if des == nil { return nw } - var reorderedNew []TlsRouteRulesMatches + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TlsRouteRulesMatches for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTlsRouteRulesMatchesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTlsRouteRulesMatches(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTlsRouteRulesMatchesSlice(c *Client, des, nw []TlsRouteRulesMatches) []TlsRouteRulesMatches { @@ -887,23 +893,26 @@ func canonicalizeNewTlsRouteRulesActionSet(c *Client, des, nw []TlsRouteRulesAct if des == nil { return nw } - var reorderedNew []TlsRouteRulesAction + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TlsRouteRulesAction for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTlsRouteRulesActionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTlsRouteRulesAction(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTlsRouteRulesActionSlice(c *Client, des, nw []TlsRouteRulesAction) []TlsRouteRulesAction { @@ -1005,23 +1014,26 @@ func canonicalizeNewTlsRouteRulesActionDestinationsSet(c *Client, des, nw []TlsR if des == nil { return nw } - var reorderedNew []TlsRouteRulesActionDestinations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TlsRouteRulesActionDestinations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTlsRouteRulesActionDestinationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTlsRouteRulesActionDestinations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTlsRouteRulesActionDestinationsSlice(c *Client, des, nw []TlsRouteRulesActionDestinations) []TlsRouteRulesActionDestinations { diff --git a/services/google/networkservices/beta/endpoint_policy_internal.go b/services/google/networkservices/beta/endpoint_policy_internal.go index 3cfab51236..baed97bc94 100755 --- a/services/google/networkservices/beta/endpoint_policy_internal.go +++ b/services/google/networkservices/beta/endpoint_policy_internal.go @@ -692,23 +692,26 @@ func canonicalizeNewEndpointPolicyEndpointMatcherSet(c *Client, des, nw []Endpoi if des == nil { return nw } - var reorderedNew []EndpointPolicyEndpointMatcher + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []EndpointPolicyEndpointMatcher for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareEndpointPolicyEndpointMatcherNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewEndpointPolicyEndpointMatcher(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewEndpointPolicyEndpointMatcherSlice(c *Client, des, nw []EndpointPolicyEndpointMatcher) []EndpointPolicyEndpointMatcher { @@ -807,23 +810,26 @@ func canonicalizeNewEndpointPolicyEndpointMatcherMetadataLabelMatcherSet(c *Clie if des == nil { return nw } - var reorderedNew []EndpointPolicyEndpointMatcherMetadataLabelMatcher + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []EndpointPolicyEndpointMatcherMetadataLabelMatcher for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareEndpointPolicyEndpointMatcherMetadataLabelMatcherNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewEndpointPolicyEndpointMatcherMetadataLabelMatcher(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewEndpointPolicyEndpointMatcherMetadataLabelMatcherSlice(c *Client, des, nw []EndpointPolicyEndpointMatcherMetadataLabelMatcher) []EndpointPolicyEndpointMatcherMetadataLabelMatcher { @@ -930,23 +936,26 @@ func canonicalizeNewEndpointPolicyEndpointMatcherMetadataLabelMatcherMetadataLab if des == nil { return nw } - var reorderedNew []EndpointPolicyEndpointMatcherMetadataLabelMatcherMetadataLabels + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []EndpointPolicyEndpointMatcherMetadataLabelMatcherMetadataLabels for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareEndpointPolicyEndpointMatcherMetadataLabelMatcherMetadataLabelsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewEndpointPolicyEndpointMatcherMetadataLabelMatcherMetadataLabels(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewEndpointPolicyEndpointMatcherMetadataLabelMatcherMetadataLabelsSlice(c *Client, des, nw []EndpointPolicyEndpointMatcherMetadataLabelMatcherMetadataLabels) []EndpointPolicyEndpointMatcherMetadataLabelMatcherMetadataLabels { @@ -1045,23 +1054,26 @@ func canonicalizeNewEndpointPolicyTrafficPortSelectorSet(c *Client, des, nw []En if des == nil { return nw } - var reorderedNew []EndpointPolicyTrafficPortSelector + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []EndpointPolicyTrafficPortSelector for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareEndpointPolicyTrafficPortSelectorNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewEndpointPolicyTrafficPortSelector(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewEndpointPolicyTrafficPortSelectorSlice(c *Client, des, nw []EndpointPolicyTrafficPortSelector) []EndpointPolicyTrafficPortSelector { diff --git a/services/google/networkservices/beta/grpc_route_internal.go b/services/google/networkservices/beta/grpc_route_internal.go index 034474de94..fe89a26105 100755 --- a/services/google/networkservices/beta/grpc_route_internal.go +++ b/services/google/networkservices/beta/grpc_route_internal.go @@ -764,23 +764,26 @@ func canonicalizeNewGrpcRouteRulesSet(c *Client, des, nw []GrpcRouteRules) []Grp if des == nil { return nw } - var reorderedNew []GrpcRouteRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GrpcRouteRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGrpcRouteRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGrpcRouteRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGrpcRouteRulesSlice(c *Client, des, nw []GrpcRouteRules) []GrpcRouteRules { @@ -885,23 +888,26 @@ func canonicalizeNewGrpcRouteRulesMatchesSet(c *Client, des, nw []GrpcRouteRules if des == nil { return nw } - var reorderedNew []GrpcRouteRulesMatches + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GrpcRouteRulesMatches for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGrpcRouteRulesMatchesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGrpcRouteRulesMatches(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGrpcRouteRulesMatchesSlice(c *Client, des, nw []GrpcRouteRulesMatches) []GrpcRouteRulesMatches { @@ -1032,23 +1038,26 @@ func canonicalizeNewGrpcRouteRulesMatchesMethodSet(c *Client, des, nw []GrpcRout if des == nil { return nw } - var reorderedNew []GrpcRouteRulesMatchesMethod + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GrpcRouteRulesMatchesMethod for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGrpcRouteRulesMatchesMethodNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGrpcRouteRulesMatchesMethod(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGrpcRouteRulesMatchesMethodSlice(c *Client, des, nw []GrpcRouteRulesMatchesMethod) []GrpcRouteRulesMatchesMethod { @@ -1161,23 +1170,26 @@ func canonicalizeNewGrpcRouteRulesMatchesHeadersSet(c *Client, des, nw []GrpcRou if des == nil { return nw } - var reorderedNew []GrpcRouteRulesMatchesHeaders + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GrpcRouteRulesMatchesHeaders for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGrpcRouteRulesMatchesHeadersNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGrpcRouteRulesMatchesHeaders(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGrpcRouteRulesMatchesHeadersSlice(c *Client, des, nw []GrpcRouteRulesMatchesHeaders) []GrpcRouteRulesMatchesHeaders { @@ -1282,23 +1294,26 @@ func canonicalizeNewGrpcRouteRulesActionSet(c *Client, des, nw []GrpcRouteRulesA if des == nil { return nw } - var reorderedNew []GrpcRouteRulesAction + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GrpcRouteRulesAction for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGrpcRouteRulesActionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGrpcRouteRulesAction(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGrpcRouteRulesActionSlice(c *Client, des, nw []GrpcRouteRulesAction) []GrpcRouteRulesAction { @@ -1410,23 +1425,26 @@ func canonicalizeNewGrpcRouteRulesActionDestinationsSet(c *Client, des, nw []Grp if des == nil { return nw } - var reorderedNew []GrpcRouteRulesActionDestinations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GrpcRouteRulesActionDestinations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGrpcRouteRulesActionDestinationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGrpcRouteRulesActionDestinations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGrpcRouteRulesActionDestinationsSlice(c *Client, des, nw []GrpcRouteRulesActionDestinations) []GrpcRouteRulesActionDestinations { @@ -1541,23 +1559,26 @@ func canonicalizeNewGrpcRouteRulesActionFaultInjectionPolicySet(c *Client, des, if des == nil { return nw } - var reorderedNew []GrpcRouteRulesActionFaultInjectionPolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GrpcRouteRulesActionFaultInjectionPolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGrpcRouteRulesActionFaultInjectionPolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGrpcRouteRulesActionFaultInjectionPolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGrpcRouteRulesActionFaultInjectionPolicySlice(c *Client, des, nw []GrpcRouteRulesActionFaultInjectionPolicy) []GrpcRouteRulesActionFaultInjectionPolicy { @@ -1682,23 +1703,26 @@ func canonicalizeNewGrpcRouteRulesActionFaultInjectionPolicyDelaySet(c *Client, if des == nil { return nw } - var reorderedNew []GrpcRouteRulesActionFaultInjectionPolicyDelay + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GrpcRouteRulesActionFaultInjectionPolicyDelay for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGrpcRouteRulesActionFaultInjectionPolicyDelayNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGrpcRouteRulesActionFaultInjectionPolicyDelay(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGrpcRouteRulesActionFaultInjectionPolicyDelaySlice(c *Client, des, nw []GrpcRouteRulesActionFaultInjectionPolicyDelay) []GrpcRouteRulesActionFaultInjectionPolicyDelay { @@ -1820,23 +1844,26 @@ func canonicalizeNewGrpcRouteRulesActionFaultInjectionPolicyAbortSet(c *Client, if des == nil { return nw } - var reorderedNew []GrpcRouteRulesActionFaultInjectionPolicyAbort + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GrpcRouteRulesActionFaultInjectionPolicyAbort for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGrpcRouteRulesActionFaultInjectionPolicyAbortNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGrpcRouteRulesActionFaultInjectionPolicyAbort(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGrpcRouteRulesActionFaultInjectionPolicyAbortSlice(c *Client, des, nw []GrpcRouteRulesActionFaultInjectionPolicyAbort) []GrpcRouteRulesActionFaultInjectionPolicyAbort { @@ -1941,23 +1968,26 @@ func canonicalizeNewGrpcRouteRulesActionRetryPolicySet(c *Client, des, nw []Grpc if des == nil { return nw } - var reorderedNew []GrpcRouteRulesActionRetryPolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GrpcRouteRulesActionRetryPolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGrpcRouteRulesActionRetryPolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGrpcRouteRulesActionRetryPolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGrpcRouteRulesActionRetryPolicySlice(c *Client, des, nw []GrpcRouteRulesActionRetryPolicy) []GrpcRouteRulesActionRetryPolicy { diff --git a/services/google/networkservices/beta/http_route_internal.go b/services/google/networkservices/beta/http_route_internal.go index a30bdb8bfa..69d05c9567 100755 --- a/services/google/networkservices/beta/http_route_internal.go +++ b/services/google/networkservices/beta/http_route_internal.go @@ -787,23 +787,26 @@ func canonicalizeNewHttpRouteRulesSet(c *Client, des, nw []HttpRouteRules) []Htt if des == nil { return nw } - var reorderedNew []HttpRouteRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesSlice(c *Client, des, nw []HttpRouteRules) []HttpRouteRules { @@ -960,23 +963,26 @@ func canonicalizeNewHttpRouteRulesMatchesSet(c *Client, des, nw []HttpRouteRules if des == nil { return nw } - var reorderedNew []HttpRouteRulesMatches + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesMatches for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesMatchesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesMatches(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesMatchesSlice(c *Client, des, nw []HttpRouteRulesMatches) []HttpRouteRulesMatches { @@ -1185,23 +1191,26 @@ func canonicalizeNewHttpRouteRulesMatchesHeadersSet(c *Client, des, nw []HttpRou if des == nil { return nw } - var reorderedNew []HttpRouteRulesMatchesHeaders + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesMatchesHeaders for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesMatchesHeadersNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesMatchesHeaders(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesMatchesHeadersSlice(c *Client, des, nw []HttpRouteRulesMatchesHeaders) []HttpRouteRulesMatchesHeaders { @@ -1303,23 +1312,26 @@ func canonicalizeNewHttpRouteRulesMatchesHeadersRangeMatchSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []HttpRouteRulesMatchesHeadersRangeMatch + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesMatchesHeadersRangeMatch for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesMatchesHeadersRangeMatchNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesMatchesHeadersRangeMatch(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesMatchesHeadersRangeMatchSlice(c *Client, des, nw []HttpRouteRulesMatchesHeadersRangeMatch) []HttpRouteRulesMatchesHeadersRangeMatch { @@ -1472,23 +1484,26 @@ func canonicalizeNewHttpRouteRulesMatchesQueryParametersSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []HttpRouteRulesMatchesQueryParameters + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesMatchesQueryParameters for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesMatchesQueryParametersNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesMatchesQueryParameters(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesMatchesQueryParametersSlice(c *Client, des, nw []HttpRouteRulesMatchesQueryParameters) []HttpRouteRulesMatchesQueryParameters { @@ -1605,23 +1620,26 @@ func canonicalizeNewHttpRouteRulesActionSet(c *Client, des, nw []HttpRouteRulesA if des == nil { return nw } - var reorderedNew []HttpRouteRulesAction + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesAction for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesAction(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionSlice(c *Client, des, nw []HttpRouteRulesAction) []HttpRouteRulesAction { @@ -1723,23 +1741,26 @@ func canonicalizeNewHttpRouteRulesActionDestinationsSet(c *Client, des, nw []Htt if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionDestinations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionDestinations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionDestinationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionDestinations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionDestinationsSlice(c *Client, des, nw []HttpRouteRulesActionDestinations) []HttpRouteRulesActionDestinations { @@ -1882,23 +1903,26 @@ func canonicalizeNewHttpRouteRulesActionRedirectSet(c *Client, des, nw []HttpRou if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionRedirect + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionRedirect for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionRedirectNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionRedirect(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionRedirectSlice(c *Client, des, nw []HttpRouteRulesActionRedirect) []HttpRouteRulesActionRedirect { @@ -1993,23 +2017,26 @@ func canonicalizeNewHttpRouteRulesActionFaultInjectionPolicySet(c *Client, des, if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionFaultInjectionPolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionFaultInjectionPolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionFaultInjectionPolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionFaultInjectionPolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionFaultInjectionPolicySlice(c *Client, des, nw []HttpRouteRulesActionFaultInjectionPolicy) []HttpRouteRulesActionFaultInjectionPolicy { @@ -2114,23 +2141,26 @@ func canonicalizeNewHttpRouteRulesActionFaultInjectionPolicyDelaySet(c *Client, if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionFaultInjectionPolicyDelay + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionFaultInjectionPolicyDelay for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionFaultInjectionPolicyDelayNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionFaultInjectionPolicyDelay(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionFaultInjectionPolicyDelaySlice(c *Client, des, nw []HttpRouteRulesActionFaultInjectionPolicyDelay) []HttpRouteRulesActionFaultInjectionPolicyDelay { @@ -2232,23 +2262,26 @@ func canonicalizeNewHttpRouteRulesActionFaultInjectionPolicyAbortSet(c *Client, if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionFaultInjectionPolicyAbort + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionFaultInjectionPolicyAbort for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionFaultInjectionPolicyAbortNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionFaultInjectionPolicyAbort(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionFaultInjectionPolicyAbortSlice(c *Client, des, nw []HttpRouteRulesActionFaultInjectionPolicyAbort) []HttpRouteRulesActionFaultInjectionPolicyAbort { @@ -2359,23 +2392,26 @@ func canonicalizeNewHttpRouteRulesActionRequestHeaderModifierSet(c *Client, des, if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionRequestHeaderModifier + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionRequestHeaderModifier for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionRequestHeaderModifierNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionRequestHeaderModifier(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionRequestHeaderModifierSlice(c *Client, des, nw []HttpRouteRulesActionRequestHeaderModifier) []HttpRouteRulesActionRequestHeaderModifier { @@ -2486,23 +2522,26 @@ func canonicalizeNewHttpRouteRulesActionResponseHeaderModifierSet(c *Client, des if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionResponseHeaderModifier + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionResponseHeaderModifier for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionResponseHeaderModifierNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionResponseHeaderModifier(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionResponseHeaderModifierSlice(c *Client, des, nw []HttpRouteRulesActionResponseHeaderModifier) []HttpRouteRulesActionResponseHeaderModifier { @@ -2609,23 +2648,26 @@ func canonicalizeNewHttpRouteRulesActionUrlRewriteSet(c *Client, des, nw []HttpR if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionUrlRewrite + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionUrlRewrite for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionUrlRewriteNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionUrlRewrite(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionUrlRewriteSlice(c *Client, des, nw []HttpRouteRulesActionUrlRewrite) []HttpRouteRulesActionUrlRewrite { @@ -2738,23 +2780,26 @@ func canonicalizeNewHttpRouteRulesActionRetryPolicySet(c *Client, des, nw []Http if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionRetryPolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionRetryPolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionRetryPolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionRetryPolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionRetryPolicySlice(c *Client, des, nw []HttpRouteRulesActionRetryPolicy) []HttpRouteRulesActionRetryPolicy { @@ -2847,23 +2892,26 @@ func canonicalizeNewHttpRouteRulesActionRequestMirrorPolicySet(c *Client, des, n if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionRequestMirrorPolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionRequestMirrorPolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionRequestMirrorPolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionRequestMirrorPolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionRequestMirrorPolicySlice(c *Client, des, nw []HttpRouteRulesActionRequestMirrorPolicy) []HttpRouteRulesActionRequestMirrorPolicy { @@ -2965,23 +3013,26 @@ func canonicalizeNewHttpRouteRulesActionRequestMirrorPolicyDestinationSet(c *Cli if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionRequestMirrorPolicyDestination + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionRequestMirrorPolicyDestination for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionRequestMirrorPolicyDestinationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionRequestMirrorPolicyDestination(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionRequestMirrorPolicyDestinationSlice(c *Client, des, nw []HttpRouteRulesActionRequestMirrorPolicyDestination) []HttpRouteRulesActionRequestMirrorPolicyDestination { @@ -3136,23 +3187,26 @@ func canonicalizeNewHttpRouteRulesActionCorsPolicySet(c *Client, des, nw []HttpR if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionCorsPolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionCorsPolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionCorsPolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionCorsPolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionCorsPolicySlice(c *Client, des, nw []HttpRouteRulesActionCorsPolicy) []HttpRouteRulesActionCorsPolicy { diff --git a/services/google/networkservices/beta/tcp_route_internal.go b/services/google/networkservices/beta/tcp_route_internal.go index 79da8279cd..f9b6895baf 100755 --- a/services/google/networkservices/beta/tcp_route_internal.go +++ b/services/google/networkservices/beta/tcp_route_internal.go @@ -669,23 +669,26 @@ func canonicalizeNewTcpRouteRulesSet(c *Client, des, nw []TcpRouteRules) []TcpRo if des == nil { return nw } - var reorderedNew []TcpRouteRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TcpRouteRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTcpRouteRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTcpRouteRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTcpRouteRulesSlice(c *Client, des, nw []TcpRouteRules) []TcpRouteRules { @@ -792,23 +795,26 @@ func canonicalizeNewTcpRouteRulesMatchesSet(c *Client, des, nw []TcpRouteRulesMa if des == nil { return nw } - var reorderedNew []TcpRouteRulesMatches + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TcpRouteRulesMatches for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTcpRouteRulesMatchesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTcpRouteRulesMatches(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTcpRouteRulesMatchesSlice(c *Client, des, nw []TcpRouteRulesMatches) []TcpRouteRulesMatches { @@ -909,23 +915,26 @@ func canonicalizeNewTcpRouteRulesActionSet(c *Client, des, nw []TcpRouteRulesAct if des == nil { return nw } - var reorderedNew []TcpRouteRulesAction + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TcpRouteRulesAction for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTcpRouteRulesActionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTcpRouteRulesAction(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTcpRouteRulesActionSlice(c *Client, des, nw []TcpRouteRulesAction) []TcpRouteRulesAction { @@ -1027,23 +1036,26 @@ func canonicalizeNewTcpRouteRulesActionDestinationsSet(c *Client, des, nw []TcpR if des == nil { return nw } - var reorderedNew []TcpRouteRulesActionDestinations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TcpRouteRulesActionDestinations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTcpRouteRulesActionDestinationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTcpRouteRulesActionDestinations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTcpRouteRulesActionDestinationsSlice(c *Client, des, nw []TcpRouteRulesActionDestinations) []TcpRouteRulesActionDestinations { diff --git a/services/google/networkservices/beta/tls_route_internal.go b/services/google/networkservices/beta/tls_route_internal.go index 69e1d17e82..9150444f63 100755 --- a/services/google/networkservices/beta/tls_route_internal.go +++ b/services/google/networkservices/beta/tls_route_internal.go @@ -655,23 +655,26 @@ func canonicalizeNewTlsRouteRulesSet(c *Client, des, nw []TlsRouteRules) []TlsRo if des == nil { return nw } - var reorderedNew []TlsRouteRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TlsRouteRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTlsRouteRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTlsRouteRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTlsRouteRulesSlice(c *Client, des, nw []TlsRouteRules) []TlsRouteRules { @@ -778,23 +781,26 @@ func canonicalizeNewTlsRouteRulesMatchesSet(c *Client, des, nw []TlsRouteRulesMa if des == nil { return nw } - var reorderedNew []TlsRouteRulesMatches + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TlsRouteRulesMatches for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTlsRouteRulesMatchesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTlsRouteRulesMatches(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTlsRouteRulesMatchesSlice(c *Client, des, nw []TlsRouteRulesMatches) []TlsRouteRulesMatches { @@ -887,23 +893,26 @@ func canonicalizeNewTlsRouteRulesActionSet(c *Client, des, nw []TlsRouteRulesAct if des == nil { return nw } - var reorderedNew []TlsRouteRulesAction + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TlsRouteRulesAction for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTlsRouteRulesActionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTlsRouteRulesAction(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTlsRouteRulesActionSlice(c *Client, des, nw []TlsRouteRulesAction) []TlsRouteRulesAction { @@ -1005,23 +1014,26 @@ func canonicalizeNewTlsRouteRulesActionDestinationsSet(c *Client, des, nw []TlsR if des == nil { return nw } - var reorderedNew []TlsRouteRulesActionDestinations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TlsRouteRulesActionDestinations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTlsRouteRulesActionDestinationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTlsRouteRulesActionDestinations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTlsRouteRulesActionDestinationsSlice(c *Client, des, nw []TlsRouteRulesActionDestinations) []TlsRouteRulesActionDestinations { diff --git a/services/google/networkservices/grpc_route_internal.go b/services/google/networkservices/grpc_route_internal.go index 3425dbca94..71f15aadb7 100755 --- a/services/google/networkservices/grpc_route_internal.go +++ b/services/google/networkservices/grpc_route_internal.go @@ -764,23 +764,26 @@ func canonicalizeNewGrpcRouteRulesSet(c *Client, des, nw []GrpcRouteRules) []Grp if des == nil { return nw } - var reorderedNew []GrpcRouteRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GrpcRouteRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGrpcRouteRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGrpcRouteRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGrpcRouteRulesSlice(c *Client, des, nw []GrpcRouteRules) []GrpcRouteRules { @@ -885,23 +888,26 @@ func canonicalizeNewGrpcRouteRulesMatchesSet(c *Client, des, nw []GrpcRouteRules if des == nil { return nw } - var reorderedNew []GrpcRouteRulesMatches + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GrpcRouteRulesMatches for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGrpcRouteRulesMatchesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGrpcRouteRulesMatches(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGrpcRouteRulesMatchesSlice(c *Client, des, nw []GrpcRouteRulesMatches) []GrpcRouteRulesMatches { @@ -1032,23 +1038,26 @@ func canonicalizeNewGrpcRouteRulesMatchesMethodSet(c *Client, des, nw []GrpcRout if des == nil { return nw } - var reorderedNew []GrpcRouteRulesMatchesMethod + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GrpcRouteRulesMatchesMethod for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGrpcRouteRulesMatchesMethodNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGrpcRouteRulesMatchesMethod(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGrpcRouteRulesMatchesMethodSlice(c *Client, des, nw []GrpcRouteRulesMatchesMethod) []GrpcRouteRulesMatchesMethod { @@ -1161,23 +1170,26 @@ func canonicalizeNewGrpcRouteRulesMatchesHeadersSet(c *Client, des, nw []GrpcRou if des == nil { return nw } - var reorderedNew []GrpcRouteRulesMatchesHeaders + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GrpcRouteRulesMatchesHeaders for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGrpcRouteRulesMatchesHeadersNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGrpcRouteRulesMatchesHeaders(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGrpcRouteRulesMatchesHeadersSlice(c *Client, des, nw []GrpcRouteRulesMatchesHeaders) []GrpcRouteRulesMatchesHeaders { @@ -1282,23 +1294,26 @@ func canonicalizeNewGrpcRouteRulesActionSet(c *Client, des, nw []GrpcRouteRulesA if des == nil { return nw } - var reorderedNew []GrpcRouteRulesAction + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GrpcRouteRulesAction for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGrpcRouteRulesActionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGrpcRouteRulesAction(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGrpcRouteRulesActionSlice(c *Client, des, nw []GrpcRouteRulesAction) []GrpcRouteRulesAction { @@ -1410,23 +1425,26 @@ func canonicalizeNewGrpcRouteRulesActionDestinationsSet(c *Client, des, nw []Grp if des == nil { return nw } - var reorderedNew []GrpcRouteRulesActionDestinations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GrpcRouteRulesActionDestinations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGrpcRouteRulesActionDestinationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGrpcRouteRulesActionDestinations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGrpcRouteRulesActionDestinationsSlice(c *Client, des, nw []GrpcRouteRulesActionDestinations) []GrpcRouteRulesActionDestinations { @@ -1541,23 +1559,26 @@ func canonicalizeNewGrpcRouteRulesActionFaultInjectionPolicySet(c *Client, des, if des == nil { return nw } - var reorderedNew []GrpcRouteRulesActionFaultInjectionPolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GrpcRouteRulesActionFaultInjectionPolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGrpcRouteRulesActionFaultInjectionPolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGrpcRouteRulesActionFaultInjectionPolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGrpcRouteRulesActionFaultInjectionPolicySlice(c *Client, des, nw []GrpcRouteRulesActionFaultInjectionPolicy) []GrpcRouteRulesActionFaultInjectionPolicy { @@ -1682,23 +1703,26 @@ func canonicalizeNewGrpcRouteRulesActionFaultInjectionPolicyDelaySet(c *Client, if des == nil { return nw } - var reorderedNew []GrpcRouteRulesActionFaultInjectionPolicyDelay + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GrpcRouteRulesActionFaultInjectionPolicyDelay for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGrpcRouteRulesActionFaultInjectionPolicyDelayNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGrpcRouteRulesActionFaultInjectionPolicyDelay(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGrpcRouteRulesActionFaultInjectionPolicyDelaySlice(c *Client, des, nw []GrpcRouteRulesActionFaultInjectionPolicyDelay) []GrpcRouteRulesActionFaultInjectionPolicyDelay { @@ -1820,23 +1844,26 @@ func canonicalizeNewGrpcRouteRulesActionFaultInjectionPolicyAbortSet(c *Client, if des == nil { return nw } - var reorderedNew []GrpcRouteRulesActionFaultInjectionPolicyAbort + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GrpcRouteRulesActionFaultInjectionPolicyAbort for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGrpcRouteRulesActionFaultInjectionPolicyAbortNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGrpcRouteRulesActionFaultInjectionPolicyAbort(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGrpcRouteRulesActionFaultInjectionPolicyAbortSlice(c *Client, des, nw []GrpcRouteRulesActionFaultInjectionPolicyAbort) []GrpcRouteRulesActionFaultInjectionPolicyAbort { @@ -1941,23 +1968,26 @@ func canonicalizeNewGrpcRouteRulesActionRetryPolicySet(c *Client, des, nw []Grpc if des == nil { return nw } - var reorderedNew []GrpcRouteRulesActionRetryPolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GrpcRouteRulesActionRetryPolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGrpcRouteRulesActionRetryPolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGrpcRouteRulesActionRetryPolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGrpcRouteRulesActionRetryPolicySlice(c *Client, des, nw []GrpcRouteRulesActionRetryPolicy) []GrpcRouteRulesActionRetryPolicy { diff --git a/services/google/networkservices/http_route_internal.go b/services/google/networkservices/http_route_internal.go index c91b4ad30c..286c259fbd 100755 --- a/services/google/networkservices/http_route_internal.go +++ b/services/google/networkservices/http_route_internal.go @@ -787,23 +787,26 @@ func canonicalizeNewHttpRouteRulesSet(c *Client, des, nw []HttpRouteRules) []Htt if des == nil { return nw } - var reorderedNew []HttpRouteRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesSlice(c *Client, des, nw []HttpRouteRules) []HttpRouteRules { @@ -960,23 +963,26 @@ func canonicalizeNewHttpRouteRulesMatchesSet(c *Client, des, nw []HttpRouteRules if des == nil { return nw } - var reorderedNew []HttpRouteRulesMatches + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesMatches for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesMatchesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesMatches(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesMatchesSlice(c *Client, des, nw []HttpRouteRulesMatches) []HttpRouteRulesMatches { @@ -1185,23 +1191,26 @@ func canonicalizeNewHttpRouteRulesMatchesHeadersSet(c *Client, des, nw []HttpRou if des == nil { return nw } - var reorderedNew []HttpRouteRulesMatchesHeaders + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesMatchesHeaders for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesMatchesHeadersNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesMatchesHeaders(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesMatchesHeadersSlice(c *Client, des, nw []HttpRouteRulesMatchesHeaders) []HttpRouteRulesMatchesHeaders { @@ -1303,23 +1312,26 @@ func canonicalizeNewHttpRouteRulesMatchesHeadersRangeMatchSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []HttpRouteRulesMatchesHeadersRangeMatch + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesMatchesHeadersRangeMatch for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesMatchesHeadersRangeMatchNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesMatchesHeadersRangeMatch(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesMatchesHeadersRangeMatchSlice(c *Client, des, nw []HttpRouteRulesMatchesHeadersRangeMatch) []HttpRouteRulesMatchesHeadersRangeMatch { @@ -1472,23 +1484,26 @@ func canonicalizeNewHttpRouteRulesMatchesQueryParametersSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []HttpRouteRulesMatchesQueryParameters + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesMatchesQueryParameters for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesMatchesQueryParametersNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesMatchesQueryParameters(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesMatchesQueryParametersSlice(c *Client, des, nw []HttpRouteRulesMatchesQueryParameters) []HttpRouteRulesMatchesQueryParameters { @@ -1605,23 +1620,26 @@ func canonicalizeNewHttpRouteRulesActionSet(c *Client, des, nw []HttpRouteRulesA if des == nil { return nw } - var reorderedNew []HttpRouteRulesAction + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesAction for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesAction(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionSlice(c *Client, des, nw []HttpRouteRulesAction) []HttpRouteRulesAction { @@ -1723,23 +1741,26 @@ func canonicalizeNewHttpRouteRulesActionDestinationsSet(c *Client, des, nw []Htt if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionDestinations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionDestinations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionDestinationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionDestinations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionDestinationsSlice(c *Client, des, nw []HttpRouteRulesActionDestinations) []HttpRouteRulesActionDestinations { @@ -1882,23 +1903,26 @@ func canonicalizeNewHttpRouteRulesActionRedirectSet(c *Client, des, nw []HttpRou if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionRedirect + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionRedirect for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionRedirectNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionRedirect(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionRedirectSlice(c *Client, des, nw []HttpRouteRulesActionRedirect) []HttpRouteRulesActionRedirect { @@ -1993,23 +2017,26 @@ func canonicalizeNewHttpRouteRulesActionFaultInjectionPolicySet(c *Client, des, if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionFaultInjectionPolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionFaultInjectionPolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionFaultInjectionPolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionFaultInjectionPolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionFaultInjectionPolicySlice(c *Client, des, nw []HttpRouteRulesActionFaultInjectionPolicy) []HttpRouteRulesActionFaultInjectionPolicy { @@ -2114,23 +2141,26 @@ func canonicalizeNewHttpRouteRulesActionFaultInjectionPolicyDelaySet(c *Client, if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionFaultInjectionPolicyDelay + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionFaultInjectionPolicyDelay for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionFaultInjectionPolicyDelayNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionFaultInjectionPolicyDelay(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionFaultInjectionPolicyDelaySlice(c *Client, des, nw []HttpRouteRulesActionFaultInjectionPolicyDelay) []HttpRouteRulesActionFaultInjectionPolicyDelay { @@ -2232,23 +2262,26 @@ func canonicalizeNewHttpRouteRulesActionFaultInjectionPolicyAbortSet(c *Client, if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionFaultInjectionPolicyAbort + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionFaultInjectionPolicyAbort for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionFaultInjectionPolicyAbortNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionFaultInjectionPolicyAbort(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionFaultInjectionPolicyAbortSlice(c *Client, des, nw []HttpRouteRulesActionFaultInjectionPolicyAbort) []HttpRouteRulesActionFaultInjectionPolicyAbort { @@ -2359,23 +2392,26 @@ func canonicalizeNewHttpRouteRulesActionRequestHeaderModifierSet(c *Client, des, if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionRequestHeaderModifier + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionRequestHeaderModifier for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionRequestHeaderModifierNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionRequestHeaderModifier(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionRequestHeaderModifierSlice(c *Client, des, nw []HttpRouteRulesActionRequestHeaderModifier) []HttpRouteRulesActionRequestHeaderModifier { @@ -2486,23 +2522,26 @@ func canonicalizeNewHttpRouteRulesActionResponseHeaderModifierSet(c *Client, des if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionResponseHeaderModifier + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionResponseHeaderModifier for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionResponseHeaderModifierNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionResponseHeaderModifier(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionResponseHeaderModifierSlice(c *Client, des, nw []HttpRouteRulesActionResponseHeaderModifier) []HttpRouteRulesActionResponseHeaderModifier { @@ -2609,23 +2648,26 @@ func canonicalizeNewHttpRouteRulesActionUrlRewriteSet(c *Client, des, nw []HttpR if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionUrlRewrite + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionUrlRewrite for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionUrlRewriteNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionUrlRewrite(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionUrlRewriteSlice(c *Client, des, nw []HttpRouteRulesActionUrlRewrite) []HttpRouteRulesActionUrlRewrite { @@ -2738,23 +2780,26 @@ func canonicalizeNewHttpRouteRulesActionRetryPolicySet(c *Client, des, nw []Http if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionRetryPolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionRetryPolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionRetryPolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionRetryPolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionRetryPolicySlice(c *Client, des, nw []HttpRouteRulesActionRetryPolicy) []HttpRouteRulesActionRetryPolicy { @@ -2847,23 +2892,26 @@ func canonicalizeNewHttpRouteRulesActionRequestMirrorPolicySet(c *Client, des, n if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionRequestMirrorPolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionRequestMirrorPolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionRequestMirrorPolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionRequestMirrorPolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionRequestMirrorPolicySlice(c *Client, des, nw []HttpRouteRulesActionRequestMirrorPolicy) []HttpRouteRulesActionRequestMirrorPolicy { @@ -2965,23 +3013,26 @@ func canonicalizeNewHttpRouteRulesActionRequestMirrorPolicyDestinationSet(c *Cli if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionRequestMirrorPolicyDestination + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionRequestMirrorPolicyDestination for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionRequestMirrorPolicyDestinationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionRequestMirrorPolicyDestination(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionRequestMirrorPolicyDestinationSlice(c *Client, des, nw []HttpRouteRulesActionRequestMirrorPolicyDestination) []HttpRouteRulesActionRequestMirrorPolicyDestination { @@ -3136,23 +3187,26 @@ func canonicalizeNewHttpRouteRulesActionCorsPolicySet(c *Client, des, nw []HttpR if des == nil { return nw } - var reorderedNew []HttpRouteRulesActionCorsPolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []HttpRouteRulesActionCorsPolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareHttpRouteRulesActionCorsPolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewHttpRouteRulesActionCorsPolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewHttpRouteRulesActionCorsPolicySlice(c *Client, des, nw []HttpRouteRulesActionCorsPolicy) []HttpRouteRulesActionCorsPolicy { diff --git a/services/google/networkservices/tcp_route_internal.go b/services/google/networkservices/tcp_route_internal.go index f5478f0f2e..71ee9e3b95 100755 --- a/services/google/networkservices/tcp_route_internal.go +++ b/services/google/networkservices/tcp_route_internal.go @@ -669,23 +669,26 @@ func canonicalizeNewTcpRouteRulesSet(c *Client, des, nw []TcpRouteRules) []TcpRo if des == nil { return nw } - var reorderedNew []TcpRouteRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TcpRouteRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTcpRouteRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTcpRouteRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTcpRouteRulesSlice(c *Client, des, nw []TcpRouteRules) []TcpRouteRules { @@ -792,23 +795,26 @@ func canonicalizeNewTcpRouteRulesMatchesSet(c *Client, des, nw []TcpRouteRulesMa if des == nil { return nw } - var reorderedNew []TcpRouteRulesMatches + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TcpRouteRulesMatches for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTcpRouteRulesMatchesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTcpRouteRulesMatches(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTcpRouteRulesMatchesSlice(c *Client, des, nw []TcpRouteRulesMatches) []TcpRouteRulesMatches { @@ -909,23 +915,26 @@ func canonicalizeNewTcpRouteRulesActionSet(c *Client, des, nw []TcpRouteRulesAct if des == nil { return nw } - var reorderedNew []TcpRouteRulesAction + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TcpRouteRulesAction for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTcpRouteRulesActionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTcpRouteRulesAction(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTcpRouteRulesActionSlice(c *Client, des, nw []TcpRouteRulesAction) []TcpRouteRulesAction { @@ -1027,23 +1036,26 @@ func canonicalizeNewTcpRouteRulesActionDestinationsSet(c *Client, des, nw []TcpR if des == nil { return nw } - var reorderedNew []TcpRouteRulesActionDestinations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TcpRouteRulesActionDestinations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTcpRouteRulesActionDestinationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTcpRouteRulesActionDestinations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTcpRouteRulesActionDestinationsSlice(c *Client, des, nw []TcpRouteRulesActionDestinations) []TcpRouteRulesActionDestinations { diff --git a/services/google/networkservices/tls_route_internal.go b/services/google/networkservices/tls_route_internal.go index 2a56632ce1..1c2f7a9c00 100755 --- a/services/google/networkservices/tls_route_internal.go +++ b/services/google/networkservices/tls_route_internal.go @@ -655,23 +655,26 @@ func canonicalizeNewTlsRouteRulesSet(c *Client, des, nw []TlsRouteRules) []TlsRo if des == nil { return nw } - var reorderedNew []TlsRouteRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TlsRouteRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTlsRouteRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTlsRouteRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTlsRouteRulesSlice(c *Client, des, nw []TlsRouteRules) []TlsRouteRules { @@ -778,23 +781,26 @@ func canonicalizeNewTlsRouteRulesMatchesSet(c *Client, des, nw []TlsRouteRulesMa if des == nil { return nw } - var reorderedNew []TlsRouteRulesMatches + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TlsRouteRulesMatches for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTlsRouteRulesMatchesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTlsRouteRulesMatches(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTlsRouteRulesMatchesSlice(c *Client, des, nw []TlsRouteRulesMatches) []TlsRouteRulesMatches { @@ -887,23 +893,26 @@ func canonicalizeNewTlsRouteRulesActionSet(c *Client, des, nw []TlsRouteRulesAct if des == nil { return nw } - var reorderedNew []TlsRouteRulesAction + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TlsRouteRulesAction for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTlsRouteRulesActionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTlsRouteRulesAction(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTlsRouteRulesActionSlice(c *Client, des, nw []TlsRouteRulesAction) []TlsRouteRulesAction { @@ -1005,23 +1014,26 @@ func canonicalizeNewTlsRouteRulesActionDestinationsSet(c *Client, des, nw []TlsR if des == nil { return nw } - var reorderedNew []TlsRouteRulesActionDestinations + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TlsRouteRulesActionDestinations for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTlsRouteRulesActionDestinationsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTlsRouteRulesActionDestinations(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTlsRouteRulesActionDestinationsSlice(c *Client, des, nw []TlsRouteRulesActionDestinations) []TlsRouteRulesActionDestinations { diff --git a/services/google/orgpolicy/alpha/policy_internal.go b/services/google/orgpolicy/alpha/policy_internal.go index 92f2a9913e..5aaca1d088 100755 --- a/services/google/orgpolicy/alpha/policy_internal.go +++ b/services/google/orgpolicy/alpha/policy_internal.go @@ -522,7 +522,7 @@ func canonicalizeNewPolicySpec(c *Client, des, nw *PolicySpec) *PolicySpec { if dcl.StringCanonicalize(des.Etag, nw.Etag) { nw.Etag = des.Etag } - nw.Rules = canonicalizeNewPolicySpecRulesSlice(c, des.Rules, nw.Rules) + nw.Rules = canonicalizeNewPolicySpecRulesSet(c, des.Rules, nw.Rules) if dcl.BoolCanonicalize(des.InheritFromParent, nw.InheritFromParent) { nw.InheritFromParent = des.InheritFromParent } @@ -537,23 +537,26 @@ func canonicalizeNewPolicySpecSet(c *Client, des, nw []PolicySpec) []PolicySpec if des == nil { return nw } - var reorderedNew []PolicySpec + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PolicySpec for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePolicySpecNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPolicySpec(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPolicySpecSlice(c *Client, des, nw []PolicySpec) []PolicySpec { @@ -712,23 +715,26 @@ func canonicalizeNewPolicySpecRulesSet(c *Client, des, nw []PolicySpecRules) []P if des == nil { return nw } - var reorderedNew []PolicySpecRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PolicySpecRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePolicySpecRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPolicySpecRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPolicySpecRulesSlice(c *Client, des, nw []PolicySpecRules) []PolicySpecRules { @@ -835,23 +841,26 @@ func canonicalizeNewPolicySpecRulesValuesSet(c *Client, des, nw []PolicySpecRule if des == nil { return nw } - var reorderedNew []PolicySpecRulesValues + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PolicySpecRulesValues for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePolicySpecRulesValuesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPolicySpecRulesValues(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPolicySpecRulesValuesSlice(c *Client, des, nw []PolicySpecRulesValues) []PolicySpecRulesValues { @@ -974,23 +983,26 @@ func canonicalizeNewPolicySpecRulesConditionSet(c *Client, des, nw []PolicySpecR if des == nil { return nw } - var reorderedNew []PolicySpecRulesCondition + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PolicySpecRulesCondition for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePolicySpecRulesConditionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPolicySpecRulesCondition(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPolicySpecRulesConditionSlice(c *Client, des, nw []PolicySpecRulesCondition) []PolicySpecRulesCondition { @@ -1088,7 +1100,7 @@ func comparePolicySpecNewStyle(d, a interface{}, fn dcl.FieldName) ([]*dcl.Field diffs = append(diffs, ds...) } - if ds, err := dcl.Diff(desired.Rules, actual.Rules, dcl.DiffInfo{ObjectFunction: comparePolicySpecRulesNewStyle, EmptyObject: EmptyPolicySpecRules, OperationSelector: dcl.TriggersOperation("updatePolicyUpdatePolicyOperation")}, fn.AddNest("Rules")); len(ds) != 0 || err != nil { + if ds, err := dcl.Diff(desired.Rules, actual.Rules, dcl.DiffInfo{Type: "Set", ObjectFunction: comparePolicySpecRulesNewStyle, EmptyObject: EmptyPolicySpecRules, OperationSelector: dcl.TriggersOperation("updatePolicyUpdatePolicyOperation")}, fn.AddNest("Rules")); len(ds) != 0 || err != nil { if err != nil { return nil, err } diff --git a/services/google/orgpolicy/beta/policy_internal.go b/services/google/orgpolicy/beta/policy_internal.go index b3cd807bb7..6ff36aa767 100755 --- a/services/google/orgpolicy/beta/policy_internal.go +++ b/services/google/orgpolicy/beta/policy_internal.go @@ -522,7 +522,7 @@ func canonicalizeNewPolicySpec(c *Client, des, nw *PolicySpec) *PolicySpec { if dcl.StringCanonicalize(des.Etag, nw.Etag) { nw.Etag = des.Etag } - nw.Rules = canonicalizeNewPolicySpecRulesSlice(c, des.Rules, nw.Rules) + nw.Rules = canonicalizeNewPolicySpecRulesSet(c, des.Rules, nw.Rules) if dcl.BoolCanonicalize(des.InheritFromParent, nw.InheritFromParent) { nw.InheritFromParent = des.InheritFromParent } @@ -537,23 +537,26 @@ func canonicalizeNewPolicySpecSet(c *Client, des, nw []PolicySpec) []PolicySpec if des == nil { return nw } - var reorderedNew []PolicySpec + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PolicySpec for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePolicySpecNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPolicySpec(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPolicySpecSlice(c *Client, des, nw []PolicySpec) []PolicySpec { @@ -712,23 +715,26 @@ func canonicalizeNewPolicySpecRulesSet(c *Client, des, nw []PolicySpecRules) []P if des == nil { return nw } - var reorderedNew []PolicySpecRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PolicySpecRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePolicySpecRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPolicySpecRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPolicySpecRulesSlice(c *Client, des, nw []PolicySpecRules) []PolicySpecRules { @@ -835,23 +841,26 @@ func canonicalizeNewPolicySpecRulesValuesSet(c *Client, des, nw []PolicySpecRule if des == nil { return nw } - var reorderedNew []PolicySpecRulesValues + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PolicySpecRulesValues for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePolicySpecRulesValuesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPolicySpecRulesValues(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPolicySpecRulesValuesSlice(c *Client, des, nw []PolicySpecRulesValues) []PolicySpecRulesValues { @@ -974,23 +983,26 @@ func canonicalizeNewPolicySpecRulesConditionSet(c *Client, des, nw []PolicySpecR if des == nil { return nw } - var reorderedNew []PolicySpecRulesCondition + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PolicySpecRulesCondition for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePolicySpecRulesConditionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPolicySpecRulesCondition(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPolicySpecRulesConditionSlice(c *Client, des, nw []PolicySpecRulesCondition) []PolicySpecRulesCondition { @@ -1088,7 +1100,7 @@ func comparePolicySpecNewStyle(d, a interface{}, fn dcl.FieldName) ([]*dcl.Field diffs = append(diffs, ds...) } - if ds, err := dcl.Diff(desired.Rules, actual.Rules, dcl.DiffInfo{ObjectFunction: comparePolicySpecRulesNewStyle, EmptyObject: EmptyPolicySpecRules, OperationSelector: dcl.TriggersOperation("updatePolicyUpdatePolicyOperation")}, fn.AddNest("Rules")); len(ds) != 0 || err != nil { + if ds, err := dcl.Diff(desired.Rules, actual.Rules, dcl.DiffInfo{Type: "Set", ObjectFunction: comparePolicySpecRulesNewStyle, EmptyObject: EmptyPolicySpecRules, OperationSelector: dcl.TriggersOperation("updatePolicyUpdatePolicyOperation")}, fn.AddNest("Rules")); len(ds) != 0 || err != nil { if err != nil { return nil, err } diff --git a/services/google/orgpolicy/policy_internal.go b/services/google/orgpolicy/policy_internal.go index e94b86c07f..76e5c68b0f 100755 --- a/services/google/orgpolicy/policy_internal.go +++ b/services/google/orgpolicy/policy_internal.go @@ -522,7 +522,7 @@ func canonicalizeNewPolicySpec(c *Client, des, nw *PolicySpec) *PolicySpec { if dcl.StringCanonicalize(des.Etag, nw.Etag) { nw.Etag = des.Etag } - nw.Rules = canonicalizeNewPolicySpecRulesSlice(c, des.Rules, nw.Rules) + nw.Rules = canonicalizeNewPolicySpecRulesSet(c, des.Rules, nw.Rules) if dcl.BoolCanonicalize(des.InheritFromParent, nw.InheritFromParent) { nw.InheritFromParent = des.InheritFromParent } @@ -537,23 +537,26 @@ func canonicalizeNewPolicySpecSet(c *Client, des, nw []PolicySpec) []PolicySpec if des == nil { return nw } - var reorderedNew []PolicySpec + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PolicySpec for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePolicySpecNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPolicySpec(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPolicySpecSlice(c *Client, des, nw []PolicySpec) []PolicySpec { @@ -712,23 +715,26 @@ func canonicalizeNewPolicySpecRulesSet(c *Client, des, nw []PolicySpecRules) []P if des == nil { return nw } - var reorderedNew []PolicySpecRules + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PolicySpecRules for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePolicySpecRulesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPolicySpecRules(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPolicySpecRulesSlice(c *Client, des, nw []PolicySpecRules) []PolicySpecRules { @@ -835,23 +841,26 @@ func canonicalizeNewPolicySpecRulesValuesSet(c *Client, des, nw []PolicySpecRule if des == nil { return nw } - var reorderedNew []PolicySpecRulesValues + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PolicySpecRulesValues for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePolicySpecRulesValuesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPolicySpecRulesValues(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPolicySpecRulesValuesSlice(c *Client, des, nw []PolicySpecRulesValues) []PolicySpecRulesValues { @@ -974,23 +983,26 @@ func canonicalizeNewPolicySpecRulesConditionSet(c *Client, des, nw []PolicySpecR if des == nil { return nw } - var reorderedNew []PolicySpecRulesCondition + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PolicySpecRulesCondition for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePolicySpecRulesConditionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPolicySpecRulesCondition(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPolicySpecRulesConditionSlice(c *Client, des, nw []PolicySpecRulesCondition) []PolicySpecRulesCondition { @@ -1088,7 +1100,7 @@ func comparePolicySpecNewStyle(d, a interface{}, fn dcl.FieldName) ([]*dcl.Field diffs = append(diffs, ds...) } - if ds, err := dcl.Diff(desired.Rules, actual.Rules, dcl.DiffInfo{ObjectFunction: comparePolicySpecRulesNewStyle, EmptyObject: EmptyPolicySpecRules, OperationSelector: dcl.TriggersOperation("updatePolicyUpdatePolicyOperation")}, fn.AddNest("Rules")); len(ds) != 0 || err != nil { + if ds, err := dcl.Diff(desired.Rules, actual.Rules, dcl.DiffInfo{Type: "Set", ObjectFunction: comparePolicySpecRulesNewStyle, EmptyObject: EmptyPolicySpecRules, OperationSelector: dcl.TriggersOperation("updatePolicyUpdatePolicyOperation")}, fn.AddNest("Rules")); len(ds) != 0 || err != nil { if err != nil { return nil, err } diff --git a/services/google/orgpolicy/samples/folder.policy.json b/services/google/orgpolicy/samples/folder.policy.json index a761853836..da36715de5 100755 --- a/services/google/orgpolicy/samples/folder.policy.json +++ b/services/google/orgpolicy/samples/folder.policy.json @@ -5,6 +5,13 @@ "rules": [ { "denyAll": true + }, + { + "allowAll": true, + "condition": { + "expression": "resource.matchTagId('tagKeys/123', 'tagValues/456')", + "title": "Allow when compute-external-ip tag is set to allowed" + } } ], "inheritFromParent": true diff --git a/services/google/osconfig/alpha/guest_policy_internal.go b/services/google/osconfig/alpha/guest_policy_internal.go index b0231da0c6..a97ad5f13a 100755 --- a/services/google/osconfig/alpha/guest_policy_internal.go +++ b/services/google/osconfig/alpha/guest_policy_internal.go @@ -842,23 +842,26 @@ func canonicalizeNewGuestPolicyAssignmentSet(c *Client, des, nw []GuestPolicyAss if des == nil { return nw } - var reorderedNew []GuestPolicyAssignment + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyAssignment for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyAssignmentNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyAssignment(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyAssignmentSlice(c *Client, des, nw []GuestPolicyAssignment) []GuestPolicyAssignment { @@ -954,23 +957,26 @@ func canonicalizeNewGuestPolicyAssignmentGroupLabelsSet(c *Client, des, nw []Gue if des == nil { return nw } - var reorderedNew []GuestPolicyAssignmentGroupLabels + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyAssignmentGroupLabels for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyAssignmentGroupLabelsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyAssignmentGroupLabels(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyAssignmentGroupLabelsSlice(c *Client, des, nw []GuestPolicyAssignmentGroupLabels) []GuestPolicyAssignmentGroupLabels { @@ -1085,23 +1091,26 @@ func canonicalizeNewGuestPolicyAssignmentOSTypesSet(c *Client, des, nw []GuestPo if des == nil { return nw } - var reorderedNew []GuestPolicyAssignmentOSTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyAssignmentOSTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyAssignmentOSTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyAssignmentOSTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyAssignmentOSTypesSlice(c *Client, des, nw []GuestPolicyAssignmentOSTypes) []GuestPolicyAssignmentOSTypes { @@ -1212,23 +1221,26 @@ func canonicalizeNewGuestPolicyPackagesSet(c *Client, des, nw []GuestPolicyPacka if des == nil { return nw } - var reorderedNew []GuestPolicyPackages + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyPackages for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyPackagesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyPackages(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyPackagesSlice(c *Client, des, nw []GuestPolicyPackages) []GuestPolicyPackages { @@ -1367,23 +1379,26 @@ func canonicalizeNewGuestPolicyPackageRepositoriesSet(c *Client, des, nw []Guest if des == nil { return nw } - var reorderedNew []GuestPolicyPackageRepositories + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyPackageRepositories for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyPackageRepositoriesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyPackageRepositories(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyPackageRepositoriesSlice(c *Client, des, nw []GuestPolicyPackageRepositories) []GuestPolicyPackageRepositories { @@ -1512,23 +1527,26 @@ func canonicalizeNewGuestPolicyPackageRepositoriesAptSet(c *Client, des, nw []Gu if des == nil { return nw } - var reorderedNew []GuestPolicyPackageRepositoriesApt + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyPackageRepositoriesApt for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyPackageRepositoriesAptNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyPackageRepositoriesApt(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyPackageRepositoriesAptSlice(c *Client, des, nw []GuestPolicyPackageRepositoriesApt) []GuestPolicyPackageRepositoriesApt { @@ -1651,23 +1669,26 @@ func canonicalizeNewGuestPolicyPackageRepositoriesYumSet(c *Client, des, nw []Gu if des == nil { return nw } - var reorderedNew []GuestPolicyPackageRepositoriesYum + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyPackageRepositoriesYum for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyPackageRepositoriesYumNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyPackageRepositoriesYum(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyPackageRepositoriesYumSlice(c *Client, des, nw []GuestPolicyPackageRepositoriesYum) []GuestPolicyPackageRepositoriesYum { @@ -1790,23 +1811,26 @@ func canonicalizeNewGuestPolicyPackageRepositoriesZypperSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []GuestPolicyPackageRepositoriesZypper + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyPackageRepositoriesZypper for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyPackageRepositoriesZypperNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyPackageRepositoriesZypper(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyPackageRepositoriesZypperSlice(c *Client, des, nw []GuestPolicyPackageRepositoriesZypper) []GuestPolicyPackageRepositoriesZypper { @@ -1913,23 +1937,26 @@ func canonicalizeNewGuestPolicyPackageRepositoriesGooSet(c *Client, des, nw []Gu if des == nil { return nw } - var reorderedNew []GuestPolicyPackageRepositoriesGoo + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyPackageRepositoriesGoo for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyPackageRepositoriesGooNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyPackageRepositoriesGoo(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyPackageRepositoriesGooSlice(c *Client, des, nw []GuestPolicyPackageRepositoriesGoo) []GuestPolicyPackageRepositoriesGoo { @@ -2068,23 +2095,26 @@ func canonicalizeNewGuestPolicyRecipesSet(c *Client, des, nw []GuestPolicyRecipe if des == nil { return nw } - var reorderedNew []GuestPolicyRecipes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesSlice(c *Client, des, nw []GuestPolicyRecipes) []GuestPolicyRecipes { @@ -2195,23 +2225,26 @@ func canonicalizeNewGuestPolicyRecipesArtifactsSet(c *Client, des, nw []GuestPol if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesArtifacts + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesArtifacts for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesArtifactsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesArtifacts(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesArtifactsSlice(c *Client, des, nw []GuestPolicyRecipesArtifacts) []GuestPolicyRecipesArtifacts { @@ -2318,23 +2351,26 @@ func canonicalizeNewGuestPolicyRecipesArtifactsRemoteSet(c *Client, des, nw []Gu if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesArtifactsRemote + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesArtifactsRemote for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesArtifactsRemoteNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesArtifactsRemote(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesArtifactsRemoteSlice(c *Client, des, nw []GuestPolicyRecipesArtifactsRemote) []GuestPolicyRecipesArtifactsRemote { @@ -2445,23 +2481,26 @@ func canonicalizeNewGuestPolicyRecipesArtifactsGcsSet(c *Client, des, nw []Guest if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesArtifactsGcs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesArtifactsGcs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesArtifactsGcsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesArtifactsGcs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesArtifactsGcsSlice(c *Client, des, nw []GuestPolicyRecipesArtifactsGcs) []GuestPolicyRecipesArtifactsGcs { @@ -2566,23 +2605,26 @@ func canonicalizeNewGuestPolicyRecipesInstallStepsSet(c *Client, des, nw []Guest if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesInstallSteps + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesInstallSteps for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesInstallStepsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesInstallSteps(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesInstallStepsSlice(c *Client, des, nw []GuestPolicyRecipesInstallSteps) []GuestPolicyRecipesInstallSteps { @@ -2705,23 +2747,26 @@ func canonicalizeNewGuestPolicyRecipesInstallStepsFileCopySet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesInstallStepsFileCopy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesInstallStepsFileCopy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesInstallStepsFileCopyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesInstallStepsFileCopy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesInstallStepsFileCopySlice(c *Client, des, nw []GuestPolicyRecipesInstallStepsFileCopy) []GuestPolicyRecipesInstallStepsFileCopy { @@ -2834,23 +2879,26 @@ func canonicalizeNewGuestPolicyRecipesInstallStepsArchiveExtractionSet(c *Client if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesInstallStepsArchiveExtraction + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesInstallStepsArchiveExtraction for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesInstallStepsArchiveExtractionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesInstallStepsArchiveExtraction(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesInstallStepsArchiveExtractionSlice(c *Client, des, nw []GuestPolicyRecipesInstallStepsArchiveExtraction) []GuestPolicyRecipesInstallStepsArchiveExtraction { @@ -2963,23 +3011,26 @@ func canonicalizeNewGuestPolicyRecipesInstallStepsMsiInstallationSet(c *Client, if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesInstallStepsMsiInstallation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesInstallStepsMsiInstallation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesInstallStepsMsiInstallationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesInstallStepsMsiInstallation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesInstallStepsMsiInstallationSlice(c *Client, des, nw []GuestPolicyRecipesInstallStepsMsiInstallation) []GuestPolicyRecipesInstallStepsMsiInstallation { @@ -3078,23 +3129,26 @@ func canonicalizeNewGuestPolicyRecipesInstallStepsDpkgInstallationSet(c *Client, if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesInstallStepsDpkgInstallation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesInstallStepsDpkgInstallation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesInstallStepsDpkgInstallationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesInstallStepsDpkgInstallation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesInstallStepsDpkgInstallationSlice(c *Client, des, nw []GuestPolicyRecipesInstallStepsDpkgInstallation) []GuestPolicyRecipesInstallStepsDpkgInstallation { @@ -3193,23 +3247,26 @@ func canonicalizeNewGuestPolicyRecipesInstallStepsRpmInstallationSet(c *Client, if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesInstallStepsRpmInstallation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesInstallStepsRpmInstallation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesInstallStepsRpmInstallationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesInstallStepsRpmInstallation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesInstallStepsRpmInstallationSlice(c *Client, des, nw []GuestPolicyRecipesInstallStepsRpmInstallation) []GuestPolicyRecipesInstallStepsRpmInstallation { @@ -3330,23 +3387,26 @@ func canonicalizeNewGuestPolicyRecipesInstallStepsFileExecSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesInstallStepsFileExec + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesInstallStepsFileExec for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesInstallStepsFileExecNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesInstallStepsFileExec(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesInstallStepsFileExecSlice(c *Client, des, nw []GuestPolicyRecipesInstallStepsFileExec) []GuestPolicyRecipesInstallStepsFileExec { @@ -3457,23 +3517,26 @@ func canonicalizeNewGuestPolicyRecipesInstallStepsScriptRunSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesInstallStepsScriptRun + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesInstallStepsScriptRun for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesInstallStepsScriptRunNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesInstallStepsScriptRun(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesInstallStepsScriptRunSlice(c *Client, des, nw []GuestPolicyRecipesInstallStepsScriptRun) []GuestPolicyRecipesInstallStepsScriptRun { @@ -3578,23 +3641,26 @@ func canonicalizeNewGuestPolicyRecipesUpdateStepsSet(c *Client, des, nw []GuestP if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesUpdateSteps + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesUpdateSteps for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesUpdateStepsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesUpdateSteps(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesUpdateStepsSlice(c *Client, des, nw []GuestPolicyRecipesUpdateSteps) []GuestPolicyRecipesUpdateSteps { @@ -3717,23 +3783,26 @@ func canonicalizeNewGuestPolicyRecipesUpdateStepsFileCopySet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesUpdateStepsFileCopy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesUpdateStepsFileCopy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesUpdateStepsFileCopyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesUpdateStepsFileCopy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesUpdateStepsFileCopySlice(c *Client, des, nw []GuestPolicyRecipesUpdateStepsFileCopy) []GuestPolicyRecipesUpdateStepsFileCopy { @@ -3846,23 +3915,26 @@ func canonicalizeNewGuestPolicyRecipesUpdateStepsArchiveExtractionSet(c *Client, if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesUpdateStepsArchiveExtraction + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesUpdateStepsArchiveExtraction for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesUpdateStepsArchiveExtractionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesUpdateStepsArchiveExtraction(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesUpdateStepsArchiveExtractionSlice(c *Client, des, nw []GuestPolicyRecipesUpdateStepsArchiveExtraction) []GuestPolicyRecipesUpdateStepsArchiveExtraction { @@ -3975,23 +4047,26 @@ func canonicalizeNewGuestPolicyRecipesUpdateStepsMsiInstallationSet(c *Client, d if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesUpdateStepsMsiInstallation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesUpdateStepsMsiInstallation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesUpdateStepsMsiInstallationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesUpdateStepsMsiInstallation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesUpdateStepsMsiInstallationSlice(c *Client, des, nw []GuestPolicyRecipesUpdateStepsMsiInstallation) []GuestPolicyRecipesUpdateStepsMsiInstallation { @@ -4090,23 +4165,26 @@ func canonicalizeNewGuestPolicyRecipesUpdateStepsDpkgInstallationSet(c *Client, if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesUpdateStepsDpkgInstallation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesUpdateStepsDpkgInstallation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesUpdateStepsDpkgInstallationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesUpdateStepsDpkgInstallation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesUpdateStepsDpkgInstallationSlice(c *Client, des, nw []GuestPolicyRecipesUpdateStepsDpkgInstallation) []GuestPolicyRecipesUpdateStepsDpkgInstallation { @@ -4205,23 +4283,26 @@ func canonicalizeNewGuestPolicyRecipesUpdateStepsRpmInstallationSet(c *Client, d if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesUpdateStepsRpmInstallation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesUpdateStepsRpmInstallation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesUpdateStepsRpmInstallationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesUpdateStepsRpmInstallation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesUpdateStepsRpmInstallationSlice(c *Client, des, nw []GuestPolicyRecipesUpdateStepsRpmInstallation) []GuestPolicyRecipesUpdateStepsRpmInstallation { @@ -4342,23 +4423,26 @@ func canonicalizeNewGuestPolicyRecipesUpdateStepsFileExecSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesUpdateStepsFileExec + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesUpdateStepsFileExec for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesUpdateStepsFileExecNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesUpdateStepsFileExec(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesUpdateStepsFileExecSlice(c *Client, des, nw []GuestPolicyRecipesUpdateStepsFileExec) []GuestPolicyRecipesUpdateStepsFileExec { @@ -4469,23 +4553,26 @@ func canonicalizeNewGuestPolicyRecipesUpdateStepsScriptRunSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesUpdateStepsScriptRun + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesUpdateStepsScriptRun for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesUpdateStepsScriptRunNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesUpdateStepsScriptRun(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesUpdateStepsScriptRunSlice(c *Client, des, nw []GuestPolicyRecipesUpdateStepsScriptRun) []GuestPolicyRecipesUpdateStepsScriptRun { diff --git a/services/google/osconfig/alpha/os_policy_assignment_internal.go b/services/google/osconfig/alpha/os_policy_assignment_internal.go index 5e3fcc031f..ed094a4c1e 100755 --- a/services/google/osconfig/alpha/os_policy_assignment_internal.go +++ b/services/google/osconfig/alpha/os_policy_assignment_internal.go @@ -1091,23 +1091,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesSet(c *Client, des, nw []OSPolic if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPolicies + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPolicies for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPolicies(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesSlice(c *Client, des, nw []OSPolicyAssignmentOSPolicies) []OSPolicyAssignmentOSPolicies { @@ -1202,23 +1205,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsSet(c *Client, des if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroups + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroups for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroups(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroups) []OSPolicyAssignmentOSPoliciesResourceGroups { @@ -1325,23 +1331,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsInventoryFiltersSe if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsInventoryFilters + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsInventoryFilters for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsInventoryFiltersNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsInventoryFilters(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsInventoryFiltersSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsInventoryFilters) []OSPolicyAssignmentOSPoliciesResourceGroupsInventoryFilters { @@ -1488,23 +1497,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesSet(c *Cl if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResources + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResources for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResources(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResources) []OSPolicyAssignmentOSPoliciesResourceGroupsResources { @@ -1685,23 +1697,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgSet(c if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkg + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkg for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkg(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkg) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkg { @@ -1800,23 +1815,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgAptSet if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgApt + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgApt for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgAptNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgApt(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgAptSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgApt) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgApt { @@ -1917,23 +1935,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSet if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDeb + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDeb for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDeb(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDeb) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDeb { @@ -2074,23 +2095,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSou if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSource + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSource for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSource(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSource) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSource { @@ -2197,23 +2221,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSou if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceRemote + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceRemote for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceRemoteNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceRemote(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceRemoteSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceRemote) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceRemote { @@ -2326,23 +2353,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSou if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceGcs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceGcs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceGcsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceGcs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceGcsSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceGcs) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceGcs { @@ -2441,23 +2471,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgYumSet if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgYum + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgYum for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgYumNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgYum(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgYumSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgYum) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgYum { @@ -2556,23 +2589,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgZypper if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgZypper + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgZypper for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgZypperNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgZypper(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgZypperSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgZypper) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgZypper { @@ -2673,23 +2709,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSet if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpm + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpm for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpm(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpm) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpm { @@ -2830,23 +2869,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSou if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSource + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSource for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSource(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSource) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSource { @@ -2953,23 +2995,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSou if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceRemote + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceRemote for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceRemoteNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceRemote(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceRemoteSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceRemote) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceRemote { @@ -3082,23 +3127,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSou if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceGcs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceGcs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceGcsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceGcs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceGcsSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceGcs) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceGcs { @@ -3197,23 +3245,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgGooget if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgGooget + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgGooget for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgGoogetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgGooget(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgGoogetSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgGooget) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgGooget { @@ -3314,23 +3365,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSet if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsi + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsi for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsi(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsi) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsi { @@ -3471,23 +3525,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSou if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSource + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSource for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSource(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSource) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSource { @@ -3594,23 +3651,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSou if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceRemote + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceRemote for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceRemoteNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceRemote(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceRemoteSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceRemote) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceRemote { @@ -3723,23 +3783,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSou if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceGcs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceGcs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceGcsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceGcs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceGcsSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceGcs) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceGcs { @@ -3878,23 +3941,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositor if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepository + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepository for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepository(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositorySlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepository) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepository { @@ -4023,23 +4089,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositor if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryApt + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryApt for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryAptNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryApt(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryAptSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryApt) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryApt { @@ -4162,23 +4231,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositor if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryYum + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryYum for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryYumNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryYum(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryYumSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryYum) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryYum { @@ -4301,23 +4373,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositor if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryZypper + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryZypper for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryZypperNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryZypper(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryZypperSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryZypper) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryZypper { @@ -4424,23 +4499,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositor if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryGoo + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryGoo for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryGooNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryGoo(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryGooSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryGoo) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryGoo { @@ -4535,23 +4613,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecSet(c if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExec + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExec for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExec(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExec) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExec { @@ -4694,23 +4775,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValid if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidate + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidate for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidate(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidate) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidate { @@ -4851,23 +4935,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValid if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFile + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFile for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFile(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFile) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFile { @@ -4974,23 +5061,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValid if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileRemote + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileRemote for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileRemoteNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileRemote(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileRemoteSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileRemote) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileRemote { @@ -5103,23 +5193,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValid if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileGcs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileGcs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileGcsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileGcs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileGcsSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileGcs) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileGcs { @@ -5262,23 +5355,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnfor if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforce + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforce for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforce(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforce) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforce { @@ -5419,23 +5515,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnfor if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFile + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFile for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFile(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFile) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFile { @@ -5542,23 +5641,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnfor if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileRemote + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileRemote for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileRemoteNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileRemote(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileRemoteSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileRemote) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileRemote { @@ -5671,23 +5773,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnfor if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileGcs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileGcs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileGcsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileGcs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileGcsSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileGcs) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileGcs { @@ -5825,23 +5930,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileSet(c if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFile + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFile for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFile(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFile) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFile { @@ -5982,23 +6090,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileS if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFile + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFile for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFile(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFile) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFile { @@ -6105,23 +6216,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileR if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileRemote + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileRemote for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileRemoteNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileRemote(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileRemoteSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileRemote) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileRemote { @@ -6234,23 +6348,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileG if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileGcs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileGcs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileGcsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileGcs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileGcsSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileGcs) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileGcs { @@ -6355,23 +6472,26 @@ func canonicalizeNewOSPolicyAssignmentInstanceFilterSet(c *Client, des, nw []OSP if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentInstanceFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentInstanceFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentInstanceFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentInstanceFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentInstanceFilterSlice(c *Client, des, nw []OSPolicyAssignmentInstanceFilter) []OSPolicyAssignmentInstanceFilter { @@ -6467,23 +6587,26 @@ func canonicalizeNewOSPolicyAssignmentInstanceFilterInclusionLabelsSet(c *Client if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentInstanceFilterInclusionLabels + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentInstanceFilterInclusionLabels for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentInstanceFilterInclusionLabelsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentInstanceFilterInclusionLabels(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentInstanceFilterInclusionLabelsSlice(c *Client, des, nw []OSPolicyAssignmentInstanceFilterInclusionLabels) []OSPolicyAssignmentInstanceFilterInclusionLabels { @@ -6579,23 +6702,26 @@ func canonicalizeNewOSPolicyAssignmentInstanceFilterExclusionLabelsSet(c *Client if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentInstanceFilterExclusionLabels + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentInstanceFilterExclusionLabels for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentInstanceFilterExclusionLabelsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentInstanceFilterExclusionLabels(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentInstanceFilterExclusionLabelsSlice(c *Client, des, nw []OSPolicyAssignmentInstanceFilterExclusionLabels) []OSPolicyAssignmentInstanceFilterExclusionLabels { @@ -6702,23 +6828,26 @@ func canonicalizeNewOSPolicyAssignmentInstanceFilterInventoriesSet(c *Client, de if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentInstanceFilterInventories + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentInstanceFilterInventories for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentInstanceFilterInventoriesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentInstanceFilterInventories(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentInstanceFilterInventoriesSlice(c *Client, des, nw []OSPolicyAssignmentInstanceFilterInventories) []OSPolicyAssignmentInstanceFilterInventories { @@ -6819,23 +6948,26 @@ func canonicalizeNewOSPolicyAssignmentRolloutSet(c *Client, des, nw []OSPolicyAs if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentRollout + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentRollout for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentRolloutNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentRollout(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentRolloutSlice(c *Client, des, nw []OSPolicyAssignmentRollout) []OSPolicyAssignmentRollout { @@ -6957,23 +7089,26 @@ func canonicalizeNewOSPolicyAssignmentRolloutDisruptionBudgetSet(c *Client, des, if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentRolloutDisruptionBudget + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentRolloutDisruptionBudget for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentRolloutDisruptionBudgetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentRolloutDisruptionBudget(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentRolloutDisruptionBudgetSlice(c *Client, des, nw []OSPolicyAssignmentRolloutDisruptionBudget) []OSPolicyAssignmentRolloutDisruptionBudget { diff --git a/services/google/osconfig/beta/guest_policy_internal.go b/services/google/osconfig/beta/guest_policy_internal.go index 6574a318ca..15ba4650ad 100755 --- a/services/google/osconfig/beta/guest_policy_internal.go +++ b/services/google/osconfig/beta/guest_policy_internal.go @@ -842,23 +842,26 @@ func canonicalizeNewGuestPolicyAssignmentSet(c *Client, des, nw []GuestPolicyAss if des == nil { return nw } - var reorderedNew []GuestPolicyAssignment + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyAssignment for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyAssignmentNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyAssignment(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyAssignmentSlice(c *Client, des, nw []GuestPolicyAssignment) []GuestPolicyAssignment { @@ -954,23 +957,26 @@ func canonicalizeNewGuestPolicyAssignmentGroupLabelsSet(c *Client, des, nw []Gue if des == nil { return nw } - var reorderedNew []GuestPolicyAssignmentGroupLabels + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyAssignmentGroupLabels for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyAssignmentGroupLabelsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyAssignmentGroupLabels(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyAssignmentGroupLabelsSlice(c *Client, des, nw []GuestPolicyAssignmentGroupLabels) []GuestPolicyAssignmentGroupLabels { @@ -1085,23 +1091,26 @@ func canonicalizeNewGuestPolicyAssignmentOSTypesSet(c *Client, des, nw []GuestPo if des == nil { return nw } - var reorderedNew []GuestPolicyAssignmentOSTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyAssignmentOSTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyAssignmentOSTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyAssignmentOSTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyAssignmentOSTypesSlice(c *Client, des, nw []GuestPolicyAssignmentOSTypes) []GuestPolicyAssignmentOSTypes { @@ -1212,23 +1221,26 @@ func canonicalizeNewGuestPolicyPackagesSet(c *Client, des, nw []GuestPolicyPacka if des == nil { return nw } - var reorderedNew []GuestPolicyPackages + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyPackages for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyPackagesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyPackages(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyPackagesSlice(c *Client, des, nw []GuestPolicyPackages) []GuestPolicyPackages { @@ -1367,23 +1379,26 @@ func canonicalizeNewGuestPolicyPackageRepositoriesSet(c *Client, des, nw []Guest if des == nil { return nw } - var reorderedNew []GuestPolicyPackageRepositories + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyPackageRepositories for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyPackageRepositoriesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyPackageRepositories(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyPackageRepositoriesSlice(c *Client, des, nw []GuestPolicyPackageRepositories) []GuestPolicyPackageRepositories { @@ -1512,23 +1527,26 @@ func canonicalizeNewGuestPolicyPackageRepositoriesAptSet(c *Client, des, nw []Gu if des == nil { return nw } - var reorderedNew []GuestPolicyPackageRepositoriesApt + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyPackageRepositoriesApt for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyPackageRepositoriesAptNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyPackageRepositoriesApt(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyPackageRepositoriesAptSlice(c *Client, des, nw []GuestPolicyPackageRepositoriesApt) []GuestPolicyPackageRepositoriesApt { @@ -1651,23 +1669,26 @@ func canonicalizeNewGuestPolicyPackageRepositoriesYumSet(c *Client, des, nw []Gu if des == nil { return nw } - var reorderedNew []GuestPolicyPackageRepositoriesYum + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyPackageRepositoriesYum for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyPackageRepositoriesYumNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyPackageRepositoriesYum(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyPackageRepositoriesYumSlice(c *Client, des, nw []GuestPolicyPackageRepositoriesYum) []GuestPolicyPackageRepositoriesYum { @@ -1790,23 +1811,26 @@ func canonicalizeNewGuestPolicyPackageRepositoriesZypperSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []GuestPolicyPackageRepositoriesZypper + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyPackageRepositoriesZypper for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyPackageRepositoriesZypperNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyPackageRepositoriesZypper(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyPackageRepositoriesZypperSlice(c *Client, des, nw []GuestPolicyPackageRepositoriesZypper) []GuestPolicyPackageRepositoriesZypper { @@ -1913,23 +1937,26 @@ func canonicalizeNewGuestPolicyPackageRepositoriesGooSet(c *Client, des, nw []Gu if des == nil { return nw } - var reorderedNew []GuestPolicyPackageRepositoriesGoo + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyPackageRepositoriesGoo for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyPackageRepositoriesGooNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyPackageRepositoriesGoo(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyPackageRepositoriesGooSlice(c *Client, des, nw []GuestPolicyPackageRepositoriesGoo) []GuestPolicyPackageRepositoriesGoo { @@ -2068,23 +2095,26 @@ func canonicalizeNewGuestPolicyRecipesSet(c *Client, des, nw []GuestPolicyRecipe if des == nil { return nw } - var reorderedNew []GuestPolicyRecipes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesSlice(c *Client, des, nw []GuestPolicyRecipes) []GuestPolicyRecipes { @@ -2195,23 +2225,26 @@ func canonicalizeNewGuestPolicyRecipesArtifactsSet(c *Client, des, nw []GuestPol if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesArtifacts + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesArtifacts for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesArtifactsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesArtifacts(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesArtifactsSlice(c *Client, des, nw []GuestPolicyRecipesArtifacts) []GuestPolicyRecipesArtifacts { @@ -2318,23 +2351,26 @@ func canonicalizeNewGuestPolicyRecipesArtifactsRemoteSet(c *Client, des, nw []Gu if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesArtifactsRemote + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesArtifactsRemote for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesArtifactsRemoteNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesArtifactsRemote(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesArtifactsRemoteSlice(c *Client, des, nw []GuestPolicyRecipesArtifactsRemote) []GuestPolicyRecipesArtifactsRemote { @@ -2445,23 +2481,26 @@ func canonicalizeNewGuestPolicyRecipesArtifactsGcsSet(c *Client, des, nw []Guest if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesArtifactsGcs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesArtifactsGcs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesArtifactsGcsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesArtifactsGcs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesArtifactsGcsSlice(c *Client, des, nw []GuestPolicyRecipesArtifactsGcs) []GuestPolicyRecipesArtifactsGcs { @@ -2566,23 +2605,26 @@ func canonicalizeNewGuestPolicyRecipesInstallStepsSet(c *Client, des, nw []Guest if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesInstallSteps + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesInstallSteps for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesInstallStepsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesInstallSteps(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesInstallStepsSlice(c *Client, des, nw []GuestPolicyRecipesInstallSteps) []GuestPolicyRecipesInstallSteps { @@ -2705,23 +2747,26 @@ func canonicalizeNewGuestPolicyRecipesInstallStepsFileCopySet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesInstallStepsFileCopy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesInstallStepsFileCopy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesInstallStepsFileCopyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesInstallStepsFileCopy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesInstallStepsFileCopySlice(c *Client, des, nw []GuestPolicyRecipesInstallStepsFileCopy) []GuestPolicyRecipesInstallStepsFileCopy { @@ -2834,23 +2879,26 @@ func canonicalizeNewGuestPolicyRecipesInstallStepsArchiveExtractionSet(c *Client if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesInstallStepsArchiveExtraction + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesInstallStepsArchiveExtraction for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesInstallStepsArchiveExtractionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesInstallStepsArchiveExtraction(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesInstallStepsArchiveExtractionSlice(c *Client, des, nw []GuestPolicyRecipesInstallStepsArchiveExtraction) []GuestPolicyRecipesInstallStepsArchiveExtraction { @@ -2963,23 +3011,26 @@ func canonicalizeNewGuestPolicyRecipesInstallStepsMsiInstallationSet(c *Client, if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesInstallStepsMsiInstallation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesInstallStepsMsiInstallation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesInstallStepsMsiInstallationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesInstallStepsMsiInstallation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesInstallStepsMsiInstallationSlice(c *Client, des, nw []GuestPolicyRecipesInstallStepsMsiInstallation) []GuestPolicyRecipesInstallStepsMsiInstallation { @@ -3078,23 +3129,26 @@ func canonicalizeNewGuestPolicyRecipesInstallStepsDpkgInstallationSet(c *Client, if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesInstallStepsDpkgInstallation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesInstallStepsDpkgInstallation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesInstallStepsDpkgInstallationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesInstallStepsDpkgInstallation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesInstallStepsDpkgInstallationSlice(c *Client, des, nw []GuestPolicyRecipesInstallStepsDpkgInstallation) []GuestPolicyRecipesInstallStepsDpkgInstallation { @@ -3193,23 +3247,26 @@ func canonicalizeNewGuestPolicyRecipesInstallStepsRpmInstallationSet(c *Client, if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesInstallStepsRpmInstallation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesInstallStepsRpmInstallation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesInstallStepsRpmInstallationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesInstallStepsRpmInstallation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesInstallStepsRpmInstallationSlice(c *Client, des, nw []GuestPolicyRecipesInstallStepsRpmInstallation) []GuestPolicyRecipesInstallStepsRpmInstallation { @@ -3330,23 +3387,26 @@ func canonicalizeNewGuestPolicyRecipesInstallStepsFileExecSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesInstallStepsFileExec + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesInstallStepsFileExec for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesInstallStepsFileExecNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesInstallStepsFileExec(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesInstallStepsFileExecSlice(c *Client, des, nw []GuestPolicyRecipesInstallStepsFileExec) []GuestPolicyRecipesInstallStepsFileExec { @@ -3457,23 +3517,26 @@ func canonicalizeNewGuestPolicyRecipesInstallStepsScriptRunSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesInstallStepsScriptRun + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesInstallStepsScriptRun for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesInstallStepsScriptRunNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesInstallStepsScriptRun(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesInstallStepsScriptRunSlice(c *Client, des, nw []GuestPolicyRecipesInstallStepsScriptRun) []GuestPolicyRecipesInstallStepsScriptRun { @@ -3578,23 +3641,26 @@ func canonicalizeNewGuestPolicyRecipesUpdateStepsSet(c *Client, des, nw []GuestP if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesUpdateSteps + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesUpdateSteps for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesUpdateStepsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesUpdateSteps(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesUpdateStepsSlice(c *Client, des, nw []GuestPolicyRecipesUpdateSteps) []GuestPolicyRecipesUpdateSteps { @@ -3717,23 +3783,26 @@ func canonicalizeNewGuestPolicyRecipesUpdateStepsFileCopySet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesUpdateStepsFileCopy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesUpdateStepsFileCopy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesUpdateStepsFileCopyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesUpdateStepsFileCopy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesUpdateStepsFileCopySlice(c *Client, des, nw []GuestPolicyRecipesUpdateStepsFileCopy) []GuestPolicyRecipesUpdateStepsFileCopy { @@ -3846,23 +3915,26 @@ func canonicalizeNewGuestPolicyRecipesUpdateStepsArchiveExtractionSet(c *Client, if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesUpdateStepsArchiveExtraction + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesUpdateStepsArchiveExtraction for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesUpdateStepsArchiveExtractionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesUpdateStepsArchiveExtraction(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesUpdateStepsArchiveExtractionSlice(c *Client, des, nw []GuestPolicyRecipesUpdateStepsArchiveExtraction) []GuestPolicyRecipesUpdateStepsArchiveExtraction { @@ -3975,23 +4047,26 @@ func canonicalizeNewGuestPolicyRecipesUpdateStepsMsiInstallationSet(c *Client, d if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesUpdateStepsMsiInstallation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesUpdateStepsMsiInstallation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesUpdateStepsMsiInstallationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesUpdateStepsMsiInstallation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesUpdateStepsMsiInstallationSlice(c *Client, des, nw []GuestPolicyRecipesUpdateStepsMsiInstallation) []GuestPolicyRecipesUpdateStepsMsiInstallation { @@ -4090,23 +4165,26 @@ func canonicalizeNewGuestPolicyRecipesUpdateStepsDpkgInstallationSet(c *Client, if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesUpdateStepsDpkgInstallation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesUpdateStepsDpkgInstallation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesUpdateStepsDpkgInstallationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesUpdateStepsDpkgInstallation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesUpdateStepsDpkgInstallationSlice(c *Client, des, nw []GuestPolicyRecipesUpdateStepsDpkgInstallation) []GuestPolicyRecipesUpdateStepsDpkgInstallation { @@ -4205,23 +4283,26 @@ func canonicalizeNewGuestPolicyRecipesUpdateStepsRpmInstallationSet(c *Client, d if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesUpdateStepsRpmInstallation + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesUpdateStepsRpmInstallation for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesUpdateStepsRpmInstallationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesUpdateStepsRpmInstallation(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesUpdateStepsRpmInstallationSlice(c *Client, des, nw []GuestPolicyRecipesUpdateStepsRpmInstallation) []GuestPolicyRecipesUpdateStepsRpmInstallation { @@ -4342,23 +4423,26 @@ func canonicalizeNewGuestPolicyRecipesUpdateStepsFileExecSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesUpdateStepsFileExec + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesUpdateStepsFileExec for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesUpdateStepsFileExecNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesUpdateStepsFileExec(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesUpdateStepsFileExecSlice(c *Client, des, nw []GuestPolicyRecipesUpdateStepsFileExec) []GuestPolicyRecipesUpdateStepsFileExec { @@ -4469,23 +4553,26 @@ func canonicalizeNewGuestPolicyRecipesUpdateStepsScriptRunSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []GuestPolicyRecipesUpdateStepsScriptRun + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []GuestPolicyRecipesUpdateStepsScriptRun for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareGuestPolicyRecipesUpdateStepsScriptRunNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewGuestPolicyRecipesUpdateStepsScriptRun(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewGuestPolicyRecipesUpdateStepsScriptRunSlice(c *Client, des, nw []GuestPolicyRecipesUpdateStepsScriptRun) []GuestPolicyRecipesUpdateStepsScriptRun { diff --git a/services/google/osconfig/beta/os_policy_assignment_internal.go b/services/google/osconfig/beta/os_policy_assignment_internal.go index d34c029c6a..6852a61113 100755 --- a/services/google/osconfig/beta/os_policy_assignment_internal.go +++ b/services/google/osconfig/beta/os_policy_assignment_internal.go @@ -1091,23 +1091,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesSet(c *Client, des, nw []OSPolic if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPolicies + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPolicies for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPolicies(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesSlice(c *Client, des, nw []OSPolicyAssignmentOSPolicies) []OSPolicyAssignmentOSPolicies { @@ -1202,23 +1205,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsSet(c *Client, des if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroups + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroups for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroups(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroups) []OSPolicyAssignmentOSPoliciesResourceGroups { @@ -1325,23 +1331,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsInventoryFiltersSe if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsInventoryFilters + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsInventoryFilters for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsInventoryFiltersNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsInventoryFilters(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsInventoryFiltersSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsInventoryFilters) []OSPolicyAssignmentOSPoliciesResourceGroupsInventoryFilters { @@ -1488,23 +1497,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesSet(c *Cl if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResources + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResources for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResources(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResources) []OSPolicyAssignmentOSPoliciesResourceGroupsResources { @@ -1685,23 +1697,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgSet(c if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkg + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkg for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkg(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkg) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkg { @@ -1800,23 +1815,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgAptSet if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgApt + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgApt for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgAptNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgApt(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgAptSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgApt) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgApt { @@ -1917,23 +1935,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSet if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDeb + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDeb for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDeb(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDeb) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDeb { @@ -2074,23 +2095,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSou if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSource + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSource for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSource(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSource) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSource { @@ -2197,23 +2221,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSou if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceRemote + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceRemote for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceRemoteNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceRemote(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceRemoteSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceRemote) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceRemote { @@ -2326,23 +2353,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSou if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceGcs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceGcs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceGcsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceGcs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceGcsSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceGcs) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceGcs { @@ -2441,23 +2471,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgYumSet if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgYum + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgYum for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgYumNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgYum(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgYumSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgYum) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgYum { @@ -2556,23 +2589,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgZypper if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgZypper + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgZypper for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgZypperNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgZypper(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgZypperSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgZypper) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgZypper { @@ -2673,23 +2709,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSet if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpm + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpm for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpm(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpm) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpm { @@ -2830,23 +2869,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSou if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSource + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSource for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSource(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSource) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSource { @@ -2953,23 +2995,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSou if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceRemote + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceRemote for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceRemoteNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceRemote(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceRemoteSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceRemote) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceRemote { @@ -3082,23 +3127,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSou if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceGcs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceGcs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceGcsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceGcs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceGcsSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceGcs) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceGcs { @@ -3197,23 +3245,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgGooget if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgGooget + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgGooget for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgGoogetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgGooget(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgGoogetSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgGooget) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgGooget { @@ -3314,23 +3365,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSet if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsi + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsi for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsi(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsi) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsi { @@ -3471,23 +3525,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSou if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSource + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSource for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSource(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSource) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSource { @@ -3594,23 +3651,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSou if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceRemote + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceRemote for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceRemoteNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceRemote(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceRemoteSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceRemote) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceRemote { @@ -3723,23 +3783,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSou if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceGcs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceGcs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceGcsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceGcs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceGcsSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceGcs) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceGcs { @@ -3878,23 +3941,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositor if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepository + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepository for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepository(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositorySlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepository) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepository { @@ -4023,23 +4089,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositor if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryApt + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryApt for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryAptNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryApt(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryAptSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryApt) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryApt { @@ -4162,23 +4231,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositor if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryYum + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryYum for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryYumNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryYum(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryYumSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryYum) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryYum { @@ -4301,23 +4373,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositor if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryZypper + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryZypper for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryZypperNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryZypper(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryZypperSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryZypper) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryZypper { @@ -4424,23 +4499,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositor if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryGoo + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryGoo for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryGooNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryGoo(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryGooSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryGoo) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryGoo { @@ -4535,23 +4613,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecSet(c if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExec + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExec for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExec(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExec) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExec { @@ -4694,23 +4775,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValid if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidate + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidate for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidate(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidate) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidate { @@ -4851,23 +4935,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValid if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFile + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFile for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFile(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFile) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFile { @@ -4974,23 +5061,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValid if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileRemote + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileRemote for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileRemoteNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileRemote(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileRemoteSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileRemote) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileRemote { @@ -5103,23 +5193,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValid if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileGcs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileGcs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileGcsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileGcs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileGcsSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileGcs) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileGcs { @@ -5262,23 +5355,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnfor if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforce + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforce for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforce(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforce) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforce { @@ -5419,23 +5515,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnfor if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFile + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFile for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFile(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFile) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFile { @@ -5542,23 +5641,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnfor if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileRemote + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileRemote for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileRemoteNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileRemote(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileRemoteSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileRemote) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileRemote { @@ -5671,23 +5773,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnfor if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileGcs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileGcs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileGcsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileGcs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileGcsSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileGcs) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileGcs { @@ -5825,23 +5930,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileSet(c if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFile + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFile for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFile(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFile) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFile { @@ -5982,23 +6090,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileS if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFile + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFile for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFile(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFile) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFile { @@ -6105,23 +6216,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileR if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileRemote + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileRemote for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileRemoteNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileRemote(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileRemoteSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileRemote) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileRemote { @@ -6234,23 +6348,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileG if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileGcs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileGcs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileGcsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileGcs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileGcsSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileGcs) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileGcs { @@ -6355,23 +6472,26 @@ func canonicalizeNewOSPolicyAssignmentInstanceFilterSet(c *Client, des, nw []OSP if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentInstanceFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentInstanceFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentInstanceFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentInstanceFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentInstanceFilterSlice(c *Client, des, nw []OSPolicyAssignmentInstanceFilter) []OSPolicyAssignmentInstanceFilter { @@ -6467,23 +6587,26 @@ func canonicalizeNewOSPolicyAssignmentInstanceFilterInclusionLabelsSet(c *Client if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentInstanceFilterInclusionLabels + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentInstanceFilterInclusionLabels for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentInstanceFilterInclusionLabelsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentInstanceFilterInclusionLabels(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentInstanceFilterInclusionLabelsSlice(c *Client, des, nw []OSPolicyAssignmentInstanceFilterInclusionLabels) []OSPolicyAssignmentInstanceFilterInclusionLabels { @@ -6579,23 +6702,26 @@ func canonicalizeNewOSPolicyAssignmentInstanceFilterExclusionLabelsSet(c *Client if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentInstanceFilterExclusionLabels + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentInstanceFilterExclusionLabels for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentInstanceFilterExclusionLabelsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentInstanceFilterExclusionLabels(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentInstanceFilterExclusionLabelsSlice(c *Client, des, nw []OSPolicyAssignmentInstanceFilterExclusionLabels) []OSPolicyAssignmentInstanceFilterExclusionLabels { @@ -6702,23 +6828,26 @@ func canonicalizeNewOSPolicyAssignmentInstanceFilterInventoriesSet(c *Client, de if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentInstanceFilterInventories + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentInstanceFilterInventories for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentInstanceFilterInventoriesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentInstanceFilterInventories(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentInstanceFilterInventoriesSlice(c *Client, des, nw []OSPolicyAssignmentInstanceFilterInventories) []OSPolicyAssignmentInstanceFilterInventories { @@ -6819,23 +6948,26 @@ func canonicalizeNewOSPolicyAssignmentRolloutSet(c *Client, des, nw []OSPolicyAs if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentRollout + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentRollout for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentRolloutNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentRollout(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentRolloutSlice(c *Client, des, nw []OSPolicyAssignmentRollout) []OSPolicyAssignmentRollout { @@ -6957,23 +7089,26 @@ func canonicalizeNewOSPolicyAssignmentRolloutDisruptionBudgetSet(c *Client, des, if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentRolloutDisruptionBudget + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentRolloutDisruptionBudget for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentRolloutDisruptionBudgetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentRolloutDisruptionBudget(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentRolloutDisruptionBudgetSlice(c *Client, des, nw []OSPolicyAssignmentRolloutDisruptionBudget) []OSPolicyAssignmentRolloutDisruptionBudget { diff --git a/services/google/osconfig/os_policy_assignment_internal.go b/services/google/osconfig/os_policy_assignment_internal.go index 84ff207f30..2f8e8d2980 100755 --- a/services/google/osconfig/os_policy_assignment_internal.go +++ b/services/google/osconfig/os_policy_assignment_internal.go @@ -1091,23 +1091,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesSet(c *Client, des, nw []OSPolic if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPolicies + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPolicies for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPolicies(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesSlice(c *Client, des, nw []OSPolicyAssignmentOSPolicies) []OSPolicyAssignmentOSPolicies { @@ -1202,23 +1205,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsSet(c *Client, des if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroups + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroups for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroups(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroups) []OSPolicyAssignmentOSPoliciesResourceGroups { @@ -1325,23 +1331,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsInventoryFiltersSe if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsInventoryFilters + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsInventoryFilters for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsInventoryFiltersNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsInventoryFilters(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsInventoryFiltersSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsInventoryFilters) []OSPolicyAssignmentOSPoliciesResourceGroupsInventoryFilters { @@ -1488,23 +1497,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesSet(c *Cl if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResources + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResources for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResources(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResources) []OSPolicyAssignmentOSPoliciesResourceGroupsResources { @@ -1685,23 +1697,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgSet(c if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkg + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkg for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkg(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkg) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkg { @@ -1800,23 +1815,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgAptSet if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgApt + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgApt for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgAptNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgApt(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgAptSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgApt) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgApt { @@ -1917,23 +1935,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSet if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDeb + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDeb for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDeb(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDeb) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDeb { @@ -2074,23 +2095,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSou if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSource + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSource for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSource(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSource) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSource { @@ -2197,23 +2221,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSou if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceRemote + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceRemote for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceRemoteNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceRemote(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceRemoteSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceRemote) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceRemote { @@ -2326,23 +2353,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSou if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceGcs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceGcs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceGcsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceGcs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceGcsSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceGcs) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgDebSourceGcs { @@ -2441,23 +2471,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgYumSet if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgYum + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgYum for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgYumNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgYum(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgYumSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgYum) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgYum { @@ -2556,23 +2589,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgZypper if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgZypper + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgZypper for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgZypperNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgZypper(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgZypperSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgZypper) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgZypper { @@ -2673,23 +2709,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSet if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpm + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpm for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpm(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpm) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpm { @@ -2830,23 +2869,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSou if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSource + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSource for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSource(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSource) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSource { @@ -2953,23 +2995,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSou if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceRemote + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceRemote for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceRemoteNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceRemote(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceRemoteSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceRemote) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceRemote { @@ -3082,23 +3127,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSou if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceGcs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceGcs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceGcsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceGcs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceGcsSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceGcs) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgRpmSourceGcs { @@ -3197,23 +3245,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgGooget if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgGooget + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgGooget for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgGoogetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgGooget(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgGoogetSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgGooget) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgGooget { @@ -3314,23 +3365,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSet if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsi + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsi for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsi(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsi) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsi { @@ -3471,23 +3525,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSou if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSource + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSource for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSource(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSource) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSource { @@ -3594,23 +3651,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSou if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceRemote + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceRemote for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceRemoteNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceRemote(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceRemoteSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceRemote) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceRemote { @@ -3723,23 +3783,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSou if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceGcs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceGcs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceGcsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceGcs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceGcsSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceGcs) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesPkgMsiSourceGcs { @@ -3878,23 +3941,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositor if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepository + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepository for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepository(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositorySlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepository) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepository { @@ -4023,23 +4089,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositor if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryApt + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryApt for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryAptNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryApt(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryAptSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryApt) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryApt { @@ -4162,23 +4231,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositor if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryYum + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryYum for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryYumNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryYum(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryYumSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryYum) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryYum { @@ -4301,23 +4373,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositor if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryZypper + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryZypper for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryZypperNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryZypper(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryZypperSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryZypper) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryZypper { @@ -4424,23 +4499,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositor if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryGoo + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryGoo for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryGooNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryGoo(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryGooSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryGoo) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesRepositoryGoo { @@ -4535,23 +4613,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecSet(c if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExec + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExec for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExec(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExec) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExec { @@ -4694,23 +4775,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValid if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidate + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidate for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidate(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidate) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidate { @@ -4851,23 +4935,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValid if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFile + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFile for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFile(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFile) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFile { @@ -4974,23 +5061,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValid if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileRemote + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileRemote for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileRemoteNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileRemote(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileRemoteSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileRemote) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileRemote { @@ -5103,23 +5193,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValid if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileGcs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileGcs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileGcsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileGcs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileGcsSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileGcs) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecValidateFileGcs { @@ -5262,23 +5355,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnfor if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforce + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforce for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforce(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforce) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforce { @@ -5419,23 +5515,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnfor if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFile + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFile for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFile(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFile) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFile { @@ -5542,23 +5641,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnfor if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileRemote + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileRemote for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileRemoteNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileRemote(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileRemoteSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileRemote) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileRemote { @@ -5671,23 +5773,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnfor if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileGcs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileGcs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileGcsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileGcs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileGcsSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileGcs) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesExecEnforceFileGcs { @@ -5825,23 +5930,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileSet(c if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFile + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFile for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFile(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFile) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFile { @@ -5982,23 +6090,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileS if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFile + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFile for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFile(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFile) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFile { @@ -6105,23 +6216,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileR if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileRemote + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileRemote for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileRemoteNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileRemote(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileRemoteSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileRemote) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileRemote { @@ -6234,23 +6348,26 @@ func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileG if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileGcs + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileGcs for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileGcsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileGcs(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileGcsSlice(c *Client, des, nw []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileGcs) []OSPolicyAssignmentOSPoliciesResourceGroupsResourcesFileFileGcs { @@ -6355,23 +6472,26 @@ func canonicalizeNewOSPolicyAssignmentInstanceFilterSet(c *Client, des, nw []OSP if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentInstanceFilter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentInstanceFilter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentInstanceFilterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentInstanceFilter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentInstanceFilterSlice(c *Client, des, nw []OSPolicyAssignmentInstanceFilter) []OSPolicyAssignmentInstanceFilter { @@ -6467,23 +6587,26 @@ func canonicalizeNewOSPolicyAssignmentInstanceFilterInclusionLabelsSet(c *Client if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentInstanceFilterInclusionLabels + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentInstanceFilterInclusionLabels for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentInstanceFilterInclusionLabelsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentInstanceFilterInclusionLabels(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentInstanceFilterInclusionLabelsSlice(c *Client, des, nw []OSPolicyAssignmentInstanceFilterInclusionLabels) []OSPolicyAssignmentInstanceFilterInclusionLabels { @@ -6579,23 +6702,26 @@ func canonicalizeNewOSPolicyAssignmentInstanceFilterExclusionLabelsSet(c *Client if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentInstanceFilterExclusionLabels + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentInstanceFilterExclusionLabels for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentInstanceFilterExclusionLabelsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentInstanceFilterExclusionLabels(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentInstanceFilterExclusionLabelsSlice(c *Client, des, nw []OSPolicyAssignmentInstanceFilterExclusionLabels) []OSPolicyAssignmentInstanceFilterExclusionLabels { @@ -6702,23 +6828,26 @@ func canonicalizeNewOSPolicyAssignmentInstanceFilterInventoriesSet(c *Client, de if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentInstanceFilterInventories + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentInstanceFilterInventories for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentInstanceFilterInventoriesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentInstanceFilterInventories(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentInstanceFilterInventoriesSlice(c *Client, des, nw []OSPolicyAssignmentInstanceFilterInventories) []OSPolicyAssignmentInstanceFilterInventories { @@ -6819,23 +6948,26 @@ func canonicalizeNewOSPolicyAssignmentRolloutSet(c *Client, des, nw []OSPolicyAs if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentRollout + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentRollout for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentRolloutNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentRollout(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentRolloutSlice(c *Client, des, nw []OSPolicyAssignmentRollout) []OSPolicyAssignmentRollout { @@ -6957,23 +7089,26 @@ func canonicalizeNewOSPolicyAssignmentRolloutDisruptionBudgetSet(c *Client, des, if des == nil { return nw } - var reorderedNew []OSPolicyAssignmentRolloutDisruptionBudget + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []OSPolicyAssignmentRolloutDisruptionBudget for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareOSPolicyAssignmentRolloutDisruptionBudgetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewOSPolicyAssignmentRolloutDisruptionBudget(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewOSPolicyAssignmentRolloutDisruptionBudgetSlice(c *Client, des, nw []OSPolicyAssignmentRolloutDisruptionBudget) []OSPolicyAssignmentRolloutDisruptionBudget { diff --git a/services/google/privateca/alpha/ca_pool_internal.go b/services/google/privateca/alpha/ca_pool_internal.go index e25d7ce178..7f7ca94da7 100755 --- a/services/google/privateca/alpha/ca_pool_internal.go +++ b/services/google/privateca/alpha/ca_pool_internal.go @@ -762,23 +762,26 @@ func canonicalizeNewCaPoolIssuancePolicySet(c *Client, des, nw []CaPoolIssuanceP if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicySlice(c *Client, des, nw []CaPoolIssuancePolicy) []CaPoolIssuancePolicy { @@ -893,23 +896,26 @@ func canonicalizeNewCaPoolIssuancePolicyAllowedKeyTypesSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyAllowedKeyTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyAllowedKeyTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyAllowedKeyTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyAllowedKeyTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyAllowedKeyTypesSlice(c *Client, des, nw []CaPoolIssuancePolicyAllowedKeyTypes) []CaPoolIssuancePolicyAllowedKeyTypes { @@ -1011,23 +1017,26 @@ func canonicalizeNewCaPoolIssuancePolicyAllowedKeyTypesRsaSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyAllowedKeyTypesRsa + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyAllowedKeyTypesRsa for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyAllowedKeyTypesRsaNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyAllowedKeyTypesRsa(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyAllowedKeyTypesRsaSlice(c *Client, des, nw []CaPoolIssuancePolicyAllowedKeyTypesRsa) []CaPoolIssuancePolicyAllowedKeyTypesRsa { @@ -1123,23 +1132,26 @@ func canonicalizeNewCaPoolIssuancePolicyAllowedKeyTypesEllipticCurveSet(c *Clien if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyAllowedKeyTypesEllipticCurve + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyAllowedKeyTypesEllipticCurve for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyAllowedKeyTypesEllipticCurveNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyAllowedKeyTypesEllipticCurve(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyAllowedKeyTypesEllipticCurveSlice(c *Client, des, nw []CaPoolIssuancePolicyAllowedKeyTypesEllipticCurve) []CaPoolIssuancePolicyAllowedKeyTypesEllipticCurve { @@ -1246,23 +1258,26 @@ func canonicalizeNewCaPoolIssuancePolicyAllowedIssuanceModesSet(c *Client, des, if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyAllowedIssuanceModes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyAllowedIssuanceModes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyAllowedIssuanceModesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyAllowedIssuanceModes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyAllowedIssuanceModesSlice(c *Client, des, nw []CaPoolIssuancePolicyAllowedIssuanceModes) []CaPoolIssuancePolicyAllowedIssuanceModes { @@ -1369,23 +1384,26 @@ func canonicalizeNewCaPoolIssuancePolicyBaselineValuesSet(c *Client, des, nw []C if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyBaselineValues + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyBaselineValues for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyBaselineValuesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyBaselineValues(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyBaselineValuesSlice(c *Client, des, nw []CaPoolIssuancePolicyBaselineValues) []CaPoolIssuancePolicyBaselineValues { @@ -1482,23 +1500,26 @@ func canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsageSet(c *Client, des if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyBaselineValuesKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyBaselineValuesKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyBaselineValuesKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsageSlice(c *Client, des, nw []CaPoolIssuancePolicyBaselineValuesKeyUsage) []CaPoolIssuancePolicyBaselineValuesKeyUsage { @@ -1661,23 +1682,26 @@ func canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsageBaseKeyUsageSet(c if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyBaselineValuesKeyUsageBaseKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyBaselineValuesKeyUsageBaseKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyBaselineValuesKeyUsageBaseKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsageBaseKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsageBaseKeyUsageSlice(c *Client, des, nw []CaPoolIssuancePolicyBaselineValuesKeyUsageBaseKeyUsage) []CaPoolIssuancePolicyBaselineValuesKeyUsageBaseKeyUsage { @@ -1816,23 +1840,26 @@ func canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsageExtendedKeyUsageSe if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyBaselineValuesKeyUsageExtendedKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyBaselineValuesKeyUsageExtendedKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyBaselineValuesKeyUsageExtendedKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsageExtendedKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsageExtendedKeyUsageSlice(c *Client, des, nw []CaPoolIssuancePolicyBaselineValuesKeyUsageExtendedKeyUsage) []CaPoolIssuancePolicyBaselineValuesKeyUsageExtendedKeyUsage { @@ -1928,23 +1955,26 @@ func canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsageUnknownExtendedKey if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyBaselineValuesKeyUsageUnknownExtendedKeyUsages + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyBaselineValuesKeyUsageUnknownExtendedKeyUsages for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyBaselineValuesKeyUsageUnknownExtendedKeyUsagesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsageUnknownExtendedKeyUsages(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsageUnknownExtendedKeyUsagesSlice(c *Client, des, nw []CaPoolIssuancePolicyBaselineValuesKeyUsageUnknownExtendedKeyUsages) []CaPoolIssuancePolicyBaselineValuesKeyUsageUnknownExtendedKeyUsages { @@ -2049,23 +2079,26 @@ func canonicalizeNewCaPoolIssuancePolicyBaselineValuesCaOptionsSet(c *Client, de if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyBaselineValuesCaOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyBaselineValuesCaOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyBaselineValuesCaOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyBaselineValuesCaOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyBaselineValuesCaOptionsSlice(c *Client, des, nw []CaPoolIssuancePolicyBaselineValuesCaOptions) []CaPoolIssuancePolicyBaselineValuesCaOptions { @@ -2161,23 +2194,26 @@ func canonicalizeNewCaPoolIssuancePolicyBaselineValuesPolicyIdsSet(c *Client, de if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyBaselineValuesPolicyIds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyBaselineValuesPolicyIds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyBaselineValuesPolicyIdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyBaselineValuesPolicyIds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyBaselineValuesPolicyIdsSlice(c *Client, des, nw []CaPoolIssuancePolicyBaselineValuesPolicyIds) []CaPoolIssuancePolicyBaselineValuesPolicyIds { @@ -2286,23 +2322,26 @@ func canonicalizeNewCaPoolIssuancePolicyBaselineValuesAdditionalExtensionsSet(c if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyBaselineValuesAdditionalExtensions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyBaselineValuesAdditionalExtensions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyBaselineValuesAdditionalExtensionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyBaselineValuesAdditionalExtensions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyBaselineValuesAdditionalExtensionsSlice(c *Client, des, nw []CaPoolIssuancePolicyBaselineValuesAdditionalExtensions) []CaPoolIssuancePolicyBaselineValuesAdditionalExtensions { @@ -2398,23 +2437,26 @@ func canonicalizeNewCaPoolIssuancePolicyBaselineValuesAdditionalExtensionsObject if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyBaselineValuesAdditionalExtensionsObjectId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyBaselineValuesAdditionalExtensionsObjectId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyBaselineValuesAdditionalExtensionsObjectIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyBaselineValuesAdditionalExtensionsObjectId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyBaselineValuesAdditionalExtensionsObjectIdSlice(c *Client, des, nw []CaPoolIssuancePolicyBaselineValuesAdditionalExtensionsObjectId) []CaPoolIssuancePolicyBaselineValuesAdditionalExtensionsObjectId { @@ -2523,23 +2565,26 @@ func canonicalizeNewCaPoolIssuancePolicyIdentityConstraintsSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyIdentityConstraints + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyIdentityConstraints for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyIdentityConstraintsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyIdentityConstraints(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyIdentityConstraintsSlice(c *Client, des, nw []CaPoolIssuancePolicyIdentityConstraints) []CaPoolIssuancePolicyIdentityConstraints { @@ -2662,23 +2707,26 @@ func canonicalizeNewCaPoolIssuancePolicyIdentityConstraintsCelExpressionSet(c *C if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyIdentityConstraintsCelExpression + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyIdentityConstraintsCelExpression for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyIdentityConstraintsCelExpressionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyIdentityConstraintsCelExpression(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyIdentityConstraintsCelExpressionSlice(c *Client, des, nw []CaPoolIssuancePolicyIdentityConstraintsCelExpression) []CaPoolIssuancePolicyIdentityConstraintsCelExpression { @@ -2777,23 +2825,26 @@ func canonicalizeNewCaPoolIssuancePolicyPassthroughExtensionsSet(c *Client, des, if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyPassthroughExtensions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyPassthroughExtensions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyPassthroughExtensionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyPassthroughExtensions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyPassthroughExtensionsSlice(c *Client, des, nw []CaPoolIssuancePolicyPassthroughExtensions) []CaPoolIssuancePolicyPassthroughExtensions { @@ -2889,23 +2940,26 @@ func canonicalizeNewCaPoolIssuancePolicyPassthroughExtensionsAdditionalExtension if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyPassthroughExtensionsAdditionalExtensions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyPassthroughExtensionsAdditionalExtensions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyPassthroughExtensionsAdditionalExtensionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyPassthroughExtensionsAdditionalExtensions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyPassthroughExtensionsAdditionalExtensionsSlice(c *Client, des, nw []CaPoolIssuancePolicyPassthroughExtensionsAdditionalExtensions) []CaPoolIssuancePolicyPassthroughExtensionsAdditionalExtensions { @@ -3012,23 +3066,26 @@ func canonicalizeNewCaPoolPublishingOptionsSet(c *Client, des, nw []CaPoolPublis if des == nil { return nw } - var reorderedNew []CaPoolPublishingOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolPublishingOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolPublishingOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolPublishingOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolPublishingOptionsSlice(c *Client, des, nw []CaPoolPublishingOptions) []CaPoolPublishingOptions { diff --git a/services/google/privateca/alpha/certificate_authority_internal.go b/services/google/privateca/alpha/certificate_authority_internal.go index 92e7dbb418..4da8747f6c 100755 --- a/services/google/privateca/alpha/certificate_authority_internal.go +++ b/services/google/privateca/alpha/certificate_authority_internal.go @@ -1027,23 +1027,26 @@ func canonicalizeNewCertificateAuthorityConfigSet(c *Client, des, nw []Certifica if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigSlice(c *Client, des, nw []CertificateAuthorityConfig) []CertificateAuthorityConfig { @@ -1138,23 +1141,26 @@ func canonicalizeNewCertificateAuthorityConfigSubjectConfigSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigSubjectConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigSubjectConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigSubjectConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigSubjectConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigSubjectConfigSlice(c *Client, des, nw []CertificateAuthorityConfigSubjectConfig) []CertificateAuthorityConfigSubjectConfig { @@ -1309,23 +1315,26 @@ func canonicalizeNewCertificateAuthorityConfigSubjectConfigSubjectSet(c *Client, if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigSubjectConfigSubject + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigSubjectConfigSubject for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigSubjectConfigSubjectNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigSubjectConfigSubject(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigSubjectConfigSubjectSlice(c *Client, des, nw []CertificateAuthorityConfigSubjectConfigSubject) []CertificateAuthorityConfigSubjectConfigSubject { @@ -1450,23 +1459,26 @@ func canonicalizeNewCertificateAuthorityConfigSubjectConfigSubjectAltNameSet(c * if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigSubjectConfigSubjectAltName + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigSubjectConfigSubjectAltName for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigSubjectConfigSubjectAltNameNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigSubjectConfigSubjectAltName(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigSubjectConfigSubjectAltNameSlice(c *Client, des, nw []CertificateAuthorityConfigSubjectConfigSubjectAltName) []CertificateAuthorityConfigSubjectConfigSubjectAltName { @@ -1575,23 +1587,26 @@ func canonicalizeNewCertificateAuthorityConfigSubjectConfigSubjectAltNameCustomS if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSans + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSans for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSansNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSans(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSansSlice(c *Client, des, nw []CertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSans) []CertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSans { @@ -1687,23 +1702,26 @@ func canonicalizeNewCertificateAuthorityConfigSubjectConfigSubjectAltNameCustomS if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSansObjectId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSansObjectId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSansObjectIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSansObjectId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSansObjectIdSlice(c *Client, des, nw []CertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSansObjectId) []CertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSansObjectId { @@ -1805,23 +1823,26 @@ func canonicalizeNewCertificateAuthorityConfigX509ConfigSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigX509Config + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigX509Config for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigX509ConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigX509Config(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigX509ConfigSlice(c *Client, des, nw []CertificateAuthorityConfigX509Config) []CertificateAuthorityConfigX509Config { @@ -1918,23 +1939,26 @@ func canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsageSet(c *Client, d if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigX509ConfigKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigX509ConfigKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigX509ConfigKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsageSlice(c *Client, des, nw []CertificateAuthorityConfigX509ConfigKeyUsage) []CertificateAuthorityConfigX509ConfigKeyUsage { @@ -2097,23 +2121,26 @@ func canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsageBaseKeyUsageSet( if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigX509ConfigKeyUsageBaseKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigX509ConfigKeyUsageBaseKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigX509ConfigKeyUsageBaseKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsageBaseKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsageBaseKeyUsageSlice(c *Client, des, nw []CertificateAuthorityConfigX509ConfigKeyUsageBaseKeyUsage) []CertificateAuthorityConfigX509ConfigKeyUsageBaseKeyUsage { @@ -2252,23 +2279,26 @@ func canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsageExtendedKeyUsage if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigX509ConfigKeyUsageExtendedKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigX509ConfigKeyUsageExtendedKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigX509ConfigKeyUsageExtendedKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsageExtendedKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsageExtendedKeyUsageSlice(c *Client, des, nw []CertificateAuthorityConfigX509ConfigKeyUsageExtendedKeyUsage) []CertificateAuthorityConfigX509ConfigKeyUsageExtendedKeyUsage { @@ -2364,23 +2394,26 @@ func canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsageUnknownExtendedK if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigX509ConfigKeyUsageUnknownExtendedKeyUsages + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigX509ConfigKeyUsageUnknownExtendedKeyUsages for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigX509ConfigKeyUsageUnknownExtendedKeyUsagesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsageUnknownExtendedKeyUsages(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsageUnknownExtendedKeyUsagesSlice(c *Client, des, nw []CertificateAuthorityConfigX509ConfigKeyUsageUnknownExtendedKeyUsages) []CertificateAuthorityConfigX509ConfigKeyUsageUnknownExtendedKeyUsages { @@ -2485,23 +2518,26 @@ func canonicalizeNewCertificateAuthorityConfigX509ConfigCaOptionsSet(c *Client, if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigX509ConfigCaOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigX509ConfigCaOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigX509ConfigCaOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigX509ConfigCaOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigX509ConfigCaOptionsSlice(c *Client, des, nw []CertificateAuthorityConfigX509ConfigCaOptions) []CertificateAuthorityConfigX509ConfigCaOptions { @@ -2597,23 +2633,26 @@ func canonicalizeNewCertificateAuthorityConfigX509ConfigPolicyIdsSet(c *Client, if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigX509ConfigPolicyIds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigX509ConfigPolicyIds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigX509ConfigPolicyIdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigX509ConfigPolicyIds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigX509ConfigPolicyIdsSlice(c *Client, des, nw []CertificateAuthorityConfigX509ConfigPolicyIds) []CertificateAuthorityConfigX509ConfigPolicyIds { @@ -2722,23 +2761,26 @@ func canonicalizeNewCertificateAuthorityConfigX509ConfigAdditionalExtensionsSet( if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigX509ConfigAdditionalExtensions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigX509ConfigAdditionalExtensions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigX509ConfigAdditionalExtensionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigX509ConfigAdditionalExtensions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigX509ConfigAdditionalExtensionsSlice(c *Client, des, nw []CertificateAuthorityConfigX509ConfigAdditionalExtensions) []CertificateAuthorityConfigX509ConfigAdditionalExtensions { @@ -2834,23 +2876,26 @@ func canonicalizeNewCertificateAuthorityConfigX509ConfigAdditionalExtensionsObje if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigX509ConfigAdditionalExtensionsObjectId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigX509ConfigAdditionalExtensionsObjectId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigX509ConfigAdditionalExtensionsObjectIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigX509ConfigAdditionalExtensionsObjectId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigX509ConfigAdditionalExtensionsObjectIdSlice(c *Client, des, nw []CertificateAuthorityConfigX509ConfigAdditionalExtensionsObjectId) []CertificateAuthorityConfigX509ConfigAdditionalExtensionsObjectId { @@ -2955,23 +3000,26 @@ func canonicalizeNewCertificateAuthorityConfigPublicKeySet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigPublicKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigPublicKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigPublicKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigPublicKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigPublicKeySlice(c *Client, des, nw []CertificateAuthorityConfigPublicKey) []CertificateAuthorityConfigPublicKey { @@ -3093,23 +3141,26 @@ func canonicalizeNewCertificateAuthorityKeySpecSet(c *Client, des, nw []Certific if des == nil { return nw } - var reorderedNew []CertificateAuthorityKeySpec + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityKeySpec for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityKeySpecNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityKeySpec(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityKeySpecSlice(c *Client, des, nw []CertificateAuthorityKeySpec) []CertificateAuthorityKeySpec { @@ -3228,23 +3279,26 @@ func canonicalizeNewCertificateAuthoritySubordinateConfigSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []CertificateAuthoritySubordinateConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthoritySubordinateConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthoritySubordinateConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthoritySubordinateConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthoritySubordinateConfigSlice(c *Client, des, nw []CertificateAuthoritySubordinateConfig) []CertificateAuthoritySubordinateConfig { @@ -3343,23 +3397,26 @@ func canonicalizeNewCertificateAuthoritySubordinateConfigPemIssuerChainSet(c *Cl if des == nil { return nw } - var reorderedNew []CertificateAuthoritySubordinateConfigPemIssuerChain + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthoritySubordinateConfigPemIssuerChain for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthoritySubordinateConfigPemIssuerChainNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthoritySubordinateConfigPemIssuerChain(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthoritySubordinateConfigPemIssuerChainSlice(c *Client, des, nw []CertificateAuthoritySubordinateConfigPemIssuerChain) []CertificateAuthoritySubordinateConfigPemIssuerChain { @@ -3478,23 +3535,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSet(c *Client, if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptions) []CertificateAuthorityCaCertificateDescriptions { @@ -3617,23 +3677,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescript if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsSubjectDescription + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsSubjectDescription for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescription(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsSubjectDescription) []CertificateAuthorityCaCertificateDescriptionsSubjectDescription { @@ -3788,23 +3851,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescript if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubject + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubject for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubject(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubject) []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubject { @@ -3929,23 +3995,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescript if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltName + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltName for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltName(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltName) []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltName { @@ -4054,23 +4123,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescript if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSans + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSans for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSansNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSans(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSansSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSans) []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSans { @@ -4166,23 +4238,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescript if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSansObjectId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSansObjectId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSansObjectIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSansObjectId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSansObjectIdSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSansObjectId) []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSansObjectId { @@ -4284,23 +4359,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509Description if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsX509Description + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsX509Description for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsX509DescriptionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509Description(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsX509Description) []CertificateAuthorityCaCertificateDescriptionsX509Description { @@ -4397,23 +4475,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509Description if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsage) []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsage { @@ -4576,23 +4657,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509Description if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageBaseKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageBaseKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageBaseKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageBaseKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageBaseKeyUsageSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageBaseKeyUsage) []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageBaseKeyUsage { @@ -4731,23 +4815,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509Description if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageExtendedKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageExtendedKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageExtendedKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageExtendedKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageExtendedKeyUsageSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageExtendedKeyUsage) []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageExtendedKeyUsage { @@ -4843,23 +4930,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509Description if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageUnknownExtendedKeyUsages + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageUnknownExtendedKeyUsages for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageUnknownExtendedKeyUsagesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageUnknownExtendedKeyUsages(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageUnknownExtendedKeyUsagesSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageUnknownExtendedKeyUsages) []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageUnknownExtendedKeyUsages { @@ -4964,23 +5054,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509Description if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsX509DescriptionCaOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsX509DescriptionCaOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsX509DescriptionCaOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionCaOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionCaOptionsSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsX509DescriptionCaOptions) []CertificateAuthorityCaCertificateDescriptionsX509DescriptionCaOptions { @@ -5076,23 +5169,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509Description if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsX509DescriptionPolicyIds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsX509DescriptionPolicyIds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsX509DescriptionPolicyIdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionPolicyIds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionPolicyIdsSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsX509DescriptionPolicyIds) []CertificateAuthorityCaCertificateDescriptionsX509DescriptionPolicyIds { @@ -5201,23 +5297,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509Description if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensionsSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensions) []CertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensions { @@ -5313,23 +5412,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509Description if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensionsObjectId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensionsObjectId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensionsObjectIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensionsObjectId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensionsObjectIdSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensionsObjectId) []CertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensionsObjectId { @@ -5434,23 +5536,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsPublicKeySet(c if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsPublicKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsPublicKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsPublicKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsPublicKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsPublicKeySlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsPublicKey) []CertificateAuthorityCaCertificateDescriptionsPublicKey { @@ -5549,23 +5654,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectKeyIdSet if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsSubjectKeyId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsSubjectKeyId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsSubjectKeyIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectKeyId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectKeyIdSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsSubjectKeyId) []CertificateAuthorityCaCertificateDescriptionsSubjectKeyId { @@ -5664,23 +5772,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsAuthorityKeyIdS if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsAuthorityKeyId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsAuthorityKeyId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsAuthorityKeyIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsAuthorityKeyId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsAuthorityKeyIdSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsAuthorityKeyId) []CertificateAuthorityCaCertificateDescriptionsAuthorityKeyId { @@ -5779,23 +5890,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsCertFingerprint if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsCertFingerprint + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsCertFingerprint for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsCertFingerprintNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsCertFingerprint(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsCertFingerprintSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsCertFingerprint) []CertificateAuthorityCaCertificateDescriptionsCertFingerprint { @@ -5902,23 +6016,26 @@ func canonicalizeNewCertificateAuthorityAccessUrlsSet(c *Client, des, nw []Certi if des == nil { return nw } - var reorderedNew []CertificateAuthorityAccessUrls + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityAccessUrls for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityAccessUrlsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityAccessUrls(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityAccessUrlsSlice(c *Client, des, nw []CertificateAuthorityAccessUrls) []CertificateAuthorityAccessUrls { diff --git a/services/google/privateca/alpha/certificate_internal.go b/services/google/privateca/alpha/certificate_internal.go index e46bd5df6d..30c4e8fd0f 100755 --- a/services/google/privateca/alpha/certificate_internal.go +++ b/services/google/privateca/alpha/certificate_internal.go @@ -938,23 +938,26 @@ func canonicalizeNewCertificateConfigSet(c *Client, des, nw []CertificateConfig) if des == nil { return nw } - var reorderedNew []CertificateConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigSlice(c *Client, des, nw []CertificateConfig) []CertificateConfig { @@ -1049,23 +1052,26 @@ func canonicalizeNewCertificateConfigSubjectConfigSet(c *Client, des, nw []Certi if des == nil { return nw } - var reorderedNew []CertificateConfigSubjectConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigSubjectConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigSubjectConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigSubjectConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigSubjectConfigSlice(c *Client, des, nw []CertificateConfigSubjectConfig) []CertificateConfigSubjectConfig { @@ -1220,23 +1226,26 @@ func canonicalizeNewCertificateConfigSubjectConfigSubjectSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []CertificateConfigSubjectConfigSubject + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigSubjectConfigSubject for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigSubjectConfigSubjectNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigSubjectConfigSubject(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigSubjectConfigSubjectSlice(c *Client, des, nw []CertificateConfigSubjectConfigSubject) []CertificateConfigSubjectConfigSubject { @@ -1359,23 +1368,26 @@ func canonicalizeNewCertificateConfigSubjectConfigSubjectAltNameSet(c *Client, d if des == nil { return nw } - var reorderedNew []CertificateConfigSubjectConfigSubjectAltName + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigSubjectConfigSubjectAltName for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigSubjectConfigSubjectAltNameNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigSubjectConfigSubjectAltName(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigSubjectConfigSubjectAltNameSlice(c *Client, des, nw []CertificateConfigSubjectConfigSubjectAltName) []CertificateConfigSubjectConfigSubjectAltName { @@ -1482,23 +1494,26 @@ func canonicalizeNewCertificateConfigX509ConfigSet(c *Client, des, nw []Certific if des == nil { return nw } - var reorderedNew []CertificateConfigX509Config + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigX509Config for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigX509ConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigX509Config(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigX509ConfigSlice(c *Client, des, nw []CertificateConfigX509Config) []CertificateConfigX509Config { @@ -1595,23 +1610,26 @@ func canonicalizeNewCertificateConfigX509ConfigKeyUsageSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []CertificateConfigX509ConfigKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigX509ConfigKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigX509ConfigKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigX509ConfigKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigX509ConfigKeyUsageSlice(c *Client, des, nw []CertificateConfigX509ConfigKeyUsage) []CertificateConfigX509ConfigKeyUsage { @@ -1774,23 +1792,26 @@ func canonicalizeNewCertificateConfigX509ConfigKeyUsageBaseKeyUsageSet(c *Client if des == nil { return nw } - var reorderedNew []CertificateConfigX509ConfigKeyUsageBaseKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigX509ConfigKeyUsageBaseKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigX509ConfigKeyUsageBaseKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigX509ConfigKeyUsageBaseKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigX509ConfigKeyUsageBaseKeyUsageSlice(c *Client, des, nw []CertificateConfigX509ConfigKeyUsageBaseKeyUsage) []CertificateConfigX509ConfigKeyUsageBaseKeyUsage { @@ -1929,23 +1950,26 @@ func canonicalizeNewCertificateConfigX509ConfigKeyUsageExtendedKeyUsageSet(c *Cl if des == nil { return nw } - var reorderedNew []CertificateConfigX509ConfigKeyUsageExtendedKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigX509ConfigKeyUsageExtendedKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigX509ConfigKeyUsageExtendedKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigX509ConfigKeyUsageExtendedKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigX509ConfigKeyUsageExtendedKeyUsageSlice(c *Client, des, nw []CertificateConfigX509ConfigKeyUsageExtendedKeyUsage) []CertificateConfigX509ConfigKeyUsageExtendedKeyUsage { @@ -2041,23 +2065,26 @@ func canonicalizeNewCertificateConfigX509ConfigKeyUsageUnknownExtendedKeyUsagesS if des == nil { return nw } - var reorderedNew []CertificateConfigX509ConfigKeyUsageUnknownExtendedKeyUsages + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigX509ConfigKeyUsageUnknownExtendedKeyUsages for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigX509ConfigKeyUsageUnknownExtendedKeyUsagesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigX509ConfigKeyUsageUnknownExtendedKeyUsages(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigX509ConfigKeyUsageUnknownExtendedKeyUsagesSlice(c *Client, des, nw []CertificateConfigX509ConfigKeyUsageUnknownExtendedKeyUsages) []CertificateConfigX509ConfigKeyUsageUnknownExtendedKeyUsages { @@ -2178,23 +2205,26 @@ func canonicalizeNewCertificateConfigX509ConfigCaOptionsSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []CertificateConfigX509ConfigCaOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigX509ConfigCaOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigX509ConfigCaOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigX509ConfigCaOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigX509ConfigCaOptionsSlice(c *Client, des, nw []CertificateConfigX509ConfigCaOptions) []CertificateConfigX509ConfigCaOptions { @@ -2290,23 +2320,26 @@ func canonicalizeNewCertificateConfigX509ConfigPolicyIdsSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []CertificateConfigX509ConfigPolicyIds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigX509ConfigPolicyIds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigX509ConfigPolicyIdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigX509ConfigPolicyIds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigX509ConfigPolicyIdsSlice(c *Client, des, nw []CertificateConfigX509ConfigPolicyIds) []CertificateConfigX509ConfigPolicyIds { @@ -2415,23 +2448,26 @@ func canonicalizeNewCertificateConfigX509ConfigAdditionalExtensionsSet(c *Client if des == nil { return nw } - var reorderedNew []CertificateConfigX509ConfigAdditionalExtensions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigX509ConfigAdditionalExtensions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigX509ConfigAdditionalExtensionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigX509ConfigAdditionalExtensions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigX509ConfigAdditionalExtensionsSlice(c *Client, des, nw []CertificateConfigX509ConfigAdditionalExtensions) []CertificateConfigX509ConfigAdditionalExtensions { @@ -2527,23 +2563,26 @@ func canonicalizeNewCertificateConfigX509ConfigAdditionalExtensionsObjectIdSet(c if des == nil { return nw } - var reorderedNew []CertificateConfigX509ConfigAdditionalExtensionsObjectId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigX509ConfigAdditionalExtensionsObjectId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigX509ConfigAdditionalExtensionsObjectIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigX509ConfigAdditionalExtensionsObjectId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigX509ConfigAdditionalExtensionsObjectIdSlice(c *Client, des, nw []CertificateConfigX509ConfigAdditionalExtensionsObjectId) []CertificateConfigX509ConfigAdditionalExtensionsObjectId { @@ -2648,23 +2687,26 @@ func canonicalizeNewCertificateConfigPublicKeySet(c *Client, des, nw []Certifica if des == nil { return nw } - var reorderedNew []CertificateConfigPublicKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigPublicKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigPublicKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigPublicKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigPublicKeySlice(c *Client, des, nw []CertificateConfigPublicKey) []CertificateConfigPublicKey { @@ -2766,23 +2808,26 @@ func canonicalizeNewCertificateRevocationDetailsSet(c *Client, des, nw []Certifi if des == nil { return nw } - var reorderedNew []CertificateRevocationDetails + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateRevocationDetails for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateRevocationDetailsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateRevocationDetails(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateRevocationDetailsSlice(c *Client, des, nw []CertificateRevocationDetails) []CertificateRevocationDetails { @@ -2901,23 +2946,26 @@ func canonicalizeNewCertificateCertificateDescriptionSet(c *Client, des, nw []Ce if des == nil { return nw } - var reorderedNew []CertificateCertificateDescription + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescription for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescription(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionSlice(c *Client, des, nw []CertificateCertificateDescription) []CertificateCertificateDescription { @@ -3040,23 +3088,26 @@ func canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSet(c *Cl if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionSubjectDescription + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionSubjectDescription for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionSubjectDescriptionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionSubjectDescription(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSlice(c *Client, des, nw []CertificateCertificateDescriptionSubjectDescription) []CertificateCertificateDescriptionSubjectDescription { @@ -3211,23 +3262,26 @@ func canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubjectSe if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionSubjectDescriptionSubject + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionSubjectDescriptionSubject for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionSubjectDescriptionSubjectNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubject(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubjectSlice(c *Client, des, nw []CertificateCertificateDescriptionSubjectDescriptionSubject) []CertificateCertificateDescriptionSubjectDescriptionSubject { @@ -3352,23 +3406,26 @@ func canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubjectAl if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionSubjectDescriptionSubjectAltName + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionSubjectDescriptionSubjectAltName for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionSubjectDescriptionSubjectAltNameNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubjectAltName(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubjectAltNameSlice(c *Client, des, nw []CertificateCertificateDescriptionSubjectDescriptionSubjectAltName) []CertificateCertificateDescriptionSubjectDescriptionSubjectAltName { @@ -3477,23 +3534,26 @@ func canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubjectAl if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSans + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSans for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSansNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSans(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSansSlice(c *Client, des, nw []CertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSans) []CertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSans { @@ -3589,23 +3649,26 @@ func canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubjectAl if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSansObjectId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSansObjectId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSansObjectIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSansObjectId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSansObjectIdSlice(c *Client, des, nw []CertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSansObjectId) []CertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSansObjectId { @@ -3712,23 +3775,26 @@ func canonicalizeNewCertificateCertificateDescriptionX509DescriptionSet(c *Clien if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionX509Description + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionX509Description for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionX509DescriptionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionX509Description(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionX509DescriptionSlice(c *Client, des, nw []CertificateCertificateDescriptionX509Description) []CertificateCertificateDescriptionX509Description { @@ -3825,23 +3891,26 @@ func canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsageSet( if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionX509DescriptionKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionX509DescriptionKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionX509DescriptionKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsageSlice(c *Client, des, nw []CertificateCertificateDescriptionX509DescriptionKeyUsage) []CertificateCertificateDescriptionX509DescriptionKeyUsage { @@ -4004,23 +4073,26 @@ func canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsageBase if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionX509DescriptionKeyUsageBaseKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionX509DescriptionKeyUsageBaseKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionX509DescriptionKeyUsageBaseKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsageBaseKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsageBaseKeyUsageSlice(c *Client, des, nw []CertificateCertificateDescriptionX509DescriptionKeyUsageBaseKeyUsage) []CertificateCertificateDescriptionX509DescriptionKeyUsageBaseKeyUsage { @@ -4159,23 +4231,26 @@ func canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsageExte if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionX509DescriptionKeyUsageExtendedKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionX509DescriptionKeyUsageExtendedKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionX509DescriptionKeyUsageExtendedKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsageExtendedKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsageExtendedKeyUsageSlice(c *Client, des, nw []CertificateCertificateDescriptionX509DescriptionKeyUsageExtendedKeyUsage) []CertificateCertificateDescriptionX509DescriptionKeyUsageExtendedKeyUsage { @@ -4271,23 +4346,26 @@ func canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsageUnkn if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionX509DescriptionKeyUsageUnknownExtendedKeyUsages + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionX509DescriptionKeyUsageUnknownExtendedKeyUsages for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionX509DescriptionKeyUsageUnknownExtendedKeyUsagesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsageUnknownExtendedKeyUsages(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsageUnknownExtendedKeyUsagesSlice(c *Client, des, nw []CertificateCertificateDescriptionX509DescriptionKeyUsageUnknownExtendedKeyUsages) []CertificateCertificateDescriptionX509DescriptionKeyUsageUnknownExtendedKeyUsages { @@ -4412,23 +4490,26 @@ func canonicalizeNewCertificateCertificateDescriptionX509DescriptionCaOptionsSet if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionX509DescriptionCaOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionX509DescriptionCaOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionX509DescriptionCaOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionX509DescriptionCaOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionX509DescriptionCaOptionsSlice(c *Client, des, nw []CertificateCertificateDescriptionX509DescriptionCaOptions) []CertificateCertificateDescriptionX509DescriptionCaOptions { @@ -4524,23 +4605,26 @@ func canonicalizeNewCertificateCertificateDescriptionX509DescriptionPolicyIdsSet if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionX509DescriptionPolicyIds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionX509DescriptionPolicyIds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionX509DescriptionPolicyIdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionX509DescriptionPolicyIds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionX509DescriptionPolicyIdsSlice(c *Client, des, nw []CertificateCertificateDescriptionX509DescriptionPolicyIds) []CertificateCertificateDescriptionX509DescriptionPolicyIds { @@ -4649,23 +4733,26 @@ func canonicalizeNewCertificateCertificateDescriptionX509DescriptionAdditionalEx if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionX509DescriptionAdditionalExtensions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionX509DescriptionAdditionalExtensions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionX509DescriptionAdditionalExtensionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionX509DescriptionAdditionalExtensions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionX509DescriptionAdditionalExtensionsSlice(c *Client, des, nw []CertificateCertificateDescriptionX509DescriptionAdditionalExtensions) []CertificateCertificateDescriptionX509DescriptionAdditionalExtensions { @@ -4761,23 +4848,26 @@ func canonicalizeNewCertificateCertificateDescriptionX509DescriptionAdditionalEx if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionX509DescriptionAdditionalExtensionsObjectId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionX509DescriptionAdditionalExtensionsObjectId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionX509DescriptionAdditionalExtensionsObjectIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionX509DescriptionAdditionalExtensionsObjectId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionX509DescriptionAdditionalExtensionsObjectIdSlice(c *Client, des, nw []CertificateCertificateDescriptionX509DescriptionAdditionalExtensionsObjectId) []CertificateCertificateDescriptionX509DescriptionAdditionalExtensionsObjectId { @@ -4882,23 +4972,26 @@ func canonicalizeNewCertificateCertificateDescriptionPublicKeySet(c *Client, des if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionPublicKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionPublicKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionPublicKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionPublicKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionPublicKeySlice(c *Client, des, nw []CertificateCertificateDescriptionPublicKey) []CertificateCertificateDescriptionPublicKey { @@ -4997,23 +5090,26 @@ func canonicalizeNewCertificateCertificateDescriptionSubjectKeyIdSet(c *Client, if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionSubjectKeyId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionSubjectKeyId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionSubjectKeyIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionSubjectKeyId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionSubjectKeyIdSlice(c *Client, des, nw []CertificateCertificateDescriptionSubjectKeyId) []CertificateCertificateDescriptionSubjectKeyId { @@ -5112,23 +5208,26 @@ func canonicalizeNewCertificateCertificateDescriptionAuthorityKeyIdSet(c *Client if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionAuthorityKeyId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionAuthorityKeyId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionAuthorityKeyIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionAuthorityKeyId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionAuthorityKeyIdSlice(c *Client, des, nw []CertificateCertificateDescriptionAuthorityKeyId) []CertificateCertificateDescriptionAuthorityKeyId { @@ -5227,23 +5326,26 @@ func canonicalizeNewCertificateCertificateDescriptionCertFingerprintSet(c *Clien if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionCertFingerprint + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionCertFingerprint for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionCertFingerprintNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionCertFingerprint(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionCertFingerprintSlice(c *Client, des, nw []CertificateCertificateDescriptionCertFingerprint) []CertificateCertificateDescriptionCertFingerprint { diff --git a/services/google/privateca/alpha/certificate_template_internal.go b/services/google/privateca/alpha/certificate_template_internal.go index fe310b213c..ea8b4b502c 100755 --- a/services/google/privateca/alpha/certificate_template_internal.go +++ b/services/google/privateca/alpha/certificate_template_internal.go @@ -739,23 +739,26 @@ func canonicalizeNewCertificateTemplatePredefinedValuesSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []CertificateTemplatePredefinedValues + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplatePredefinedValues for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplatePredefinedValuesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplatePredefinedValues(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplatePredefinedValuesSlice(c *Client, des, nw []CertificateTemplatePredefinedValues) []CertificateTemplatePredefinedValues { @@ -852,23 +855,26 @@ func canonicalizeNewCertificateTemplatePredefinedValuesKeyUsageSet(c *Client, de if des == nil { return nw } - var reorderedNew []CertificateTemplatePredefinedValuesKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplatePredefinedValuesKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplatePredefinedValuesKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplatePredefinedValuesKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplatePredefinedValuesKeyUsageSlice(c *Client, des, nw []CertificateTemplatePredefinedValuesKeyUsage) []CertificateTemplatePredefinedValuesKeyUsage { @@ -1031,23 +1037,26 @@ func canonicalizeNewCertificateTemplatePredefinedValuesKeyUsageBaseKeyUsageSet(c if des == nil { return nw } - var reorderedNew []CertificateTemplatePredefinedValuesKeyUsageBaseKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplatePredefinedValuesKeyUsageBaseKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplatePredefinedValuesKeyUsageBaseKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplatePredefinedValuesKeyUsageBaseKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplatePredefinedValuesKeyUsageBaseKeyUsageSlice(c *Client, des, nw []CertificateTemplatePredefinedValuesKeyUsageBaseKeyUsage) []CertificateTemplatePredefinedValuesKeyUsageBaseKeyUsage { @@ -1186,23 +1195,26 @@ func canonicalizeNewCertificateTemplatePredefinedValuesKeyUsageExtendedKeyUsageS if des == nil { return nw } - var reorderedNew []CertificateTemplatePredefinedValuesKeyUsageExtendedKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplatePredefinedValuesKeyUsageExtendedKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplatePredefinedValuesKeyUsageExtendedKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplatePredefinedValuesKeyUsageExtendedKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplatePredefinedValuesKeyUsageExtendedKeyUsageSlice(c *Client, des, nw []CertificateTemplatePredefinedValuesKeyUsageExtendedKeyUsage) []CertificateTemplatePredefinedValuesKeyUsageExtendedKeyUsage { @@ -1298,23 +1310,26 @@ func canonicalizeNewCertificateTemplatePredefinedValuesKeyUsageUnknownExtendedKe if des == nil { return nw } - var reorderedNew []CertificateTemplatePredefinedValuesKeyUsageUnknownExtendedKeyUsages + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplatePredefinedValuesKeyUsageUnknownExtendedKeyUsages for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplatePredefinedValuesKeyUsageUnknownExtendedKeyUsagesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplatePredefinedValuesKeyUsageUnknownExtendedKeyUsages(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplatePredefinedValuesKeyUsageUnknownExtendedKeyUsagesSlice(c *Client, des, nw []CertificateTemplatePredefinedValuesKeyUsageUnknownExtendedKeyUsages) []CertificateTemplatePredefinedValuesKeyUsageUnknownExtendedKeyUsages { @@ -1419,23 +1434,26 @@ func canonicalizeNewCertificateTemplatePredefinedValuesCaOptionsSet(c *Client, d if des == nil { return nw } - var reorderedNew []CertificateTemplatePredefinedValuesCaOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplatePredefinedValuesCaOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplatePredefinedValuesCaOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplatePredefinedValuesCaOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplatePredefinedValuesCaOptionsSlice(c *Client, des, nw []CertificateTemplatePredefinedValuesCaOptions) []CertificateTemplatePredefinedValuesCaOptions { @@ -1531,23 +1549,26 @@ func canonicalizeNewCertificateTemplatePredefinedValuesPolicyIdsSet(c *Client, d if des == nil { return nw } - var reorderedNew []CertificateTemplatePredefinedValuesPolicyIds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplatePredefinedValuesPolicyIds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplatePredefinedValuesPolicyIdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplatePredefinedValuesPolicyIds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplatePredefinedValuesPolicyIdsSlice(c *Client, des, nw []CertificateTemplatePredefinedValuesPolicyIds) []CertificateTemplatePredefinedValuesPolicyIds { @@ -1656,23 +1677,26 @@ func canonicalizeNewCertificateTemplatePredefinedValuesAdditionalExtensionsSet(c if des == nil { return nw } - var reorderedNew []CertificateTemplatePredefinedValuesAdditionalExtensions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplatePredefinedValuesAdditionalExtensions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplatePredefinedValuesAdditionalExtensionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplatePredefinedValuesAdditionalExtensions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplatePredefinedValuesAdditionalExtensionsSlice(c *Client, des, nw []CertificateTemplatePredefinedValuesAdditionalExtensions) []CertificateTemplatePredefinedValuesAdditionalExtensions { @@ -1768,23 +1792,26 @@ func canonicalizeNewCertificateTemplatePredefinedValuesAdditionalExtensionsObjec if des == nil { return nw } - var reorderedNew []CertificateTemplatePredefinedValuesAdditionalExtensionsObjectId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplatePredefinedValuesAdditionalExtensionsObjectId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplatePredefinedValuesAdditionalExtensionsObjectIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplatePredefinedValuesAdditionalExtensionsObjectId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplatePredefinedValuesAdditionalExtensionsObjectIdSlice(c *Client, des, nw []CertificateTemplatePredefinedValuesAdditionalExtensionsObjectId) []CertificateTemplatePredefinedValuesAdditionalExtensionsObjectId { @@ -1893,23 +1920,26 @@ func canonicalizeNewCertificateTemplateIdentityConstraintsSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []CertificateTemplateIdentityConstraints + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplateIdentityConstraints for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplateIdentityConstraintsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplateIdentityConstraints(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplateIdentityConstraintsSlice(c *Client, des, nw []CertificateTemplateIdentityConstraints) []CertificateTemplateIdentityConstraints { @@ -2032,23 +2062,26 @@ func canonicalizeNewCertificateTemplateIdentityConstraintsCelExpressionSet(c *Cl if des == nil { return nw } - var reorderedNew []CertificateTemplateIdentityConstraintsCelExpression + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplateIdentityConstraintsCelExpression for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplateIdentityConstraintsCelExpressionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplateIdentityConstraintsCelExpression(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplateIdentityConstraintsCelExpressionSlice(c *Client, des, nw []CertificateTemplateIdentityConstraintsCelExpression) []CertificateTemplateIdentityConstraintsCelExpression { @@ -2147,23 +2180,26 @@ func canonicalizeNewCertificateTemplatePassthroughExtensionsSet(c *Client, des, if des == nil { return nw } - var reorderedNew []CertificateTemplatePassthroughExtensions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplatePassthroughExtensions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplatePassthroughExtensionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplatePassthroughExtensions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplatePassthroughExtensionsSlice(c *Client, des, nw []CertificateTemplatePassthroughExtensions) []CertificateTemplatePassthroughExtensions { @@ -2259,23 +2295,26 @@ func canonicalizeNewCertificateTemplatePassthroughExtensionsAdditionalExtensions if des == nil { return nw } - var reorderedNew []CertificateTemplatePassthroughExtensionsAdditionalExtensions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplatePassthroughExtensionsAdditionalExtensions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplatePassthroughExtensionsAdditionalExtensionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplatePassthroughExtensionsAdditionalExtensions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplatePassthroughExtensionsAdditionalExtensionsSlice(c *Client, des, nw []CertificateTemplatePassthroughExtensionsAdditionalExtensions) []CertificateTemplatePassthroughExtensionsAdditionalExtensions { diff --git a/services/google/privateca/beta/ca_pool_internal.go b/services/google/privateca/beta/ca_pool_internal.go index 821ea87e4b..59a82be8e3 100755 --- a/services/google/privateca/beta/ca_pool_internal.go +++ b/services/google/privateca/beta/ca_pool_internal.go @@ -762,23 +762,26 @@ func canonicalizeNewCaPoolIssuancePolicySet(c *Client, des, nw []CaPoolIssuanceP if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicySlice(c *Client, des, nw []CaPoolIssuancePolicy) []CaPoolIssuancePolicy { @@ -893,23 +896,26 @@ func canonicalizeNewCaPoolIssuancePolicyAllowedKeyTypesSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyAllowedKeyTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyAllowedKeyTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyAllowedKeyTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyAllowedKeyTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyAllowedKeyTypesSlice(c *Client, des, nw []CaPoolIssuancePolicyAllowedKeyTypes) []CaPoolIssuancePolicyAllowedKeyTypes { @@ -1011,23 +1017,26 @@ func canonicalizeNewCaPoolIssuancePolicyAllowedKeyTypesRsaSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyAllowedKeyTypesRsa + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyAllowedKeyTypesRsa for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyAllowedKeyTypesRsaNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyAllowedKeyTypesRsa(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyAllowedKeyTypesRsaSlice(c *Client, des, nw []CaPoolIssuancePolicyAllowedKeyTypesRsa) []CaPoolIssuancePolicyAllowedKeyTypesRsa { @@ -1123,23 +1132,26 @@ func canonicalizeNewCaPoolIssuancePolicyAllowedKeyTypesEllipticCurveSet(c *Clien if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyAllowedKeyTypesEllipticCurve + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyAllowedKeyTypesEllipticCurve for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyAllowedKeyTypesEllipticCurveNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyAllowedKeyTypesEllipticCurve(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyAllowedKeyTypesEllipticCurveSlice(c *Client, des, nw []CaPoolIssuancePolicyAllowedKeyTypesEllipticCurve) []CaPoolIssuancePolicyAllowedKeyTypesEllipticCurve { @@ -1246,23 +1258,26 @@ func canonicalizeNewCaPoolIssuancePolicyAllowedIssuanceModesSet(c *Client, des, if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyAllowedIssuanceModes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyAllowedIssuanceModes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyAllowedIssuanceModesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyAllowedIssuanceModes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyAllowedIssuanceModesSlice(c *Client, des, nw []CaPoolIssuancePolicyAllowedIssuanceModes) []CaPoolIssuancePolicyAllowedIssuanceModes { @@ -1369,23 +1384,26 @@ func canonicalizeNewCaPoolIssuancePolicyBaselineValuesSet(c *Client, des, nw []C if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyBaselineValues + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyBaselineValues for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyBaselineValuesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyBaselineValues(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyBaselineValuesSlice(c *Client, des, nw []CaPoolIssuancePolicyBaselineValues) []CaPoolIssuancePolicyBaselineValues { @@ -1482,23 +1500,26 @@ func canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsageSet(c *Client, des if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyBaselineValuesKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyBaselineValuesKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyBaselineValuesKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsageSlice(c *Client, des, nw []CaPoolIssuancePolicyBaselineValuesKeyUsage) []CaPoolIssuancePolicyBaselineValuesKeyUsage { @@ -1661,23 +1682,26 @@ func canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsageBaseKeyUsageSet(c if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyBaselineValuesKeyUsageBaseKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyBaselineValuesKeyUsageBaseKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyBaselineValuesKeyUsageBaseKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsageBaseKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsageBaseKeyUsageSlice(c *Client, des, nw []CaPoolIssuancePolicyBaselineValuesKeyUsageBaseKeyUsage) []CaPoolIssuancePolicyBaselineValuesKeyUsageBaseKeyUsage { @@ -1816,23 +1840,26 @@ func canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsageExtendedKeyUsageSe if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyBaselineValuesKeyUsageExtendedKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyBaselineValuesKeyUsageExtendedKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyBaselineValuesKeyUsageExtendedKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsageExtendedKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsageExtendedKeyUsageSlice(c *Client, des, nw []CaPoolIssuancePolicyBaselineValuesKeyUsageExtendedKeyUsage) []CaPoolIssuancePolicyBaselineValuesKeyUsageExtendedKeyUsage { @@ -1928,23 +1955,26 @@ func canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsageUnknownExtendedKey if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyBaselineValuesKeyUsageUnknownExtendedKeyUsages + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyBaselineValuesKeyUsageUnknownExtendedKeyUsages for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyBaselineValuesKeyUsageUnknownExtendedKeyUsagesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsageUnknownExtendedKeyUsages(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsageUnknownExtendedKeyUsagesSlice(c *Client, des, nw []CaPoolIssuancePolicyBaselineValuesKeyUsageUnknownExtendedKeyUsages) []CaPoolIssuancePolicyBaselineValuesKeyUsageUnknownExtendedKeyUsages { @@ -2049,23 +2079,26 @@ func canonicalizeNewCaPoolIssuancePolicyBaselineValuesCaOptionsSet(c *Client, de if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyBaselineValuesCaOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyBaselineValuesCaOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyBaselineValuesCaOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyBaselineValuesCaOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyBaselineValuesCaOptionsSlice(c *Client, des, nw []CaPoolIssuancePolicyBaselineValuesCaOptions) []CaPoolIssuancePolicyBaselineValuesCaOptions { @@ -2161,23 +2194,26 @@ func canonicalizeNewCaPoolIssuancePolicyBaselineValuesPolicyIdsSet(c *Client, de if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyBaselineValuesPolicyIds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyBaselineValuesPolicyIds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyBaselineValuesPolicyIdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyBaselineValuesPolicyIds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyBaselineValuesPolicyIdsSlice(c *Client, des, nw []CaPoolIssuancePolicyBaselineValuesPolicyIds) []CaPoolIssuancePolicyBaselineValuesPolicyIds { @@ -2286,23 +2322,26 @@ func canonicalizeNewCaPoolIssuancePolicyBaselineValuesAdditionalExtensionsSet(c if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyBaselineValuesAdditionalExtensions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyBaselineValuesAdditionalExtensions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyBaselineValuesAdditionalExtensionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyBaselineValuesAdditionalExtensions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyBaselineValuesAdditionalExtensionsSlice(c *Client, des, nw []CaPoolIssuancePolicyBaselineValuesAdditionalExtensions) []CaPoolIssuancePolicyBaselineValuesAdditionalExtensions { @@ -2398,23 +2437,26 @@ func canonicalizeNewCaPoolIssuancePolicyBaselineValuesAdditionalExtensionsObject if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyBaselineValuesAdditionalExtensionsObjectId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyBaselineValuesAdditionalExtensionsObjectId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyBaselineValuesAdditionalExtensionsObjectIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyBaselineValuesAdditionalExtensionsObjectId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyBaselineValuesAdditionalExtensionsObjectIdSlice(c *Client, des, nw []CaPoolIssuancePolicyBaselineValuesAdditionalExtensionsObjectId) []CaPoolIssuancePolicyBaselineValuesAdditionalExtensionsObjectId { @@ -2523,23 +2565,26 @@ func canonicalizeNewCaPoolIssuancePolicyIdentityConstraintsSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyIdentityConstraints + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyIdentityConstraints for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyIdentityConstraintsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyIdentityConstraints(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyIdentityConstraintsSlice(c *Client, des, nw []CaPoolIssuancePolicyIdentityConstraints) []CaPoolIssuancePolicyIdentityConstraints { @@ -2662,23 +2707,26 @@ func canonicalizeNewCaPoolIssuancePolicyIdentityConstraintsCelExpressionSet(c *C if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyIdentityConstraintsCelExpression + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyIdentityConstraintsCelExpression for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyIdentityConstraintsCelExpressionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyIdentityConstraintsCelExpression(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyIdentityConstraintsCelExpressionSlice(c *Client, des, nw []CaPoolIssuancePolicyIdentityConstraintsCelExpression) []CaPoolIssuancePolicyIdentityConstraintsCelExpression { @@ -2777,23 +2825,26 @@ func canonicalizeNewCaPoolIssuancePolicyPassthroughExtensionsSet(c *Client, des, if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyPassthroughExtensions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyPassthroughExtensions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyPassthroughExtensionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyPassthroughExtensions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyPassthroughExtensionsSlice(c *Client, des, nw []CaPoolIssuancePolicyPassthroughExtensions) []CaPoolIssuancePolicyPassthroughExtensions { @@ -2889,23 +2940,26 @@ func canonicalizeNewCaPoolIssuancePolicyPassthroughExtensionsAdditionalExtension if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyPassthroughExtensionsAdditionalExtensions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyPassthroughExtensionsAdditionalExtensions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyPassthroughExtensionsAdditionalExtensionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyPassthroughExtensionsAdditionalExtensions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyPassthroughExtensionsAdditionalExtensionsSlice(c *Client, des, nw []CaPoolIssuancePolicyPassthroughExtensionsAdditionalExtensions) []CaPoolIssuancePolicyPassthroughExtensionsAdditionalExtensions { @@ -3012,23 +3066,26 @@ func canonicalizeNewCaPoolPublishingOptionsSet(c *Client, des, nw []CaPoolPublis if des == nil { return nw } - var reorderedNew []CaPoolPublishingOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolPublishingOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolPublishingOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolPublishingOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolPublishingOptionsSlice(c *Client, des, nw []CaPoolPublishingOptions) []CaPoolPublishingOptions { diff --git a/services/google/privateca/beta/certificate_authority_internal.go b/services/google/privateca/beta/certificate_authority_internal.go index 0e72971d58..9264378ddc 100755 --- a/services/google/privateca/beta/certificate_authority_internal.go +++ b/services/google/privateca/beta/certificate_authority_internal.go @@ -1027,23 +1027,26 @@ func canonicalizeNewCertificateAuthorityConfigSet(c *Client, des, nw []Certifica if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigSlice(c *Client, des, nw []CertificateAuthorityConfig) []CertificateAuthorityConfig { @@ -1138,23 +1141,26 @@ func canonicalizeNewCertificateAuthorityConfigSubjectConfigSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigSubjectConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigSubjectConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigSubjectConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigSubjectConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigSubjectConfigSlice(c *Client, des, nw []CertificateAuthorityConfigSubjectConfig) []CertificateAuthorityConfigSubjectConfig { @@ -1309,23 +1315,26 @@ func canonicalizeNewCertificateAuthorityConfigSubjectConfigSubjectSet(c *Client, if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigSubjectConfigSubject + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigSubjectConfigSubject for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigSubjectConfigSubjectNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigSubjectConfigSubject(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigSubjectConfigSubjectSlice(c *Client, des, nw []CertificateAuthorityConfigSubjectConfigSubject) []CertificateAuthorityConfigSubjectConfigSubject { @@ -1450,23 +1459,26 @@ func canonicalizeNewCertificateAuthorityConfigSubjectConfigSubjectAltNameSet(c * if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigSubjectConfigSubjectAltName + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigSubjectConfigSubjectAltName for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigSubjectConfigSubjectAltNameNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigSubjectConfigSubjectAltName(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigSubjectConfigSubjectAltNameSlice(c *Client, des, nw []CertificateAuthorityConfigSubjectConfigSubjectAltName) []CertificateAuthorityConfigSubjectConfigSubjectAltName { @@ -1575,23 +1587,26 @@ func canonicalizeNewCertificateAuthorityConfigSubjectConfigSubjectAltNameCustomS if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSans + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSans for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSansNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSans(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSansSlice(c *Client, des, nw []CertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSans) []CertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSans { @@ -1687,23 +1702,26 @@ func canonicalizeNewCertificateAuthorityConfigSubjectConfigSubjectAltNameCustomS if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSansObjectId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSansObjectId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSansObjectIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSansObjectId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSansObjectIdSlice(c *Client, des, nw []CertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSansObjectId) []CertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSansObjectId { @@ -1805,23 +1823,26 @@ func canonicalizeNewCertificateAuthorityConfigX509ConfigSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigX509Config + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigX509Config for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigX509ConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigX509Config(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigX509ConfigSlice(c *Client, des, nw []CertificateAuthorityConfigX509Config) []CertificateAuthorityConfigX509Config { @@ -1918,23 +1939,26 @@ func canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsageSet(c *Client, d if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigX509ConfigKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigX509ConfigKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigX509ConfigKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsageSlice(c *Client, des, nw []CertificateAuthorityConfigX509ConfigKeyUsage) []CertificateAuthorityConfigX509ConfigKeyUsage { @@ -2097,23 +2121,26 @@ func canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsageBaseKeyUsageSet( if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigX509ConfigKeyUsageBaseKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigX509ConfigKeyUsageBaseKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigX509ConfigKeyUsageBaseKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsageBaseKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsageBaseKeyUsageSlice(c *Client, des, nw []CertificateAuthorityConfigX509ConfigKeyUsageBaseKeyUsage) []CertificateAuthorityConfigX509ConfigKeyUsageBaseKeyUsage { @@ -2252,23 +2279,26 @@ func canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsageExtendedKeyUsage if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigX509ConfigKeyUsageExtendedKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigX509ConfigKeyUsageExtendedKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigX509ConfigKeyUsageExtendedKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsageExtendedKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsageExtendedKeyUsageSlice(c *Client, des, nw []CertificateAuthorityConfigX509ConfigKeyUsageExtendedKeyUsage) []CertificateAuthorityConfigX509ConfigKeyUsageExtendedKeyUsage { @@ -2364,23 +2394,26 @@ func canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsageUnknownExtendedK if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigX509ConfigKeyUsageUnknownExtendedKeyUsages + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigX509ConfigKeyUsageUnknownExtendedKeyUsages for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigX509ConfigKeyUsageUnknownExtendedKeyUsagesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsageUnknownExtendedKeyUsages(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsageUnknownExtendedKeyUsagesSlice(c *Client, des, nw []CertificateAuthorityConfigX509ConfigKeyUsageUnknownExtendedKeyUsages) []CertificateAuthorityConfigX509ConfigKeyUsageUnknownExtendedKeyUsages { @@ -2485,23 +2518,26 @@ func canonicalizeNewCertificateAuthorityConfigX509ConfigCaOptionsSet(c *Client, if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigX509ConfigCaOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigX509ConfigCaOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigX509ConfigCaOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigX509ConfigCaOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigX509ConfigCaOptionsSlice(c *Client, des, nw []CertificateAuthorityConfigX509ConfigCaOptions) []CertificateAuthorityConfigX509ConfigCaOptions { @@ -2597,23 +2633,26 @@ func canonicalizeNewCertificateAuthorityConfigX509ConfigPolicyIdsSet(c *Client, if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigX509ConfigPolicyIds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigX509ConfigPolicyIds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigX509ConfigPolicyIdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigX509ConfigPolicyIds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigX509ConfigPolicyIdsSlice(c *Client, des, nw []CertificateAuthorityConfigX509ConfigPolicyIds) []CertificateAuthorityConfigX509ConfigPolicyIds { @@ -2722,23 +2761,26 @@ func canonicalizeNewCertificateAuthorityConfigX509ConfigAdditionalExtensionsSet( if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigX509ConfigAdditionalExtensions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigX509ConfigAdditionalExtensions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigX509ConfigAdditionalExtensionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigX509ConfigAdditionalExtensions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigX509ConfigAdditionalExtensionsSlice(c *Client, des, nw []CertificateAuthorityConfigX509ConfigAdditionalExtensions) []CertificateAuthorityConfigX509ConfigAdditionalExtensions { @@ -2834,23 +2876,26 @@ func canonicalizeNewCertificateAuthorityConfigX509ConfigAdditionalExtensionsObje if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigX509ConfigAdditionalExtensionsObjectId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigX509ConfigAdditionalExtensionsObjectId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigX509ConfigAdditionalExtensionsObjectIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigX509ConfigAdditionalExtensionsObjectId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigX509ConfigAdditionalExtensionsObjectIdSlice(c *Client, des, nw []CertificateAuthorityConfigX509ConfigAdditionalExtensionsObjectId) []CertificateAuthorityConfigX509ConfigAdditionalExtensionsObjectId { @@ -2955,23 +3000,26 @@ func canonicalizeNewCertificateAuthorityConfigPublicKeySet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigPublicKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigPublicKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigPublicKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigPublicKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigPublicKeySlice(c *Client, des, nw []CertificateAuthorityConfigPublicKey) []CertificateAuthorityConfigPublicKey { @@ -3093,23 +3141,26 @@ func canonicalizeNewCertificateAuthorityKeySpecSet(c *Client, des, nw []Certific if des == nil { return nw } - var reorderedNew []CertificateAuthorityKeySpec + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityKeySpec for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityKeySpecNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityKeySpec(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityKeySpecSlice(c *Client, des, nw []CertificateAuthorityKeySpec) []CertificateAuthorityKeySpec { @@ -3228,23 +3279,26 @@ func canonicalizeNewCertificateAuthoritySubordinateConfigSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []CertificateAuthoritySubordinateConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthoritySubordinateConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthoritySubordinateConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthoritySubordinateConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthoritySubordinateConfigSlice(c *Client, des, nw []CertificateAuthoritySubordinateConfig) []CertificateAuthoritySubordinateConfig { @@ -3343,23 +3397,26 @@ func canonicalizeNewCertificateAuthoritySubordinateConfigPemIssuerChainSet(c *Cl if des == nil { return nw } - var reorderedNew []CertificateAuthoritySubordinateConfigPemIssuerChain + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthoritySubordinateConfigPemIssuerChain for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthoritySubordinateConfigPemIssuerChainNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthoritySubordinateConfigPemIssuerChain(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthoritySubordinateConfigPemIssuerChainSlice(c *Client, des, nw []CertificateAuthoritySubordinateConfigPemIssuerChain) []CertificateAuthoritySubordinateConfigPemIssuerChain { @@ -3478,23 +3535,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSet(c *Client, if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptions) []CertificateAuthorityCaCertificateDescriptions { @@ -3617,23 +3677,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescript if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsSubjectDescription + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsSubjectDescription for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescription(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsSubjectDescription) []CertificateAuthorityCaCertificateDescriptionsSubjectDescription { @@ -3788,23 +3851,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescript if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubject + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubject for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubject(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubject) []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubject { @@ -3929,23 +3995,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescript if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltName + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltName for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltName(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltName) []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltName { @@ -4054,23 +4123,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescript if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSans + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSans for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSansNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSans(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSansSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSans) []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSans { @@ -4166,23 +4238,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescript if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSansObjectId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSansObjectId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSansObjectIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSansObjectId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSansObjectIdSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSansObjectId) []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSansObjectId { @@ -4284,23 +4359,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509Description if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsX509Description + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsX509Description for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsX509DescriptionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509Description(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsX509Description) []CertificateAuthorityCaCertificateDescriptionsX509Description { @@ -4397,23 +4475,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509Description if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsage) []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsage { @@ -4576,23 +4657,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509Description if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageBaseKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageBaseKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageBaseKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageBaseKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageBaseKeyUsageSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageBaseKeyUsage) []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageBaseKeyUsage { @@ -4731,23 +4815,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509Description if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageExtendedKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageExtendedKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageExtendedKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageExtendedKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageExtendedKeyUsageSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageExtendedKeyUsage) []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageExtendedKeyUsage { @@ -4843,23 +4930,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509Description if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageUnknownExtendedKeyUsages + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageUnknownExtendedKeyUsages for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageUnknownExtendedKeyUsagesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageUnknownExtendedKeyUsages(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageUnknownExtendedKeyUsagesSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageUnknownExtendedKeyUsages) []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageUnknownExtendedKeyUsages { @@ -4964,23 +5054,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509Description if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsX509DescriptionCaOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsX509DescriptionCaOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsX509DescriptionCaOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionCaOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionCaOptionsSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsX509DescriptionCaOptions) []CertificateAuthorityCaCertificateDescriptionsX509DescriptionCaOptions { @@ -5076,23 +5169,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509Description if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsX509DescriptionPolicyIds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsX509DescriptionPolicyIds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsX509DescriptionPolicyIdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionPolicyIds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionPolicyIdsSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsX509DescriptionPolicyIds) []CertificateAuthorityCaCertificateDescriptionsX509DescriptionPolicyIds { @@ -5201,23 +5297,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509Description if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensionsSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensions) []CertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensions { @@ -5313,23 +5412,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509Description if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensionsObjectId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensionsObjectId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensionsObjectIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensionsObjectId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensionsObjectIdSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensionsObjectId) []CertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensionsObjectId { @@ -5434,23 +5536,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsPublicKeySet(c if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsPublicKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsPublicKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsPublicKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsPublicKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsPublicKeySlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsPublicKey) []CertificateAuthorityCaCertificateDescriptionsPublicKey { @@ -5549,23 +5654,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectKeyIdSet if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsSubjectKeyId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsSubjectKeyId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsSubjectKeyIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectKeyId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectKeyIdSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsSubjectKeyId) []CertificateAuthorityCaCertificateDescriptionsSubjectKeyId { @@ -5664,23 +5772,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsAuthorityKeyIdS if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsAuthorityKeyId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsAuthorityKeyId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsAuthorityKeyIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsAuthorityKeyId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsAuthorityKeyIdSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsAuthorityKeyId) []CertificateAuthorityCaCertificateDescriptionsAuthorityKeyId { @@ -5779,23 +5890,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsCertFingerprint if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsCertFingerprint + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsCertFingerprint for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsCertFingerprintNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsCertFingerprint(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsCertFingerprintSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsCertFingerprint) []CertificateAuthorityCaCertificateDescriptionsCertFingerprint { @@ -5902,23 +6016,26 @@ func canonicalizeNewCertificateAuthorityAccessUrlsSet(c *Client, des, nw []Certi if des == nil { return nw } - var reorderedNew []CertificateAuthorityAccessUrls + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityAccessUrls for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityAccessUrlsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityAccessUrls(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityAccessUrlsSlice(c *Client, des, nw []CertificateAuthorityAccessUrls) []CertificateAuthorityAccessUrls { diff --git a/services/google/privateca/beta/certificate_internal.go b/services/google/privateca/beta/certificate_internal.go index 40d5fdccac..635b07242b 100755 --- a/services/google/privateca/beta/certificate_internal.go +++ b/services/google/privateca/beta/certificate_internal.go @@ -938,23 +938,26 @@ func canonicalizeNewCertificateConfigSet(c *Client, des, nw []CertificateConfig) if des == nil { return nw } - var reorderedNew []CertificateConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigSlice(c *Client, des, nw []CertificateConfig) []CertificateConfig { @@ -1049,23 +1052,26 @@ func canonicalizeNewCertificateConfigSubjectConfigSet(c *Client, des, nw []Certi if des == nil { return nw } - var reorderedNew []CertificateConfigSubjectConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigSubjectConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigSubjectConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigSubjectConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigSubjectConfigSlice(c *Client, des, nw []CertificateConfigSubjectConfig) []CertificateConfigSubjectConfig { @@ -1220,23 +1226,26 @@ func canonicalizeNewCertificateConfigSubjectConfigSubjectSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []CertificateConfigSubjectConfigSubject + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigSubjectConfigSubject for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigSubjectConfigSubjectNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigSubjectConfigSubject(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigSubjectConfigSubjectSlice(c *Client, des, nw []CertificateConfigSubjectConfigSubject) []CertificateConfigSubjectConfigSubject { @@ -1359,23 +1368,26 @@ func canonicalizeNewCertificateConfigSubjectConfigSubjectAltNameSet(c *Client, d if des == nil { return nw } - var reorderedNew []CertificateConfigSubjectConfigSubjectAltName + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigSubjectConfigSubjectAltName for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigSubjectConfigSubjectAltNameNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigSubjectConfigSubjectAltName(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigSubjectConfigSubjectAltNameSlice(c *Client, des, nw []CertificateConfigSubjectConfigSubjectAltName) []CertificateConfigSubjectConfigSubjectAltName { @@ -1482,23 +1494,26 @@ func canonicalizeNewCertificateConfigX509ConfigSet(c *Client, des, nw []Certific if des == nil { return nw } - var reorderedNew []CertificateConfigX509Config + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigX509Config for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigX509ConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigX509Config(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigX509ConfigSlice(c *Client, des, nw []CertificateConfigX509Config) []CertificateConfigX509Config { @@ -1595,23 +1610,26 @@ func canonicalizeNewCertificateConfigX509ConfigKeyUsageSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []CertificateConfigX509ConfigKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigX509ConfigKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigX509ConfigKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigX509ConfigKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigX509ConfigKeyUsageSlice(c *Client, des, nw []CertificateConfigX509ConfigKeyUsage) []CertificateConfigX509ConfigKeyUsage { @@ -1774,23 +1792,26 @@ func canonicalizeNewCertificateConfigX509ConfigKeyUsageBaseKeyUsageSet(c *Client if des == nil { return nw } - var reorderedNew []CertificateConfigX509ConfigKeyUsageBaseKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigX509ConfigKeyUsageBaseKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigX509ConfigKeyUsageBaseKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigX509ConfigKeyUsageBaseKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigX509ConfigKeyUsageBaseKeyUsageSlice(c *Client, des, nw []CertificateConfigX509ConfigKeyUsageBaseKeyUsage) []CertificateConfigX509ConfigKeyUsageBaseKeyUsage { @@ -1929,23 +1950,26 @@ func canonicalizeNewCertificateConfigX509ConfigKeyUsageExtendedKeyUsageSet(c *Cl if des == nil { return nw } - var reorderedNew []CertificateConfigX509ConfigKeyUsageExtendedKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigX509ConfigKeyUsageExtendedKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigX509ConfigKeyUsageExtendedKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigX509ConfigKeyUsageExtendedKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigX509ConfigKeyUsageExtendedKeyUsageSlice(c *Client, des, nw []CertificateConfigX509ConfigKeyUsageExtendedKeyUsage) []CertificateConfigX509ConfigKeyUsageExtendedKeyUsage { @@ -2041,23 +2065,26 @@ func canonicalizeNewCertificateConfigX509ConfigKeyUsageUnknownExtendedKeyUsagesS if des == nil { return nw } - var reorderedNew []CertificateConfigX509ConfigKeyUsageUnknownExtendedKeyUsages + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigX509ConfigKeyUsageUnknownExtendedKeyUsages for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigX509ConfigKeyUsageUnknownExtendedKeyUsagesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigX509ConfigKeyUsageUnknownExtendedKeyUsages(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigX509ConfigKeyUsageUnknownExtendedKeyUsagesSlice(c *Client, des, nw []CertificateConfigX509ConfigKeyUsageUnknownExtendedKeyUsages) []CertificateConfigX509ConfigKeyUsageUnknownExtendedKeyUsages { @@ -2178,23 +2205,26 @@ func canonicalizeNewCertificateConfigX509ConfigCaOptionsSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []CertificateConfigX509ConfigCaOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigX509ConfigCaOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigX509ConfigCaOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigX509ConfigCaOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigX509ConfigCaOptionsSlice(c *Client, des, nw []CertificateConfigX509ConfigCaOptions) []CertificateConfigX509ConfigCaOptions { @@ -2290,23 +2320,26 @@ func canonicalizeNewCertificateConfigX509ConfigPolicyIdsSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []CertificateConfigX509ConfigPolicyIds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigX509ConfigPolicyIds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigX509ConfigPolicyIdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigX509ConfigPolicyIds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigX509ConfigPolicyIdsSlice(c *Client, des, nw []CertificateConfigX509ConfigPolicyIds) []CertificateConfigX509ConfigPolicyIds { @@ -2415,23 +2448,26 @@ func canonicalizeNewCertificateConfigX509ConfigAdditionalExtensionsSet(c *Client if des == nil { return nw } - var reorderedNew []CertificateConfigX509ConfigAdditionalExtensions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigX509ConfigAdditionalExtensions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigX509ConfigAdditionalExtensionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigX509ConfigAdditionalExtensions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigX509ConfigAdditionalExtensionsSlice(c *Client, des, nw []CertificateConfigX509ConfigAdditionalExtensions) []CertificateConfigX509ConfigAdditionalExtensions { @@ -2527,23 +2563,26 @@ func canonicalizeNewCertificateConfigX509ConfigAdditionalExtensionsObjectIdSet(c if des == nil { return nw } - var reorderedNew []CertificateConfigX509ConfigAdditionalExtensionsObjectId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigX509ConfigAdditionalExtensionsObjectId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigX509ConfigAdditionalExtensionsObjectIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigX509ConfigAdditionalExtensionsObjectId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigX509ConfigAdditionalExtensionsObjectIdSlice(c *Client, des, nw []CertificateConfigX509ConfigAdditionalExtensionsObjectId) []CertificateConfigX509ConfigAdditionalExtensionsObjectId { @@ -2648,23 +2687,26 @@ func canonicalizeNewCertificateConfigPublicKeySet(c *Client, des, nw []Certifica if des == nil { return nw } - var reorderedNew []CertificateConfigPublicKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigPublicKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigPublicKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigPublicKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigPublicKeySlice(c *Client, des, nw []CertificateConfigPublicKey) []CertificateConfigPublicKey { @@ -2766,23 +2808,26 @@ func canonicalizeNewCertificateRevocationDetailsSet(c *Client, des, nw []Certifi if des == nil { return nw } - var reorderedNew []CertificateRevocationDetails + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateRevocationDetails for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateRevocationDetailsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateRevocationDetails(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateRevocationDetailsSlice(c *Client, des, nw []CertificateRevocationDetails) []CertificateRevocationDetails { @@ -2901,23 +2946,26 @@ func canonicalizeNewCertificateCertificateDescriptionSet(c *Client, des, nw []Ce if des == nil { return nw } - var reorderedNew []CertificateCertificateDescription + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescription for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescription(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionSlice(c *Client, des, nw []CertificateCertificateDescription) []CertificateCertificateDescription { @@ -3040,23 +3088,26 @@ func canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSet(c *Cl if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionSubjectDescription + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionSubjectDescription for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionSubjectDescriptionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionSubjectDescription(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSlice(c *Client, des, nw []CertificateCertificateDescriptionSubjectDescription) []CertificateCertificateDescriptionSubjectDescription { @@ -3211,23 +3262,26 @@ func canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubjectSe if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionSubjectDescriptionSubject + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionSubjectDescriptionSubject for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionSubjectDescriptionSubjectNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubject(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubjectSlice(c *Client, des, nw []CertificateCertificateDescriptionSubjectDescriptionSubject) []CertificateCertificateDescriptionSubjectDescriptionSubject { @@ -3352,23 +3406,26 @@ func canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubjectAl if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionSubjectDescriptionSubjectAltName + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionSubjectDescriptionSubjectAltName for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionSubjectDescriptionSubjectAltNameNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubjectAltName(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubjectAltNameSlice(c *Client, des, nw []CertificateCertificateDescriptionSubjectDescriptionSubjectAltName) []CertificateCertificateDescriptionSubjectDescriptionSubjectAltName { @@ -3477,23 +3534,26 @@ func canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubjectAl if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSans + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSans for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSansNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSans(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSansSlice(c *Client, des, nw []CertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSans) []CertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSans { @@ -3589,23 +3649,26 @@ func canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubjectAl if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSansObjectId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSansObjectId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSansObjectIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSansObjectId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSansObjectIdSlice(c *Client, des, nw []CertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSansObjectId) []CertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSansObjectId { @@ -3712,23 +3775,26 @@ func canonicalizeNewCertificateCertificateDescriptionX509DescriptionSet(c *Clien if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionX509Description + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionX509Description for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionX509DescriptionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionX509Description(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionX509DescriptionSlice(c *Client, des, nw []CertificateCertificateDescriptionX509Description) []CertificateCertificateDescriptionX509Description { @@ -3825,23 +3891,26 @@ func canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsageSet( if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionX509DescriptionKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionX509DescriptionKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionX509DescriptionKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsageSlice(c *Client, des, nw []CertificateCertificateDescriptionX509DescriptionKeyUsage) []CertificateCertificateDescriptionX509DescriptionKeyUsage { @@ -4004,23 +4073,26 @@ func canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsageBase if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionX509DescriptionKeyUsageBaseKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionX509DescriptionKeyUsageBaseKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionX509DescriptionKeyUsageBaseKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsageBaseKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsageBaseKeyUsageSlice(c *Client, des, nw []CertificateCertificateDescriptionX509DescriptionKeyUsageBaseKeyUsage) []CertificateCertificateDescriptionX509DescriptionKeyUsageBaseKeyUsage { @@ -4159,23 +4231,26 @@ func canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsageExte if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionX509DescriptionKeyUsageExtendedKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionX509DescriptionKeyUsageExtendedKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionX509DescriptionKeyUsageExtendedKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsageExtendedKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsageExtendedKeyUsageSlice(c *Client, des, nw []CertificateCertificateDescriptionX509DescriptionKeyUsageExtendedKeyUsage) []CertificateCertificateDescriptionX509DescriptionKeyUsageExtendedKeyUsage { @@ -4271,23 +4346,26 @@ func canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsageUnkn if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionX509DescriptionKeyUsageUnknownExtendedKeyUsages + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionX509DescriptionKeyUsageUnknownExtendedKeyUsages for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionX509DescriptionKeyUsageUnknownExtendedKeyUsagesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsageUnknownExtendedKeyUsages(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsageUnknownExtendedKeyUsagesSlice(c *Client, des, nw []CertificateCertificateDescriptionX509DescriptionKeyUsageUnknownExtendedKeyUsages) []CertificateCertificateDescriptionX509DescriptionKeyUsageUnknownExtendedKeyUsages { @@ -4412,23 +4490,26 @@ func canonicalizeNewCertificateCertificateDescriptionX509DescriptionCaOptionsSet if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionX509DescriptionCaOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionX509DescriptionCaOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionX509DescriptionCaOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionX509DescriptionCaOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionX509DescriptionCaOptionsSlice(c *Client, des, nw []CertificateCertificateDescriptionX509DescriptionCaOptions) []CertificateCertificateDescriptionX509DescriptionCaOptions { @@ -4524,23 +4605,26 @@ func canonicalizeNewCertificateCertificateDescriptionX509DescriptionPolicyIdsSet if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionX509DescriptionPolicyIds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionX509DescriptionPolicyIds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionX509DescriptionPolicyIdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionX509DescriptionPolicyIds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionX509DescriptionPolicyIdsSlice(c *Client, des, nw []CertificateCertificateDescriptionX509DescriptionPolicyIds) []CertificateCertificateDescriptionX509DescriptionPolicyIds { @@ -4649,23 +4733,26 @@ func canonicalizeNewCertificateCertificateDescriptionX509DescriptionAdditionalEx if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionX509DescriptionAdditionalExtensions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionX509DescriptionAdditionalExtensions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionX509DescriptionAdditionalExtensionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionX509DescriptionAdditionalExtensions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionX509DescriptionAdditionalExtensionsSlice(c *Client, des, nw []CertificateCertificateDescriptionX509DescriptionAdditionalExtensions) []CertificateCertificateDescriptionX509DescriptionAdditionalExtensions { @@ -4761,23 +4848,26 @@ func canonicalizeNewCertificateCertificateDescriptionX509DescriptionAdditionalEx if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionX509DescriptionAdditionalExtensionsObjectId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionX509DescriptionAdditionalExtensionsObjectId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionX509DescriptionAdditionalExtensionsObjectIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionX509DescriptionAdditionalExtensionsObjectId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionX509DescriptionAdditionalExtensionsObjectIdSlice(c *Client, des, nw []CertificateCertificateDescriptionX509DescriptionAdditionalExtensionsObjectId) []CertificateCertificateDescriptionX509DescriptionAdditionalExtensionsObjectId { @@ -4882,23 +4972,26 @@ func canonicalizeNewCertificateCertificateDescriptionPublicKeySet(c *Client, des if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionPublicKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionPublicKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionPublicKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionPublicKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionPublicKeySlice(c *Client, des, nw []CertificateCertificateDescriptionPublicKey) []CertificateCertificateDescriptionPublicKey { @@ -4997,23 +5090,26 @@ func canonicalizeNewCertificateCertificateDescriptionSubjectKeyIdSet(c *Client, if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionSubjectKeyId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionSubjectKeyId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionSubjectKeyIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionSubjectKeyId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionSubjectKeyIdSlice(c *Client, des, nw []CertificateCertificateDescriptionSubjectKeyId) []CertificateCertificateDescriptionSubjectKeyId { @@ -5112,23 +5208,26 @@ func canonicalizeNewCertificateCertificateDescriptionAuthorityKeyIdSet(c *Client if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionAuthorityKeyId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionAuthorityKeyId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionAuthorityKeyIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionAuthorityKeyId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionAuthorityKeyIdSlice(c *Client, des, nw []CertificateCertificateDescriptionAuthorityKeyId) []CertificateCertificateDescriptionAuthorityKeyId { @@ -5227,23 +5326,26 @@ func canonicalizeNewCertificateCertificateDescriptionCertFingerprintSet(c *Clien if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionCertFingerprint + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionCertFingerprint for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionCertFingerprintNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionCertFingerprint(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionCertFingerprintSlice(c *Client, des, nw []CertificateCertificateDescriptionCertFingerprint) []CertificateCertificateDescriptionCertFingerprint { diff --git a/services/google/privateca/beta/certificate_template_internal.go b/services/google/privateca/beta/certificate_template_internal.go index 5f21b1f05f..194293fbe4 100755 --- a/services/google/privateca/beta/certificate_template_internal.go +++ b/services/google/privateca/beta/certificate_template_internal.go @@ -739,23 +739,26 @@ func canonicalizeNewCertificateTemplatePredefinedValuesSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []CertificateTemplatePredefinedValues + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplatePredefinedValues for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplatePredefinedValuesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplatePredefinedValues(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplatePredefinedValuesSlice(c *Client, des, nw []CertificateTemplatePredefinedValues) []CertificateTemplatePredefinedValues { @@ -852,23 +855,26 @@ func canonicalizeNewCertificateTemplatePredefinedValuesKeyUsageSet(c *Client, de if des == nil { return nw } - var reorderedNew []CertificateTemplatePredefinedValuesKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplatePredefinedValuesKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplatePredefinedValuesKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplatePredefinedValuesKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplatePredefinedValuesKeyUsageSlice(c *Client, des, nw []CertificateTemplatePredefinedValuesKeyUsage) []CertificateTemplatePredefinedValuesKeyUsage { @@ -1031,23 +1037,26 @@ func canonicalizeNewCertificateTemplatePredefinedValuesKeyUsageBaseKeyUsageSet(c if des == nil { return nw } - var reorderedNew []CertificateTemplatePredefinedValuesKeyUsageBaseKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplatePredefinedValuesKeyUsageBaseKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplatePredefinedValuesKeyUsageBaseKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplatePredefinedValuesKeyUsageBaseKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplatePredefinedValuesKeyUsageBaseKeyUsageSlice(c *Client, des, nw []CertificateTemplatePredefinedValuesKeyUsageBaseKeyUsage) []CertificateTemplatePredefinedValuesKeyUsageBaseKeyUsage { @@ -1186,23 +1195,26 @@ func canonicalizeNewCertificateTemplatePredefinedValuesKeyUsageExtendedKeyUsageS if des == nil { return nw } - var reorderedNew []CertificateTemplatePredefinedValuesKeyUsageExtendedKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplatePredefinedValuesKeyUsageExtendedKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplatePredefinedValuesKeyUsageExtendedKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplatePredefinedValuesKeyUsageExtendedKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplatePredefinedValuesKeyUsageExtendedKeyUsageSlice(c *Client, des, nw []CertificateTemplatePredefinedValuesKeyUsageExtendedKeyUsage) []CertificateTemplatePredefinedValuesKeyUsageExtendedKeyUsage { @@ -1298,23 +1310,26 @@ func canonicalizeNewCertificateTemplatePredefinedValuesKeyUsageUnknownExtendedKe if des == nil { return nw } - var reorderedNew []CertificateTemplatePredefinedValuesKeyUsageUnknownExtendedKeyUsages + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplatePredefinedValuesKeyUsageUnknownExtendedKeyUsages for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplatePredefinedValuesKeyUsageUnknownExtendedKeyUsagesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplatePredefinedValuesKeyUsageUnknownExtendedKeyUsages(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplatePredefinedValuesKeyUsageUnknownExtendedKeyUsagesSlice(c *Client, des, nw []CertificateTemplatePredefinedValuesKeyUsageUnknownExtendedKeyUsages) []CertificateTemplatePredefinedValuesKeyUsageUnknownExtendedKeyUsages { @@ -1419,23 +1434,26 @@ func canonicalizeNewCertificateTemplatePredefinedValuesCaOptionsSet(c *Client, d if des == nil { return nw } - var reorderedNew []CertificateTemplatePredefinedValuesCaOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplatePredefinedValuesCaOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplatePredefinedValuesCaOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplatePredefinedValuesCaOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplatePredefinedValuesCaOptionsSlice(c *Client, des, nw []CertificateTemplatePredefinedValuesCaOptions) []CertificateTemplatePredefinedValuesCaOptions { @@ -1531,23 +1549,26 @@ func canonicalizeNewCertificateTemplatePredefinedValuesPolicyIdsSet(c *Client, d if des == nil { return nw } - var reorderedNew []CertificateTemplatePredefinedValuesPolicyIds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplatePredefinedValuesPolicyIds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplatePredefinedValuesPolicyIdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplatePredefinedValuesPolicyIds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplatePredefinedValuesPolicyIdsSlice(c *Client, des, nw []CertificateTemplatePredefinedValuesPolicyIds) []CertificateTemplatePredefinedValuesPolicyIds { @@ -1656,23 +1677,26 @@ func canonicalizeNewCertificateTemplatePredefinedValuesAdditionalExtensionsSet(c if des == nil { return nw } - var reorderedNew []CertificateTemplatePredefinedValuesAdditionalExtensions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplatePredefinedValuesAdditionalExtensions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplatePredefinedValuesAdditionalExtensionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplatePredefinedValuesAdditionalExtensions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplatePredefinedValuesAdditionalExtensionsSlice(c *Client, des, nw []CertificateTemplatePredefinedValuesAdditionalExtensions) []CertificateTemplatePredefinedValuesAdditionalExtensions { @@ -1768,23 +1792,26 @@ func canonicalizeNewCertificateTemplatePredefinedValuesAdditionalExtensionsObjec if des == nil { return nw } - var reorderedNew []CertificateTemplatePredefinedValuesAdditionalExtensionsObjectId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplatePredefinedValuesAdditionalExtensionsObjectId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplatePredefinedValuesAdditionalExtensionsObjectIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplatePredefinedValuesAdditionalExtensionsObjectId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplatePredefinedValuesAdditionalExtensionsObjectIdSlice(c *Client, des, nw []CertificateTemplatePredefinedValuesAdditionalExtensionsObjectId) []CertificateTemplatePredefinedValuesAdditionalExtensionsObjectId { @@ -1893,23 +1920,26 @@ func canonicalizeNewCertificateTemplateIdentityConstraintsSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []CertificateTemplateIdentityConstraints + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplateIdentityConstraints for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplateIdentityConstraintsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplateIdentityConstraints(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplateIdentityConstraintsSlice(c *Client, des, nw []CertificateTemplateIdentityConstraints) []CertificateTemplateIdentityConstraints { @@ -2032,23 +2062,26 @@ func canonicalizeNewCertificateTemplateIdentityConstraintsCelExpressionSet(c *Cl if des == nil { return nw } - var reorderedNew []CertificateTemplateIdentityConstraintsCelExpression + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplateIdentityConstraintsCelExpression for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplateIdentityConstraintsCelExpressionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplateIdentityConstraintsCelExpression(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplateIdentityConstraintsCelExpressionSlice(c *Client, des, nw []CertificateTemplateIdentityConstraintsCelExpression) []CertificateTemplateIdentityConstraintsCelExpression { @@ -2147,23 +2180,26 @@ func canonicalizeNewCertificateTemplatePassthroughExtensionsSet(c *Client, des, if des == nil { return nw } - var reorderedNew []CertificateTemplatePassthroughExtensions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplatePassthroughExtensions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplatePassthroughExtensionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplatePassthroughExtensions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplatePassthroughExtensionsSlice(c *Client, des, nw []CertificateTemplatePassthroughExtensions) []CertificateTemplatePassthroughExtensions { @@ -2259,23 +2295,26 @@ func canonicalizeNewCertificateTemplatePassthroughExtensionsAdditionalExtensions if des == nil { return nw } - var reorderedNew []CertificateTemplatePassthroughExtensionsAdditionalExtensions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplatePassthroughExtensionsAdditionalExtensions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplatePassthroughExtensionsAdditionalExtensionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplatePassthroughExtensionsAdditionalExtensions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplatePassthroughExtensionsAdditionalExtensionsSlice(c *Client, des, nw []CertificateTemplatePassthroughExtensionsAdditionalExtensions) []CertificateTemplatePassthroughExtensionsAdditionalExtensions { diff --git a/services/google/privateca/ca_pool_internal.go b/services/google/privateca/ca_pool_internal.go index 5552efe9a0..be42933d70 100755 --- a/services/google/privateca/ca_pool_internal.go +++ b/services/google/privateca/ca_pool_internal.go @@ -762,23 +762,26 @@ func canonicalizeNewCaPoolIssuancePolicySet(c *Client, des, nw []CaPoolIssuanceP if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicySlice(c *Client, des, nw []CaPoolIssuancePolicy) []CaPoolIssuancePolicy { @@ -893,23 +896,26 @@ func canonicalizeNewCaPoolIssuancePolicyAllowedKeyTypesSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyAllowedKeyTypes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyAllowedKeyTypes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyAllowedKeyTypesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyAllowedKeyTypes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyAllowedKeyTypesSlice(c *Client, des, nw []CaPoolIssuancePolicyAllowedKeyTypes) []CaPoolIssuancePolicyAllowedKeyTypes { @@ -1011,23 +1017,26 @@ func canonicalizeNewCaPoolIssuancePolicyAllowedKeyTypesRsaSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyAllowedKeyTypesRsa + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyAllowedKeyTypesRsa for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyAllowedKeyTypesRsaNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyAllowedKeyTypesRsa(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyAllowedKeyTypesRsaSlice(c *Client, des, nw []CaPoolIssuancePolicyAllowedKeyTypesRsa) []CaPoolIssuancePolicyAllowedKeyTypesRsa { @@ -1123,23 +1132,26 @@ func canonicalizeNewCaPoolIssuancePolicyAllowedKeyTypesEllipticCurveSet(c *Clien if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyAllowedKeyTypesEllipticCurve + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyAllowedKeyTypesEllipticCurve for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyAllowedKeyTypesEllipticCurveNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyAllowedKeyTypesEllipticCurve(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyAllowedKeyTypesEllipticCurveSlice(c *Client, des, nw []CaPoolIssuancePolicyAllowedKeyTypesEllipticCurve) []CaPoolIssuancePolicyAllowedKeyTypesEllipticCurve { @@ -1246,23 +1258,26 @@ func canonicalizeNewCaPoolIssuancePolicyAllowedIssuanceModesSet(c *Client, des, if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyAllowedIssuanceModes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyAllowedIssuanceModes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyAllowedIssuanceModesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyAllowedIssuanceModes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyAllowedIssuanceModesSlice(c *Client, des, nw []CaPoolIssuancePolicyAllowedIssuanceModes) []CaPoolIssuancePolicyAllowedIssuanceModes { @@ -1369,23 +1384,26 @@ func canonicalizeNewCaPoolIssuancePolicyBaselineValuesSet(c *Client, des, nw []C if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyBaselineValues + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyBaselineValues for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyBaselineValuesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyBaselineValues(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyBaselineValuesSlice(c *Client, des, nw []CaPoolIssuancePolicyBaselineValues) []CaPoolIssuancePolicyBaselineValues { @@ -1482,23 +1500,26 @@ func canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsageSet(c *Client, des if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyBaselineValuesKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyBaselineValuesKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyBaselineValuesKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsageSlice(c *Client, des, nw []CaPoolIssuancePolicyBaselineValuesKeyUsage) []CaPoolIssuancePolicyBaselineValuesKeyUsage { @@ -1661,23 +1682,26 @@ func canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsageBaseKeyUsageSet(c if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyBaselineValuesKeyUsageBaseKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyBaselineValuesKeyUsageBaseKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyBaselineValuesKeyUsageBaseKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsageBaseKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsageBaseKeyUsageSlice(c *Client, des, nw []CaPoolIssuancePolicyBaselineValuesKeyUsageBaseKeyUsage) []CaPoolIssuancePolicyBaselineValuesKeyUsageBaseKeyUsage { @@ -1816,23 +1840,26 @@ func canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsageExtendedKeyUsageSe if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyBaselineValuesKeyUsageExtendedKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyBaselineValuesKeyUsageExtendedKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyBaselineValuesKeyUsageExtendedKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsageExtendedKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsageExtendedKeyUsageSlice(c *Client, des, nw []CaPoolIssuancePolicyBaselineValuesKeyUsageExtendedKeyUsage) []CaPoolIssuancePolicyBaselineValuesKeyUsageExtendedKeyUsage { @@ -1928,23 +1955,26 @@ func canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsageUnknownExtendedKey if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyBaselineValuesKeyUsageUnknownExtendedKeyUsages + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyBaselineValuesKeyUsageUnknownExtendedKeyUsages for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyBaselineValuesKeyUsageUnknownExtendedKeyUsagesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsageUnknownExtendedKeyUsages(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyBaselineValuesKeyUsageUnknownExtendedKeyUsagesSlice(c *Client, des, nw []CaPoolIssuancePolicyBaselineValuesKeyUsageUnknownExtendedKeyUsages) []CaPoolIssuancePolicyBaselineValuesKeyUsageUnknownExtendedKeyUsages { @@ -2049,23 +2079,26 @@ func canonicalizeNewCaPoolIssuancePolicyBaselineValuesCaOptionsSet(c *Client, de if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyBaselineValuesCaOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyBaselineValuesCaOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyBaselineValuesCaOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyBaselineValuesCaOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyBaselineValuesCaOptionsSlice(c *Client, des, nw []CaPoolIssuancePolicyBaselineValuesCaOptions) []CaPoolIssuancePolicyBaselineValuesCaOptions { @@ -2161,23 +2194,26 @@ func canonicalizeNewCaPoolIssuancePolicyBaselineValuesPolicyIdsSet(c *Client, de if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyBaselineValuesPolicyIds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyBaselineValuesPolicyIds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyBaselineValuesPolicyIdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyBaselineValuesPolicyIds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyBaselineValuesPolicyIdsSlice(c *Client, des, nw []CaPoolIssuancePolicyBaselineValuesPolicyIds) []CaPoolIssuancePolicyBaselineValuesPolicyIds { @@ -2286,23 +2322,26 @@ func canonicalizeNewCaPoolIssuancePolicyBaselineValuesAdditionalExtensionsSet(c if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyBaselineValuesAdditionalExtensions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyBaselineValuesAdditionalExtensions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyBaselineValuesAdditionalExtensionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyBaselineValuesAdditionalExtensions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyBaselineValuesAdditionalExtensionsSlice(c *Client, des, nw []CaPoolIssuancePolicyBaselineValuesAdditionalExtensions) []CaPoolIssuancePolicyBaselineValuesAdditionalExtensions { @@ -2398,23 +2437,26 @@ func canonicalizeNewCaPoolIssuancePolicyBaselineValuesAdditionalExtensionsObject if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyBaselineValuesAdditionalExtensionsObjectId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyBaselineValuesAdditionalExtensionsObjectId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyBaselineValuesAdditionalExtensionsObjectIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyBaselineValuesAdditionalExtensionsObjectId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyBaselineValuesAdditionalExtensionsObjectIdSlice(c *Client, des, nw []CaPoolIssuancePolicyBaselineValuesAdditionalExtensionsObjectId) []CaPoolIssuancePolicyBaselineValuesAdditionalExtensionsObjectId { @@ -2523,23 +2565,26 @@ func canonicalizeNewCaPoolIssuancePolicyIdentityConstraintsSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyIdentityConstraints + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyIdentityConstraints for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyIdentityConstraintsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyIdentityConstraints(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyIdentityConstraintsSlice(c *Client, des, nw []CaPoolIssuancePolicyIdentityConstraints) []CaPoolIssuancePolicyIdentityConstraints { @@ -2662,23 +2707,26 @@ func canonicalizeNewCaPoolIssuancePolicyIdentityConstraintsCelExpressionSet(c *C if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyIdentityConstraintsCelExpression + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyIdentityConstraintsCelExpression for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyIdentityConstraintsCelExpressionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyIdentityConstraintsCelExpression(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyIdentityConstraintsCelExpressionSlice(c *Client, des, nw []CaPoolIssuancePolicyIdentityConstraintsCelExpression) []CaPoolIssuancePolicyIdentityConstraintsCelExpression { @@ -2777,23 +2825,26 @@ func canonicalizeNewCaPoolIssuancePolicyPassthroughExtensionsSet(c *Client, des, if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyPassthroughExtensions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyPassthroughExtensions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyPassthroughExtensionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyPassthroughExtensions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyPassthroughExtensionsSlice(c *Client, des, nw []CaPoolIssuancePolicyPassthroughExtensions) []CaPoolIssuancePolicyPassthroughExtensions { @@ -2889,23 +2940,26 @@ func canonicalizeNewCaPoolIssuancePolicyPassthroughExtensionsAdditionalExtension if des == nil { return nw } - var reorderedNew []CaPoolIssuancePolicyPassthroughExtensionsAdditionalExtensions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolIssuancePolicyPassthroughExtensionsAdditionalExtensions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolIssuancePolicyPassthroughExtensionsAdditionalExtensionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolIssuancePolicyPassthroughExtensionsAdditionalExtensions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolIssuancePolicyPassthroughExtensionsAdditionalExtensionsSlice(c *Client, des, nw []CaPoolIssuancePolicyPassthroughExtensionsAdditionalExtensions) []CaPoolIssuancePolicyPassthroughExtensionsAdditionalExtensions { @@ -3012,23 +3066,26 @@ func canonicalizeNewCaPoolPublishingOptionsSet(c *Client, des, nw []CaPoolPublis if des == nil { return nw } - var reorderedNew []CaPoolPublishingOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CaPoolPublishingOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCaPoolPublishingOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCaPoolPublishingOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCaPoolPublishingOptionsSlice(c *Client, des, nw []CaPoolPublishingOptions) []CaPoolPublishingOptions { diff --git a/services/google/privateca/certificate_authority_internal.go b/services/google/privateca/certificate_authority_internal.go index e9ca94a167..882091b513 100755 --- a/services/google/privateca/certificate_authority_internal.go +++ b/services/google/privateca/certificate_authority_internal.go @@ -1027,23 +1027,26 @@ func canonicalizeNewCertificateAuthorityConfigSet(c *Client, des, nw []Certifica if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigSlice(c *Client, des, nw []CertificateAuthorityConfig) []CertificateAuthorityConfig { @@ -1138,23 +1141,26 @@ func canonicalizeNewCertificateAuthorityConfigSubjectConfigSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigSubjectConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigSubjectConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigSubjectConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigSubjectConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigSubjectConfigSlice(c *Client, des, nw []CertificateAuthorityConfigSubjectConfig) []CertificateAuthorityConfigSubjectConfig { @@ -1309,23 +1315,26 @@ func canonicalizeNewCertificateAuthorityConfigSubjectConfigSubjectSet(c *Client, if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigSubjectConfigSubject + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigSubjectConfigSubject for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigSubjectConfigSubjectNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigSubjectConfigSubject(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigSubjectConfigSubjectSlice(c *Client, des, nw []CertificateAuthorityConfigSubjectConfigSubject) []CertificateAuthorityConfigSubjectConfigSubject { @@ -1450,23 +1459,26 @@ func canonicalizeNewCertificateAuthorityConfigSubjectConfigSubjectAltNameSet(c * if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigSubjectConfigSubjectAltName + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigSubjectConfigSubjectAltName for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigSubjectConfigSubjectAltNameNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigSubjectConfigSubjectAltName(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigSubjectConfigSubjectAltNameSlice(c *Client, des, nw []CertificateAuthorityConfigSubjectConfigSubjectAltName) []CertificateAuthorityConfigSubjectConfigSubjectAltName { @@ -1575,23 +1587,26 @@ func canonicalizeNewCertificateAuthorityConfigSubjectConfigSubjectAltNameCustomS if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSans + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSans for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSansNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSans(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSansSlice(c *Client, des, nw []CertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSans) []CertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSans { @@ -1687,23 +1702,26 @@ func canonicalizeNewCertificateAuthorityConfigSubjectConfigSubjectAltNameCustomS if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSansObjectId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSansObjectId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSansObjectIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSansObjectId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSansObjectIdSlice(c *Client, des, nw []CertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSansObjectId) []CertificateAuthorityConfigSubjectConfigSubjectAltNameCustomSansObjectId { @@ -1805,23 +1823,26 @@ func canonicalizeNewCertificateAuthorityConfigX509ConfigSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigX509Config + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigX509Config for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigX509ConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigX509Config(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigX509ConfigSlice(c *Client, des, nw []CertificateAuthorityConfigX509Config) []CertificateAuthorityConfigX509Config { @@ -1918,23 +1939,26 @@ func canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsageSet(c *Client, d if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigX509ConfigKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigX509ConfigKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigX509ConfigKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsageSlice(c *Client, des, nw []CertificateAuthorityConfigX509ConfigKeyUsage) []CertificateAuthorityConfigX509ConfigKeyUsage { @@ -2097,23 +2121,26 @@ func canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsageBaseKeyUsageSet( if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigX509ConfigKeyUsageBaseKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigX509ConfigKeyUsageBaseKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigX509ConfigKeyUsageBaseKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsageBaseKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsageBaseKeyUsageSlice(c *Client, des, nw []CertificateAuthorityConfigX509ConfigKeyUsageBaseKeyUsage) []CertificateAuthorityConfigX509ConfigKeyUsageBaseKeyUsage { @@ -2252,23 +2279,26 @@ func canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsageExtendedKeyUsage if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigX509ConfigKeyUsageExtendedKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigX509ConfigKeyUsageExtendedKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigX509ConfigKeyUsageExtendedKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsageExtendedKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsageExtendedKeyUsageSlice(c *Client, des, nw []CertificateAuthorityConfigX509ConfigKeyUsageExtendedKeyUsage) []CertificateAuthorityConfigX509ConfigKeyUsageExtendedKeyUsage { @@ -2364,23 +2394,26 @@ func canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsageUnknownExtendedK if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigX509ConfigKeyUsageUnknownExtendedKeyUsages + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigX509ConfigKeyUsageUnknownExtendedKeyUsages for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigX509ConfigKeyUsageUnknownExtendedKeyUsagesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsageUnknownExtendedKeyUsages(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigX509ConfigKeyUsageUnknownExtendedKeyUsagesSlice(c *Client, des, nw []CertificateAuthorityConfigX509ConfigKeyUsageUnknownExtendedKeyUsages) []CertificateAuthorityConfigX509ConfigKeyUsageUnknownExtendedKeyUsages { @@ -2485,23 +2518,26 @@ func canonicalizeNewCertificateAuthorityConfigX509ConfigCaOptionsSet(c *Client, if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigX509ConfigCaOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigX509ConfigCaOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigX509ConfigCaOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigX509ConfigCaOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigX509ConfigCaOptionsSlice(c *Client, des, nw []CertificateAuthorityConfigX509ConfigCaOptions) []CertificateAuthorityConfigX509ConfigCaOptions { @@ -2597,23 +2633,26 @@ func canonicalizeNewCertificateAuthorityConfigX509ConfigPolicyIdsSet(c *Client, if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigX509ConfigPolicyIds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigX509ConfigPolicyIds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigX509ConfigPolicyIdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigX509ConfigPolicyIds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigX509ConfigPolicyIdsSlice(c *Client, des, nw []CertificateAuthorityConfigX509ConfigPolicyIds) []CertificateAuthorityConfigX509ConfigPolicyIds { @@ -2722,23 +2761,26 @@ func canonicalizeNewCertificateAuthorityConfigX509ConfigAdditionalExtensionsSet( if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigX509ConfigAdditionalExtensions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigX509ConfigAdditionalExtensions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigX509ConfigAdditionalExtensionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigX509ConfigAdditionalExtensions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigX509ConfigAdditionalExtensionsSlice(c *Client, des, nw []CertificateAuthorityConfigX509ConfigAdditionalExtensions) []CertificateAuthorityConfigX509ConfigAdditionalExtensions { @@ -2834,23 +2876,26 @@ func canonicalizeNewCertificateAuthorityConfigX509ConfigAdditionalExtensionsObje if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigX509ConfigAdditionalExtensionsObjectId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigX509ConfigAdditionalExtensionsObjectId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigX509ConfigAdditionalExtensionsObjectIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigX509ConfigAdditionalExtensionsObjectId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigX509ConfigAdditionalExtensionsObjectIdSlice(c *Client, des, nw []CertificateAuthorityConfigX509ConfigAdditionalExtensionsObjectId) []CertificateAuthorityConfigX509ConfigAdditionalExtensionsObjectId { @@ -2955,23 +3000,26 @@ func canonicalizeNewCertificateAuthorityConfigPublicKeySet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []CertificateAuthorityConfigPublicKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityConfigPublicKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityConfigPublicKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityConfigPublicKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityConfigPublicKeySlice(c *Client, des, nw []CertificateAuthorityConfigPublicKey) []CertificateAuthorityConfigPublicKey { @@ -3093,23 +3141,26 @@ func canonicalizeNewCertificateAuthorityKeySpecSet(c *Client, des, nw []Certific if des == nil { return nw } - var reorderedNew []CertificateAuthorityKeySpec + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityKeySpec for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityKeySpecNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityKeySpec(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityKeySpecSlice(c *Client, des, nw []CertificateAuthorityKeySpec) []CertificateAuthorityKeySpec { @@ -3228,23 +3279,26 @@ func canonicalizeNewCertificateAuthoritySubordinateConfigSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []CertificateAuthoritySubordinateConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthoritySubordinateConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthoritySubordinateConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthoritySubordinateConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthoritySubordinateConfigSlice(c *Client, des, nw []CertificateAuthoritySubordinateConfig) []CertificateAuthoritySubordinateConfig { @@ -3343,23 +3397,26 @@ func canonicalizeNewCertificateAuthoritySubordinateConfigPemIssuerChainSet(c *Cl if des == nil { return nw } - var reorderedNew []CertificateAuthoritySubordinateConfigPemIssuerChain + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthoritySubordinateConfigPemIssuerChain for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthoritySubordinateConfigPemIssuerChainNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthoritySubordinateConfigPemIssuerChain(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthoritySubordinateConfigPemIssuerChainSlice(c *Client, des, nw []CertificateAuthoritySubordinateConfigPemIssuerChain) []CertificateAuthoritySubordinateConfigPemIssuerChain { @@ -3478,23 +3535,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSet(c *Client, if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptions) []CertificateAuthorityCaCertificateDescriptions { @@ -3617,23 +3677,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescript if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsSubjectDescription + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsSubjectDescription for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescription(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsSubjectDescription) []CertificateAuthorityCaCertificateDescriptionsSubjectDescription { @@ -3788,23 +3851,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescript if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubject + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubject for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubject(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubject) []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubject { @@ -3929,23 +3995,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescript if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltName + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltName for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltName(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltName) []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltName { @@ -4054,23 +4123,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescript if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSans + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSans for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSansNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSans(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSansSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSans) []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSans { @@ -4166,23 +4238,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescript if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSansObjectId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSansObjectId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSansObjectIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSansObjectId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSansObjectIdSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSansObjectId) []CertificateAuthorityCaCertificateDescriptionsSubjectDescriptionSubjectAltNameCustomSansObjectId { @@ -4284,23 +4359,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509Description if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsX509Description + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsX509Description for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsX509DescriptionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509Description(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsX509Description) []CertificateAuthorityCaCertificateDescriptionsX509Description { @@ -4397,23 +4475,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509Description if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsage) []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsage { @@ -4576,23 +4657,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509Description if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageBaseKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageBaseKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageBaseKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageBaseKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageBaseKeyUsageSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageBaseKeyUsage) []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageBaseKeyUsage { @@ -4731,23 +4815,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509Description if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageExtendedKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageExtendedKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageExtendedKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageExtendedKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageExtendedKeyUsageSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageExtendedKeyUsage) []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageExtendedKeyUsage { @@ -4843,23 +4930,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509Description if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageUnknownExtendedKeyUsages + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageUnknownExtendedKeyUsages for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageUnknownExtendedKeyUsagesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageUnknownExtendedKeyUsages(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageUnknownExtendedKeyUsagesSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageUnknownExtendedKeyUsages) []CertificateAuthorityCaCertificateDescriptionsX509DescriptionKeyUsageUnknownExtendedKeyUsages { @@ -4964,23 +5054,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509Description if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsX509DescriptionCaOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsX509DescriptionCaOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsX509DescriptionCaOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionCaOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionCaOptionsSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsX509DescriptionCaOptions) []CertificateAuthorityCaCertificateDescriptionsX509DescriptionCaOptions { @@ -5076,23 +5169,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509Description if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsX509DescriptionPolicyIds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsX509DescriptionPolicyIds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsX509DescriptionPolicyIdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionPolicyIds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionPolicyIdsSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsX509DescriptionPolicyIds) []CertificateAuthorityCaCertificateDescriptionsX509DescriptionPolicyIds { @@ -5201,23 +5297,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509Description if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensionsSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensions) []CertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensions { @@ -5313,23 +5412,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509Description if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensionsObjectId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensionsObjectId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensionsObjectIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensionsObjectId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensionsObjectIdSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensionsObjectId) []CertificateAuthorityCaCertificateDescriptionsX509DescriptionAdditionalExtensionsObjectId { @@ -5434,23 +5536,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsPublicKeySet(c if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsPublicKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsPublicKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsPublicKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsPublicKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsPublicKeySlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsPublicKey) []CertificateAuthorityCaCertificateDescriptionsPublicKey { @@ -5549,23 +5654,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectKeyIdSet if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsSubjectKeyId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsSubjectKeyId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsSubjectKeyIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectKeyId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsSubjectKeyIdSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsSubjectKeyId) []CertificateAuthorityCaCertificateDescriptionsSubjectKeyId { @@ -5664,23 +5772,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsAuthorityKeyIdS if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsAuthorityKeyId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsAuthorityKeyId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsAuthorityKeyIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsAuthorityKeyId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsAuthorityKeyIdSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsAuthorityKeyId) []CertificateAuthorityCaCertificateDescriptionsAuthorityKeyId { @@ -5779,23 +5890,26 @@ func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsCertFingerprint if des == nil { return nw } - var reorderedNew []CertificateAuthorityCaCertificateDescriptionsCertFingerprint + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityCaCertificateDescriptionsCertFingerprint for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityCaCertificateDescriptionsCertFingerprintNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityCaCertificateDescriptionsCertFingerprint(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityCaCertificateDescriptionsCertFingerprintSlice(c *Client, des, nw []CertificateAuthorityCaCertificateDescriptionsCertFingerprint) []CertificateAuthorityCaCertificateDescriptionsCertFingerprint { @@ -5902,23 +6016,26 @@ func canonicalizeNewCertificateAuthorityAccessUrlsSet(c *Client, des, nw []Certi if des == nil { return nw } - var reorderedNew []CertificateAuthorityAccessUrls + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateAuthorityAccessUrls for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateAuthorityAccessUrlsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateAuthorityAccessUrls(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateAuthorityAccessUrlsSlice(c *Client, des, nw []CertificateAuthorityAccessUrls) []CertificateAuthorityAccessUrls { diff --git a/services/google/privateca/certificate_internal.go b/services/google/privateca/certificate_internal.go index b25ea9e119..b958648822 100755 --- a/services/google/privateca/certificate_internal.go +++ b/services/google/privateca/certificate_internal.go @@ -938,23 +938,26 @@ func canonicalizeNewCertificateConfigSet(c *Client, des, nw []CertificateConfig) if des == nil { return nw } - var reorderedNew []CertificateConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigSlice(c *Client, des, nw []CertificateConfig) []CertificateConfig { @@ -1049,23 +1052,26 @@ func canonicalizeNewCertificateConfigSubjectConfigSet(c *Client, des, nw []Certi if des == nil { return nw } - var reorderedNew []CertificateConfigSubjectConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigSubjectConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigSubjectConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigSubjectConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigSubjectConfigSlice(c *Client, des, nw []CertificateConfigSubjectConfig) []CertificateConfigSubjectConfig { @@ -1220,23 +1226,26 @@ func canonicalizeNewCertificateConfigSubjectConfigSubjectSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []CertificateConfigSubjectConfigSubject + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigSubjectConfigSubject for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigSubjectConfigSubjectNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigSubjectConfigSubject(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigSubjectConfigSubjectSlice(c *Client, des, nw []CertificateConfigSubjectConfigSubject) []CertificateConfigSubjectConfigSubject { @@ -1359,23 +1368,26 @@ func canonicalizeNewCertificateConfigSubjectConfigSubjectAltNameSet(c *Client, d if des == nil { return nw } - var reorderedNew []CertificateConfigSubjectConfigSubjectAltName + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigSubjectConfigSubjectAltName for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigSubjectConfigSubjectAltNameNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigSubjectConfigSubjectAltName(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigSubjectConfigSubjectAltNameSlice(c *Client, des, nw []CertificateConfigSubjectConfigSubjectAltName) []CertificateConfigSubjectConfigSubjectAltName { @@ -1482,23 +1494,26 @@ func canonicalizeNewCertificateConfigX509ConfigSet(c *Client, des, nw []Certific if des == nil { return nw } - var reorderedNew []CertificateConfigX509Config + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigX509Config for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigX509ConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigX509Config(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigX509ConfigSlice(c *Client, des, nw []CertificateConfigX509Config) []CertificateConfigX509Config { @@ -1595,23 +1610,26 @@ func canonicalizeNewCertificateConfigX509ConfigKeyUsageSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []CertificateConfigX509ConfigKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigX509ConfigKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigX509ConfigKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigX509ConfigKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigX509ConfigKeyUsageSlice(c *Client, des, nw []CertificateConfigX509ConfigKeyUsage) []CertificateConfigX509ConfigKeyUsage { @@ -1774,23 +1792,26 @@ func canonicalizeNewCertificateConfigX509ConfigKeyUsageBaseKeyUsageSet(c *Client if des == nil { return nw } - var reorderedNew []CertificateConfigX509ConfigKeyUsageBaseKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigX509ConfigKeyUsageBaseKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigX509ConfigKeyUsageBaseKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigX509ConfigKeyUsageBaseKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigX509ConfigKeyUsageBaseKeyUsageSlice(c *Client, des, nw []CertificateConfigX509ConfigKeyUsageBaseKeyUsage) []CertificateConfigX509ConfigKeyUsageBaseKeyUsage { @@ -1929,23 +1950,26 @@ func canonicalizeNewCertificateConfigX509ConfigKeyUsageExtendedKeyUsageSet(c *Cl if des == nil { return nw } - var reorderedNew []CertificateConfigX509ConfigKeyUsageExtendedKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigX509ConfigKeyUsageExtendedKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigX509ConfigKeyUsageExtendedKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigX509ConfigKeyUsageExtendedKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigX509ConfigKeyUsageExtendedKeyUsageSlice(c *Client, des, nw []CertificateConfigX509ConfigKeyUsageExtendedKeyUsage) []CertificateConfigX509ConfigKeyUsageExtendedKeyUsage { @@ -2041,23 +2065,26 @@ func canonicalizeNewCertificateConfigX509ConfigKeyUsageUnknownExtendedKeyUsagesS if des == nil { return nw } - var reorderedNew []CertificateConfigX509ConfigKeyUsageUnknownExtendedKeyUsages + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigX509ConfigKeyUsageUnknownExtendedKeyUsages for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigX509ConfigKeyUsageUnknownExtendedKeyUsagesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigX509ConfigKeyUsageUnknownExtendedKeyUsages(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigX509ConfigKeyUsageUnknownExtendedKeyUsagesSlice(c *Client, des, nw []CertificateConfigX509ConfigKeyUsageUnknownExtendedKeyUsages) []CertificateConfigX509ConfigKeyUsageUnknownExtendedKeyUsages { @@ -2178,23 +2205,26 @@ func canonicalizeNewCertificateConfigX509ConfigCaOptionsSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []CertificateConfigX509ConfigCaOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigX509ConfigCaOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigX509ConfigCaOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigX509ConfigCaOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigX509ConfigCaOptionsSlice(c *Client, des, nw []CertificateConfigX509ConfigCaOptions) []CertificateConfigX509ConfigCaOptions { @@ -2290,23 +2320,26 @@ func canonicalizeNewCertificateConfigX509ConfigPolicyIdsSet(c *Client, des, nw [ if des == nil { return nw } - var reorderedNew []CertificateConfigX509ConfigPolicyIds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigX509ConfigPolicyIds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigX509ConfigPolicyIdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigX509ConfigPolicyIds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigX509ConfigPolicyIdsSlice(c *Client, des, nw []CertificateConfigX509ConfigPolicyIds) []CertificateConfigX509ConfigPolicyIds { @@ -2415,23 +2448,26 @@ func canonicalizeNewCertificateConfigX509ConfigAdditionalExtensionsSet(c *Client if des == nil { return nw } - var reorderedNew []CertificateConfigX509ConfigAdditionalExtensions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigX509ConfigAdditionalExtensions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigX509ConfigAdditionalExtensionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigX509ConfigAdditionalExtensions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigX509ConfigAdditionalExtensionsSlice(c *Client, des, nw []CertificateConfigX509ConfigAdditionalExtensions) []CertificateConfigX509ConfigAdditionalExtensions { @@ -2527,23 +2563,26 @@ func canonicalizeNewCertificateConfigX509ConfigAdditionalExtensionsObjectIdSet(c if des == nil { return nw } - var reorderedNew []CertificateConfigX509ConfigAdditionalExtensionsObjectId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigX509ConfigAdditionalExtensionsObjectId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigX509ConfigAdditionalExtensionsObjectIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigX509ConfigAdditionalExtensionsObjectId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigX509ConfigAdditionalExtensionsObjectIdSlice(c *Client, des, nw []CertificateConfigX509ConfigAdditionalExtensionsObjectId) []CertificateConfigX509ConfigAdditionalExtensionsObjectId { @@ -2648,23 +2687,26 @@ func canonicalizeNewCertificateConfigPublicKeySet(c *Client, des, nw []Certifica if des == nil { return nw } - var reorderedNew []CertificateConfigPublicKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateConfigPublicKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateConfigPublicKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateConfigPublicKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateConfigPublicKeySlice(c *Client, des, nw []CertificateConfigPublicKey) []CertificateConfigPublicKey { @@ -2766,23 +2808,26 @@ func canonicalizeNewCertificateRevocationDetailsSet(c *Client, des, nw []Certifi if des == nil { return nw } - var reorderedNew []CertificateRevocationDetails + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateRevocationDetails for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateRevocationDetailsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateRevocationDetails(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateRevocationDetailsSlice(c *Client, des, nw []CertificateRevocationDetails) []CertificateRevocationDetails { @@ -2901,23 +2946,26 @@ func canonicalizeNewCertificateCertificateDescriptionSet(c *Client, des, nw []Ce if des == nil { return nw } - var reorderedNew []CertificateCertificateDescription + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescription for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescription(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionSlice(c *Client, des, nw []CertificateCertificateDescription) []CertificateCertificateDescription { @@ -3040,23 +3088,26 @@ func canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSet(c *Cl if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionSubjectDescription + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionSubjectDescription for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionSubjectDescriptionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionSubjectDescription(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSlice(c *Client, des, nw []CertificateCertificateDescriptionSubjectDescription) []CertificateCertificateDescriptionSubjectDescription { @@ -3211,23 +3262,26 @@ func canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubjectSe if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionSubjectDescriptionSubject + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionSubjectDescriptionSubject for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionSubjectDescriptionSubjectNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubject(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubjectSlice(c *Client, des, nw []CertificateCertificateDescriptionSubjectDescriptionSubject) []CertificateCertificateDescriptionSubjectDescriptionSubject { @@ -3352,23 +3406,26 @@ func canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubjectAl if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionSubjectDescriptionSubjectAltName + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionSubjectDescriptionSubjectAltName for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionSubjectDescriptionSubjectAltNameNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubjectAltName(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubjectAltNameSlice(c *Client, des, nw []CertificateCertificateDescriptionSubjectDescriptionSubjectAltName) []CertificateCertificateDescriptionSubjectDescriptionSubjectAltName { @@ -3477,23 +3534,26 @@ func canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubjectAl if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSans + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSans for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSansNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSans(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSansSlice(c *Client, des, nw []CertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSans) []CertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSans { @@ -3589,23 +3649,26 @@ func canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubjectAl if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSansObjectId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSansObjectId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSansObjectIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSansObjectId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSansObjectIdSlice(c *Client, des, nw []CertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSansObjectId) []CertificateCertificateDescriptionSubjectDescriptionSubjectAltNameCustomSansObjectId { @@ -3712,23 +3775,26 @@ func canonicalizeNewCertificateCertificateDescriptionX509DescriptionSet(c *Clien if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionX509Description + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionX509Description for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionX509DescriptionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionX509Description(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionX509DescriptionSlice(c *Client, des, nw []CertificateCertificateDescriptionX509Description) []CertificateCertificateDescriptionX509Description { @@ -3825,23 +3891,26 @@ func canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsageSet( if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionX509DescriptionKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionX509DescriptionKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionX509DescriptionKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsageSlice(c *Client, des, nw []CertificateCertificateDescriptionX509DescriptionKeyUsage) []CertificateCertificateDescriptionX509DescriptionKeyUsage { @@ -4004,23 +4073,26 @@ func canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsageBase if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionX509DescriptionKeyUsageBaseKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionX509DescriptionKeyUsageBaseKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionX509DescriptionKeyUsageBaseKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsageBaseKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsageBaseKeyUsageSlice(c *Client, des, nw []CertificateCertificateDescriptionX509DescriptionKeyUsageBaseKeyUsage) []CertificateCertificateDescriptionX509DescriptionKeyUsageBaseKeyUsage { @@ -4159,23 +4231,26 @@ func canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsageExte if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionX509DescriptionKeyUsageExtendedKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionX509DescriptionKeyUsageExtendedKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionX509DescriptionKeyUsageExtendedKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsageExtendedKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsageExtendedKeyUsageSlice(c *Client, des, nw []CertificateCertificateDescriptionX509DescriptionKeyUsageExtendedKeyUsage) []CertificateCertificateDescriptionX509DescriptionKeyUsageExtendedKeyUsage { @@ -4271,23 +4346,26 @@ func canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsageUnkn if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionX509DescriptionKeyUsageUnknownExtendedKeyUsages + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionX509DescriptionKeyUsageUnknownExtendedKeyUsages for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionX509DescriptionKeyUsageUnknownExtendedKeyUsagesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsageUnknownExtendedKeyUsages(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionX509DescriptionKeyUsageUnknownExtendedKeyUsagesSlice(c *Client, des, nw []CertificateCertificateDescriptionX509DescriptionKeyUsageUnknownExtendedKeyUsages) []CertificateCertificateDescriptionX509DescriptionKeyUsageUnknownExtendedKeyUsages { @@ -4412,23 +4490,26 @@ func canonicalizeNewCertificateCertificateDescriptionX509DescriptionCaOptionsSet if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionX509DescriptionCaOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionX509DescriptionCaOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionX509DescriptionCaOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionX509DescriptionCaOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionX509DescriptionCaOptionsSlice(c *Client, des, nw []CertificateCertificateDescriptionX509DescriptionCaOptions) []CertificateCertificateDescriptionX509DescriptionCaOptions { @@ -4524,23 +4605,26 @@ func canonicalizeNewCertificateCertificateDescriptionX509DescriptionPolicyIdsSet if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionX509DescriptionPolicyIds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionX509DescriptionPolicyIds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionX509DescriptionPolicyIdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionX509DescriptionPolicyIds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionX509DescriptionPolicyIdsSlice(c *Client, des, nw []CertificateCertificateDescriptionX509DescriptionPolicyIds) []CertificateCertificateDescriptionX509DescriptionPolicyIds { @@ -4649,23 +4733,26 @@ func canonicalizeNewCertificateCertificateDescriptionX509DescriptionAdditionalEx if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionX509DescriptionAdditionalExtensions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionX509DescriptionAdditionalExtensions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionX509DescriptionAdditionalExtensionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionX509DescriptionAdditionalExtensions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionX509DescriptionAdditionalExtensionsSlice(c *Client, des, nw []CertificateCertificateDescriptionX509DescriptionAdditionalExtensions) []CertificateCertificateDescriptionX509DescriptionAdditionalExtensions { @@ -4761,23 +4848,26 @@ func canonicalizeNewCertificateCertificateDescriptionX509DescriptionAdditionalEx if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionX509DescriptionAdditionalExtensionsObjectId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionX509DescriptionAdditionalExtensionsObjectId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionX509DescriptionAdditionalExtensionsObjectIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionX509DescriptionAdditionalExtensionsObjectId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionX509DescriptionAdditionalExtensionsObjectIdSlice(c *Client, des, nw []CertificateCertificateDescriptionX509DescriptionAdditionalExtensionsObjectId) []CertificateCertificateDescriptionX509DescriptionAdditionalExtensionsObjectId { @@ -4882,23 +4972,26 @@ func canonicalizeNewCertificateCertificateDescriptionPublicKeySet(c *Client, des if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionPublicKey + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionPublicKey for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionPublicKeyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionPublicKey(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionPublicKeySlice(c *Client, des, nw []CertificateCertificateDescriptionPublicKey) []CertificateCertificateDescriptionPublicKey { @@ -4997,23 +5090,26 @@ func canonicalizeNewCertificateCertificateDescriptionSubjectKeyIdSet(c *Client, if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionSubjectKeyId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionSubjectKeyId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionSubjectKeyIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionSubjectKeyId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionSubjectKeyIdSlice(c *Client, des, nw []CertificateCertificateDescriptionSubjectKeyId) []CertificateCertificateDescriptionSubjectKeyId { @@ -5112,23 +5208,26 @@ func canonicalizeNewCertificateCertificateDescriptionAuthorityKeyIdSet(c *Client if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionAuthorityKeyId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionAuthorityKeyId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionAuthorityKeyIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionAuthorityKeyId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionAuthorityKeyIdSlice(c *Client, des, nw []CertificateCertificateDescriptionAuthorityKeyId) []CertificateCertificateDescriptionAuthorityKeyId { @@ -5227,23 +5326,26 @@ func canonicalizeNewCertificateCertificateDescriptionCertFingerprintSet(c *Clien if des == nil { return nw } - var reorderedNew []CertificateCertificateDescriptionCertFingerprint + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateCertificateDescriptionCertFingerprint for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateCertificateDescriptionCertFingerprintNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateCertificateDescriptionCertFingerprint(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateCertificateDescriptionCertFingerprintSlice(c *Client, des, nw []CertificateCertificateDescriptionCertFingerprint) []CertificateCertificateDescriptionCertFingerprint { diff --git a/services/google/privateca/certificate_template_internal.go b/services/google/privateca/certificate_template_internal.go index fc66206c2c..5c3e2d21f9 100755 --- a/services/google/privateca/certificate_template_internal.go +++ b/services/google/privateca/certificate_template_internal.go @@ -739,23 +739,26 @@ func canonicalizeNewCertificateTemplatePredefinedValuesSet(c *Client, des, nw [] if des == nil { return nw } - var reorderedNew []CertificateTemplatePredefinedValues + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplatePredefinedValues for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplatePredefinedValuesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplatePredefinedValues(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplatePredefinedValuesSlice(c *Client, des, nw []CertificateTemplatePredefinedValues) []CertificateTemplatePredefinedValues { @@ -852,23 +855,26 @@ func canonicalizeNewCertificateTemplatePredefinedValuesKeyUsageSet(c *Client, de if des == nil { return nw } - var reorderedNew []CertificateTemplatePredefinedValuesKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplatePredefinedValuesKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplatePredefinedValuesKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplatePredefinedValuesKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplatePredefinedValuesKeyUsageSlice(c *Client, des, nw []CertificateTemplatePredefinedValuesKeyUsage) []CertificateTemplatePredefinedValuesKeyUsage { @@ -1031,23 +1037,26 @@ func canonicalizeNewCertificateTemplatePredefinedValuesKeyUsageBaseKeyUsageSet(c if des == nil { return nw } - var reorderedNew []CertificateTemplatePredefinedValuesKeyUsageBaseKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplatePredefinedValuesKeyUsageBaseKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplatePredefinedValuesKeyUsageBaseKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplatePredefinedValuesKeyUsageBaseKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplatePredefinedValuesKeyUsageBaseKeyUsageSlice(c *Client, des, nw []CertificateTemplatePredefinedValuesKeyUsageBaseKeyUsage) []CertificateTemplatePredefinedValuesKeyUsageBaseKeyUsage { @@ -1186,23 +1195,26 @@ func canonicalizeNewCertificateTemplatePredefinedValuesKeyUsageExtendedKeyUsageS if des == nil { return nw } - var reorderedNew []CertificateTemplatePredefinedValuesKeyUsageExtendedKeyUsage + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplatePredefinedValuesKeyUsageExtendedKeyUsage for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplatePredefinedValuesKeyUsageExtendedKeyUsageNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplatePredefinedValuesKeyUsageExtendedKeyUsage(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplatePredefinedValuesKeyUsageExtendedKeyUsageSlice(c *Client, des, nw []CertificateTemplatePredefinedValuesKeyUsageExtendedKeyUsage) []CertificateTemplatePredefinedValuesKeyUsageExtendedKeyUsage { @@ -1298,23 +1310,26 @@ func canonicalizeNewCertificateTemplatePredefinedValuesKeyUsageUnknownExtendedKe if des == nil { return nw } - var reorderedNew []CertificateTemplatePredefinedValuesKeyUsageUnknownExtendedKeyUsages + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplatePredefinedValuesKeyUsageUnknownExtendedKeyUsages for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplatePredefinedValuesKeyUsageUnknownExtendedKeyUsagesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplatePredefinedValuesKeyUsageUnknownExtendedKeyUsages(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplatePredefinedValuesKeyUsageUnknownExtendedKeyUsagesSlice(c *Client, des, nw []CertificateTemplatePredefinedValuesKeyUsageUnknownExtendedKeyUsages) []CertificateTemplatePredefinedValuesKeyUsageUnknownExtendedKeyUsages { @@ -1419,23 +1434,26 @@ func canonicalizeNewCertificateTemplatePredefinedValuesCaOptionsSet(c *Client, d if des == nil { return nw } - var reorderedNew []CertificateTemplatePredefinedValuesCaOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplatePredefinedValuesCaOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplatePredefinedValuesCaOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplatePredefinedValuesCaOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplatePredefinedValuesCaOptionsSlice(c *Client, des, nw []CertificateTemplatePredefinedValuesCaOptions) []CertificateTemplatePredefinedValuesCaOptions { @@ -1531,23 +1549,26 @@ func canonicalizeNewCertificateTemplatePredefinedValuesPolicyIdsSet(c *Client, d if des == nil { return nw } - var reorderedNew []CertificateTemplatePredefinedValuesPolicyIds + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplatePredefinedValuesPolicyIds for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplatePredefinedValuesPolicyIdsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplatePredefinedValuesPolicyIds(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplatePredefinedValuesPolicyIdsSlice(c *Client, des, nw []CertificateTemplatePredefinedValuesPolicyIds) []CertificateTemplatePredefinedValuesPolicyIds { @@ -1656,23 +1677,26 @@ func canonicalizeNewCertificateTemplatePredefinedValuesAdditionalExtensionsSet(c if des == nil { return nw } - var reorderedNew []CertificateTemplatePredefinedValuesAdditionalExtensions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplatePredefinedValuesAdditionalExtensions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplatePredefinedValuesAdditionalExtensionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplatePredefinedValuesAdditionalExtensions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplatePredefinedValuesAdditionalExtensionsSlice(c *Client, des, nw []CertificateTemplatePredefinedValuesAdditionalExtensions) []CertificateTemplatePredefinedValuesAdditionalExtensions { @@ -1768,23 +1792,26 @@ func canonicalizeNewCertificateTemplatePredefinedValuesAdditionalExtensionsObjec if des == nil { return nw } - var reorderedNew []CertificateTemplatePredefinedValuesAdditionalExtensionsObjectId + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplatePredefinedValuesAdditionalExtensionsObjectId for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplatePredefinedValuesAdditionalExtensionsObjectIdNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplatePredefinedValuesAdditionalExtensionsObjectId(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplatePredefinedValuesAdditionalExtensionsObjectIdSlice(c *Client, des, nw []CertificateTemplatePredefinedValuesAdditionalExtensionsObjectId) []CertificateTemplatePredefinedValuesAdditionalExtensionsObjectId { @@ -1893,23 +1920,26 @@ func canonicalizeNewCertificateTemplateIdentityConstraintsSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []CertificateTemplateIdentityConstraints + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplateIdentityConstraints for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplateIdentityConstraintsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplateIdentityConstraints(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplateIdentityConstraintsSlice(c *Client, des, nw []CertificateTemplateIdentityConstraints) []CertificateTemplateIdentityConstraints { @@ -2032,23 +2062,26 @@ func canonicalizeNewCertificateTemplateIdentityConstraintsCelExpressionSet(c *Cl if des == nil { return nw } - var reorderedNew []CertificateTemplateIdentityConstraintsCelExpression + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplateIdentityConstraintsCelExpression for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplateIdentityConstraintsCelExpressionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplateIdentityConstraintsCelExpression(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplateIdentityConstraintsCelExpressionSlice(c *Client, des, nw []CertificateTemplateIdentityConstraintsCelExpression) []CertificateTemplateIdentityConstraintsCelExpression { @@ -2147,23 +2180,26 @@ func canonicalizeNewCertificateTemplatePassthroughExtensionsSet(c *Client, des, if des == nil { return nw } - var reorderedNew []CertificateTemplatePassthroughExtensions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplatePassthroughExtensions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplatePassthroughExtensionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplatePassthroughExtensions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplatePassthroughExtensionsSlice(c *Client, des, nw []CertificateTemplatePassthroughExtensions) []CertificateTemplatePassthroughExtensions { @@ -2259,23 +2295,26 @@ func canonicalizeNewCertificateTemplatePassthroughExtensionsAdditionalExtensions if des == nil { return nw } - var reorderedNew []CertificateTemplatePassthroughExtensionsAdditionalExtensions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []CertificateTemplatePassthroughExtensionsAdditionalExtensions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareCertificateTemplatePassthroughExtensionsAdditionalExtensionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewCertificateTemplatePassthroughExtensionsAdditionalExtensions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewCertificateTemplatePassthroughExtensionsAdditionalExtensionsSlice(c *Client, des, nw []CertificateTemplatePassthroughExtensionsAdditionalExtensions) []CertificateTemplatePassthroughExtensionsAdditionalExtensions { diff --git a/services/google/pubsub/alpha/topic_internal.go b/services/google/pubsub/alpha/topic_internal.go index 47bc0c8cba..8e5324530e 100755 --- a/services/google/pubsub/alpha/topic_internal.go +++ b/services/google/pubsub/alpha/topic_internal.go @@ -575,23 +575,26 @@ func canonicalizeNewTopicMessageStoragePolicySet(c *Client, des, nw []TopicMessa if des == nil { return nw } - var reorderedNew []TopicMessageStoragePolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TopicMessageStoragePolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTopicMessageStoragePolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTopicMessageStoragePolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTopicMessageStoragePolicySlice(c *Client, des, nw []TopicMessageStoragePolicy) []TopicMessageStoragePolicy { diff --git a/services/google/pubsub/beta/topic_internal.go b/services/google/pubsub/beta/topic_internal.go index 45ff177468..329f79de53 100755 --- a/services/google/pubsub/beta/topic_internal.go +++ b/services/google/pubsub/beta/topic_internal.go @@ -575,23 +575,26 @@ func canonicalizeNewTopicMessageStoragePolicySet(c *Client, des, nw []TopicMessa if des == nil { return nw } - var reorderedNew []TopicMessageStoragePolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TopicMessageStoragePolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTopicMessageStoragePolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTopicMessageStoragePolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTopicMessageStoragePolicySlice(c *Client, des, nw []TopicMessageStoragePolicy) []TopicMessageStoragePolicy { diff --git a/services/google/pubsub/topic_internal.go b/services/google/pubsub/topic_internal.go index 85b5d1a424..92f70783fb 100755 --- a/services/google/pubsub/topic_internal.go +++ b/services/google/pubsub/topic_internal.go @@ -575,23 +575,26 @@ func canonicalizeNewTopicMessageStoragePolicySet(c *Client, des, nw []TopicMessa if des == nil { return nw } - var reorderedNew []TopicMessageStoragePolicy + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []TopicMessageStoragePolicy for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareTopicMessageStoragePolicyNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewTopicMessageStoragePolicy(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewTopicMessageStoragePolicySlice(c *Client, des, nw []TopicMessageStoragePolicy) []TopicMessageStoragePolicy { diff --git a/services/google/recaptchaenterprise/alpha/key_internal.go b/services/google/recaptchaenterprise/alpha/key_internal.go index e7afefc0a9..a6d1afd91a 100755 --- a/services/google/recaptchaenterprise/alpha/key_internal.go +++ b/services/google/recaptchaenterprise/alpha/key_internal.go @@ -693,23 +693,26 @@ func canonicalizeNewKeyWebSettingsSet(c *Client, des, nw []KeyWebSettings) []Key if des == nil { return nw } - var reorderedNew []KeyWebSettings + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []KeyWebSettings for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareKeyWebSettingsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewKeyWebSettings(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewKeyWebSettingsSlice(c *Client, des, nw []KeyWebSettings) []KeyWebSettings { @@ -816,23 +819,26 @@ func canonicalizeNewKeyAndroidSettingsSet(c *Client, des, nw []KeyAndroidSetting if des == nil { return nw } - var reorderedNew []KeyAndroidSettings + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []KeyAndroidSettings for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareKeyAndroidSettingsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewKeyAndroidSettings(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewKeyAndroidSettingsSlice(c *Client, des, nw []KeyAndroidSettings) []KeyAndroidSettings { @@ -939,23 +945,26 @@ func canonicalizeNewKeyIosSettingsSet(c *Client, des, nw []KeyIosSettings) []Key if des == nil { return nw } - var reorderedNew []KeyIosSettings + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []KeyIosSettings for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareKeyIosSettingsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewKeyIosSettings(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewKeyIosSettingsSlice(c *Client, des, nw []KeyIosSettings) []KeyIosSettings { @@ -1057,23 +1066,26 @@ func canonicalizeNewKeyTestingOptionsSet(c *Client, des, nw []KeyTestingOptions) if des == nil { return nw } - var reorderedNew []KeyTestingOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []KeyTestingOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareKeyTestingOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewKeyTestingOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewKeyTestingOptionsSlice(c *Client, des, nw []KeyTestingOptions) []KeyTestingOptions { diff --git a/services/google/recaptchaenterprise/beta/key_internal.go b/services/google/recaptchaenterprise/beta/key_internal.go index 0d7196e367..c460223d79 100755 --- a/services/google/recaptchaenterprise/beta/key_internal.go +++ b/services/google/recaptchaenterprise/beta/key_internal.go @@ -693,23 +693,26 @@ func canonicalizeNewKeyWebSettingsSet(c *Client, des, nw []KeyWebSettings) []Key if des == nil { return nw } - var reorderedNew []KeyWebSettings + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []KeyWebSettings for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareKeyWebSettingsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewKeyWebSettings(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewKeyWebSettingsSlice(c *Client, des, nw []KeyWebSettings) []KeyWebSettings { @@ -816,23 +819,26 @@ func canonicalizeNewKeyAndroidSettingsSet(c *Client, des, nw []KeyAndroidSetting if des == nil { return nw } - var reorderedNew []KeyAndroidSettings + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []KeyAndroidSettings for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareKeyAndroidSettingsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewKeyAndroidSettings(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewKeyAndroidSettingsSlice(c *Client, des, nw []KeyAndroidSettings) []KeyAndroidSettings { @@ -939,23 +945,26 @@ func canonicalizeNewKeyIosSettingsSet(c *Client, des, nw []KeyIosSettings) []Key if des == nil { return nw } - var reorderedNew []KeyIosSettings + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []KeyIosSettings for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareKeyIosSettingsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewKeyIosSettings(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewKeyIosSettingsSlice(c *Client, des, nw []KeyIosSettings) []KeyIosSettings { @@ -1057,23 +1066,26 @@ func canonicalizeNewKeyTestingOptionsSet(c *Client, des, nw []KeyTestingOptions) if des == nil { return nw } - var reorderedNew []KeyTestingOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []KeyTestingOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareKeyTestingOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewKeyTestingOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewKeyTestingOptionsSlice(c *Client, des, nw []KeyTestingOptions) []KeyTestingOptions { diff --git a/services/google/recaptchaenterprise/key_internal.go b/services/google/recaptchaenterprise/key_internal.go index 1d9e5b9e11..36e6afd411 100755 --- a/services/google/recaptchaenterprise/key_internal.go +++ b/services/google/recaptchaenterprise/key_internal.go @@ -693,23 +693,26 @@ func canonicalizeNewKeyWebSettingsSet(c *Client, des, nw []KeyWebSettings) []Key if des == nil { return nw } - var reorderedNew []KeyWebSettings + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []KeyWebSettings for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareKeyWebSettingsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewKeyWebSettings(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewKeyWebSettingsSlice(c *Client, des, nw []KeyWebSettings) []KeyWebSettings { @@ -816,23 +819,26 @@ func canonicalizeNewKeyAndroidSettingsSet(c *Client, des, nw []KeyAndroidSetting if des == nil { return nw } - var reorderedNew []KeyAndroidSettings + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []KeyAndroidSettings for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareKeyAndroidSettingsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewKeyAndroidSettings(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewKeyAndroidSettingsSlice(c *Client, des, nw []KeyAndroidSettings) []KeyAndroidSettings { @@ -939,23 +945,26 @@ func canonicalizeNewKeyIosSettingsSet(c *Client, des, nw []KeyIosSettings) []Key if des == nil { return nw } - var reorderedNew []KeyIosSettings + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []KeyIosSettings for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareKeyIosSettingsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewKeyIosSettings(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewKeyIosSettingsSlice(c *Client, des, nw []KeyIosSettings) []KeyIosSettings { @@ -1057,23 +1066,26 @@ func canonicalizeNewKeyTestingOptionsSet(c *Client, des, nw []KeyTestingOptions) if des == nil { return nw } - var reorderedNew []KeyTestingOptions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []KeyTestingOptions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareKeyTestingOptionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewKeyTestingOptions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewKeyTestingOptionsSlice(c *Client, des, nw []KeyTestingOptions) []KeyTestingOptions { diff --git a/services/google/run/alpha/job_internal.go b/services/google/run/alpha/job_internal.go index b915fc461c..cc68d34120 100755 --- a/services/google/run/alpha/job_internal.go +++ b/services/google/run/alpha/job_internal.go @@ -943,23 +943,26 @@ func canonicalizeNewJobBinaryAuthorizationSet(c *Client, des, nw []JobBinaryAuth if des == nil { return nw } - var reorderedNew []JobBinaryAuthorization + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobBinaryAuthorization for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobBinaryAuthorizationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobBinaryAuthorization(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobBinaryAuthorizationSlice(c *Client, des, nw []JobBinaryAuthorization) []JobBinaryAuthorization { @@ -1076,23 +1079,26 @@ func canonicalizeNewJobTemplateSet(c *Client, des, nw []JobTemplate) []JobTempla if des == nil { return nw } - var reorderedNew []JobTemplate + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTemplate for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTemplateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTemplate(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTemplateSlice(c *Client, des, nw []JobTemplate) []JobTemplate { @@ -1223,23 +1229,26 @@ func canonicalizeNewJobTemplateTemplateSet(c *Client, des, nw []JobTemplateTempl if des == nil { return nw } - var reorderedNew []JobTemplateTemplate + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTemplateTemplate for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTemplateTemplateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTemplateTemplate(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTemplateTemplateSlice(c *Client, des, nw []JobTemplateTemplate) []JobTemplateTemplate { @@ -1370,23 +1379,26 @@ func canonicalizeNewJobTemplateTemplateContainersSet(c *Client, des, nw []JobTem if des == nil { return nw } - var reorderedNew []JobTemplateTemplateContainers + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTemplateTemplateContainers for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTemplateTemplateContainersNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTemplateTemplateContainers(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTemplateTemplateContainersSlice(c *Client, des, nw []JobTemplateTemplateContainers) []JobTemplateTemplateContainers { @@ -1515,23 +1527,26 @@ func canonicalizeNewJobTemplateTemplateContainersEnvSet(c *Client, des, nw []Job if des == nil { return nw } - var reorderedNew []JobTemplateTemplateContainersEnv + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTemplateTemplateContainersEnv for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTemplateTemplateContainersEnvNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTemplateTemplateContainersEnv(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTemplateTemplateContainersEnvSlice(c *Client, des, nw []JobTemplateTemplateContainersEnv) []JobTemplateTemplateContainersEnv { @@ -1624,23 +1639,26 @@ func canonicalizeNewJobTemplateTemplateContainersEnvValueSourceSet(c *Client, de if des == nil { return nw } - var reorderedNew []JobTemplateTemplateContainersEnvValueSource + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTemplateTemplateContainersEnvValueSource for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTemplateTemplateContainersEnvValueSourceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTemplateTemplateContainersEnvValueSource(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTemplateTemplateContainersEnvValueSourceSlice(c *Client, des, nw []JobTemplateTemplateContainersEnvValueSource) []JobTemplateTemplateContainersEnvValueSource { @@ -1742,23 +1760,26 @@ func canonicalizeNewJobTemplateTemplateContainersEnvValueSourceSecretKeyRefSet(c if des == nil { return nw } - var reorderedNew []JobTemplateTemplateContainersEnvValueSourceSecretKeyRef + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTemplateTemplateContainersEnvValueSourceSecretKeyRef for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTemplateTemplateContainersEnvValueSourceSecretKeyRefNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTemplateTemplateContainersEnvValueSourceSecretKeyRef(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTemplateTemplateContainersEnvValueSourceSecretKeyRefSlice(c *Client, des, nw []JobTemplateTemplateContainersEnvValueSourceSecretKeyRef) []JobTemplateTemplateContainersEnvValueSourceSecretKeyRef { @@ -1863,23 +1884,26 @@ func canonicalizeNewJobTemplateTemplateContainersResourcesSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []JobTemplateTemplateContainersResources + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTemplateTemplateContainersResources for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTemplateTemplateContainersResourcesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTemplateTemplateContainersResources(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTemplateTemplateContainersResourcesSlice(c *Client, des, nw []JobTemplateTemplateContainersResources) []JobTemplateTemplateContainersResources { @@ -1984,23 +2008,26 @@ func canonicalizeNewJobTemplateTemplateContainersPortsSet(c *Client, des, nw []J if des == nil { return nw } - var reorderedNew []JobTemplateTemplateContainersPorts + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTemplateTemplateContainersPorts for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTemplateTemplateContainersPortsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTemplateTemplateContainersPorts(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTemplateTemplateContainersPortsSlice(c *Client, des, nw []JobTemplateTemplateContainersPorts) []JobTemplateTemplateContainersPorts { @@ -2107,23 +2134,26 @@ func canonicalizeNewJobTemplateTemplateContainersVolumeMountsSet(c *Client, des, if des == nil { return nw } - var reorderedNew []JobTemplateTemplateContainersVolumeMounts + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTemplateTemplateContainersVolumeMounts for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTemplateTemplateContainersVolumeMountsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTemplateTemplateContainersVolumeMounts(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTemplateTemplateContainersVolumeMountsSlice(c *Client, des, nw []JobTemplateTemplateContainersVolumeMounts) []JobTemplateTemplateContainersVolumeMounts { @@ -2246,23 +2276,26 @@ func canonicalizeNewJobTemplateTemplateVolumesSet(c *Client, des, nw []JobTempla if des == nil { return nw } - var reorderedNew []JobTemplateTemplateVolumes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTemplateTemplateVolumes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTemplateTemplateVolumesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTemplateTemplateVolumes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTemplateTemplateVolumesSlice(c *Client, des, nw []JobTemplateTemplateVolumes) []JobTemplateTemplateVolumes { @@ -2369,23 +2402,26 @@ func canonicalizeNewJobTemplateTemplateVolumesSecretSet(c *Client, des, nw []Job if des == nil { return nw } - var reorderedNew []JobTemplateTemplateVolumesSecret + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTemplateTemplateVolumesSecret for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTemplateTemplateVolumesSecretNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTemplateTemplateVolumesSecret(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTemplateTemplateVolumesSecretSlice(c *Client, des, nw []JobTemplateTemplateVolumesSecret) []JobTemplateTemplateVolumesSecret { @@ -2498,23 +2534,26 @@ func canonicalizeNewJobTemplateTemplateVolumesSecretItemsSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []JobTemplateTemplateVolumesSecretItems + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTemplateTemplateVolumesSecretItems for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTemplateTemplateVolumesSecretItemsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTemplateTemplateVolumesSecretItems(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTemplateTemplateVolumesSecretItemsSlice(c *Client, des, nw []JobTemplateTemplateVolumesSecretItems) []JobTemplateTemplateVolumesSecretItems { @@ -2613,23 +2652,26 @@ func canonicalizeNewJobTemplateTemplateVolumesCloudSqlInstanceSet(c *Client, des if des == nil { return nw } - var reorderedNew []JobTemplateTemplateVolumesCloudSqlInstance + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTemplateTemplateVolumesCloudSqlInstance for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTemplateTemplateVolumesCloudSqlInstanceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTemplateTemplateVolumesCloudSqlInstance(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTemplateTemplateVolumesCloudSqlInstanceSlice(c *Client, des, nw []JobTemplateTemplateVolumesCloudSqlInstance) []JobTemplateTemplateVolumesCloudSqlInstance { @@ -2731,23 +2773,26 @@ func canonicalizeNewJobTemplateTemplateVPCAccessSet(c *Client, des, nw []JobTemp if des == nil { return nw } - var reorderedNew []JobTemplateTemplateVPCAccess + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTemplateTemplateVPCAccess for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTemplateTemplateVPCAccessNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTemplateTemplateVPCAccess(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTemplateTemplateVPCAccessSlice(c *Client, des, nw []JobTemplateTemplateVPCAccess) []JobTemplateTemplateVPCAccess { @@ -2952,23 +2997,26 @@ func canonicalizeNewJobTerminalConditionSet(c *Client, des, nw []JobTerminalCond if des == nil { return nw } - var reorderedNew []JobTerminalCondition + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobTerminalCondition for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobTerminalConditionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobTerminalCondition(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobTerminalConditionSlice(c *Client, des, nw []JobTerminalCondition) []JobTerminalCondition { @@ -3141,23 +3189,26 @@ func canonicalizeNewJobConditionsSet(c *Client, des, nw []JobConditions) []JobCo if des == nil { return nw } - var reorderedNew []JobConditions + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobConditions for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobConditionsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobConditions(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobConditionsSlice(c *Client, des, nw []JobConditions) []JobConditions { @@ -3259,23 +3310,26 @@ func canonicalizeNewJobLatestSucceededExecutionSet(c *Client, des, nw []JobLates if des == nil { return nw } - var reorderedNew []JobLatestSucceededExecution + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobLatestSucceededExecution for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobLatestSucceededExecutionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobLatestSucceededExecution(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobLatestSucceededExecutionSlice(c *Client, des, nw []JobLatestSucceededExecution) []JobLatestSucceededExecution { @@ -3377,23 +3431,26 @@ func canonicalizeNewJobLatestCreatedExecutionSet(c *Client, des, nw []JobLatestC if des == nil { return nw } - var reorderedNew []JobLatestCreatedExecution + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []JobLatestCreatedExecution for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareJobLatestCreatedExecutionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewJobLatestCreatedExecution(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewJobLatestCreatedExecutionSlice(c *Client, des, nw []JobLatestCreatedExecution) []JobLatestCreatedExecution { diff --git a/services/google/run/alpha/service_internal.go b/services/google/run/alpha/service_internal.go index cb7caab8b9..9c1b5ec0ff 100755 --- a/services/google/run/alpha/service_internal.go +++ b/services/google/run/alpha/service_internal.go @@ -951,23 +951,26 @@ func canonicalizeNewServiceBinaryAuthorizationSet(c *Client, des, nw []ServiceBi if des == nil { return nw } - var reorderedNew []ServiceBinaryAuthorization + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceBinaryAuthorization for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceBinaryAuthorizationNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceBinaryAuthorization(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceBinaryAuthorizationSlice(c *Client, des, nw []ServiceBinaryAuthorization) []ServiceBinaryAuthorization { @@ -1112,23 +1115,26 @@ func canonicalizeNewServiceTemplateSet(c *Client, des, nw []ServiceTemplate) []S if des == nil { return nw } - var reorderedNew []ServiceTemplate + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceTemplate for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceTemplateNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceTemplate(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceTemplateSlice(c *Client, des, nw []ServiceTemplate) []ServiceTemplate { @@ -1230,23 +1236,26 @@ func canonicalizeNewServiceTemplateScalingSet(c *Client, des, nw []ServiceTempla if des == nil { return nw } - var reorderedNew []ServiceTemplateScaling + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceTemplateScaling for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceTemplateScalingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceTemplateScaling(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceTemplateScalingSlice(c *Client, des, nw []ServiceTemplateScaling) []ServiceTemplateScaling { @@ -1348,23 +1357,26 @@ func canonicalizeNewServiceTemplateVPCAccessSet(c *Client, des, nw []ServiceTemp if des == nil { return nw } - var reorderedNew []ServiceTemplateVPCAccess + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceTemplateVPCAccess for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceTemplateVPCAccessNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceTemplateVPCAccess(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceTemplateVPCAccessSlice(c *Client, des, nw []ServiceTemplateVPCAccess) []ServiceTemplateVPCAccess { @@ -1495,23 +1507,26 @@ func canonicalizeNewServiceTemplateContainersSet(c *Client, des, nw []ServiceTem if des == nil { return nw } - var reorderedNew []ServiceTemplateContainers + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceTemplateContainers for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceTemplateContainersNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceTemplateContainers(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceTemplateContainersSlice(c *Client, des, nw []ServiceTemplateContainers) []ServiceTemplateContainers { @@ -1640,23 +1655,26 @@ func canonicalizeNewServiceTemplateContainersEnvSet(c *Client, des, nw []Service if des == nil { return nw } - var reorderedNew []ServiceTemplateContainersEnv + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceTemplateContainersEnv for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceTemplateContainersEnvNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceTemplateContainersEnv(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceTemplateContainersEnvSlice(c *Client, des, nw []ServiceTemplateContainersEnv) []ServiceTemplateContainersEnv { @@ -1749,23 +1767,26 @@ func canonicalizeNewServiceTemplateContainersEnvValueSourceSet(c *Client, des, n if des == nil { return nw } - var reorderedNew []ServiceTemplateContainersEnvValueSource + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceTemplateContainersEnvValueSource for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceTemplateContainersEnvValueSourceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceTemplateContainersEnvValueSource(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceTemplateContainersEnvValueSourceSlice(c *Client, des, nw []ServiceTemplateContainersEnvValueSource) []ServiceTemplateContainersEnvValueSource { @@ -1867,23 +1888,26 @@ func canonicalizeNewServiceTemplateContainersEnvValueSourceSecretKeyRefSet(c *Cl if des == nil { return nw } - var reorderedNew []ServiceTemplateContainersEnvValueSourceSecretKeyRef + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceTemplateContainersEnvValueSourceSecretKeyRef for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceTemplateContainersEnvValueSourceSecretKeyRefNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceTemplateContainersEnvValueSourceSecretKeyRef(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceTemplateContainersEnvValueSourceSecretKeyRefSlice(c *Client, des, nw []ServiceTemplateContainersEnvValueSourceSecretKeyRef) []ServiceTemplateContainersEnvValueSourceSecretKeyRef { @@ -1988,23 +2012,26 @@ func canonicalizeNewServiceTemplateContainersResourcesSet(c *Client, des, nw []S if des == nil { return nw } - var reorderedNew []ServiceTemplateContainersResources + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceTemplateContainersResources for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceTemplateContainersResourcesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceTemplateContainersResources(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceTemplateContainersResourcesSlice(c *Client, des, nw []ServiceTemplateContainersResources) []ServiceTemplateContainersResources { @@ -2109,23 +2136,26 @@ func canonicalizeNewServiceTemplateContainersPortsSet(c *Client, des, nw []Servi if des == nil { return nw } - var reorderedNew []ServiceTemplateContainersPorts + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceTemplateContainersPorts for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceTemplateContainersPortsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceTemplateContainersPorts(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceTemplateContainersPortsSlice(c *Client, des, nw []ServiceTemplateContainersPorts) []ServiceTemplateContainersPorts { @@ -2232,23 +2262,26 @@ func canonicalizeNewServiceTemplateContainersVolumeMountsSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []ServiceTemplateContainersVolumeMounts + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceTemplateContainersVolumeMounts for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceTemplateContainersVolumeMountsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceTemplateContainersVolumeMounts(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceTemplateContainersVolumeMountsSlice(c *Client, des, nw []ServiceTemplateContainersVolumeMounts) []ServiceTemplateContainersVolumeMounts { @@ -2371,23 +2404,26 @@ func canonicalizeNewServiceTemplateVolumesSet(c *Client, des, nw []ServiceTempla if des == nil { return nw } - var reorderedNew []ServiceTemplateVolumes + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceTemplateVolumes for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceTemplateVolumesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceTemplateVolumes(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceTemplateVolumesSlice(c *Client, des, nw []ServiceTemplateVolumes) []ServiceTemplateVolumes { @@ -2492,23 +2528,26 @@ func canonicalizeNewServiceTemplateVolumesSecretSet(c *Client, des, nw []Service if des == nil { return nw } - var reorderedNew []ServiceTemplateVolumesSecret + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceTemplateVolumesSecret for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceTemplateVolumesSecretNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceTemplateVolumesSecret(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceTemplateVolumesSecretSlice(c *Client, des, nw []ServiceTemplateVolumesSecret) []ServiceTemplateVolumesSecret { @@ -2619,23 +2658,26 @@ func canonicalizeNewServiceTemplateVolumesSecretItemsSet(c *Client, des, nw []Se if des == nil { return nw } - var reorderedNew []ServiceTemplateVolumesSecretItems + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceTemplateVolumesSecretItems for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceTemplateVolumesSecretItemsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceTemplateVolumesSecretItems(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceTemplateVolumesSecretItemsSlice(c *Client, des, nw []ServiceTemplateVolumesSecretItems) []ServiceTemplateVolumesSecretItems { @@ -2734,23 +2776,26 @@ func canonicalizeNewServiceTemplateVolumesCloudSqlInstanceSet(c *Client, des, nw if des == nil { return nw } - var reorderedNew []ServiceTemplateVolumesCloudSqlInstance + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceTemplateVolumesCloudSqlInstance for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceTemplateVolumesCloudSqlInstanceNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceTemplateVolumesCloudSqlInstance(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceTemplateVolumesCloudSqlInstanceSlice(c *Client, des, nw []ServiceTemplateVolumesCloudSqlInstance) []ServiceTemplateVolumesCloudSqlInstance { @@ -2869,23 +2914,26 @@ func canonicalizeNewServiceTrafficSet(c *Client, des, nw []ServiceTraffic) []Ser if des == nil { return nw } - var reorderedNew []ServiceTraffic + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceTraffic for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceTrafficNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceTraffic(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceTrafficSlice(c *Client, des, nw []ServiceTraffic) []ServiceTraffic { @@ -3058,23 +3106,26 @@ func canonicalizeNewServiceTerminalConditionSet(c *Client, des, nw []ServiceTerm if des == nil { return nw } - var reorderedNew []ServiceTerminalCondition + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceTerminalCondition for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceTerminalConditionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceTerminalCondition(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceTerminalConditionSlice(c *Client, des, nw []ServiceTerminalCondition) []ServiceTerminalCondition { @@ -3201,23 +3252,26 @@ func canonicalizeNewServiceTrafficStatusesSet(c *Client, des, nw []ServiceTraffi if des == nil { return nw } - var reorderedNew []ServiceTrafficStatuses + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ServiceTrafficStatuses for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareServiceTrafficStatusesNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewServiceTrafficStatuses(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewServiceTrafficStatusesSlice(c *Client, des, nw []ServiceTrafficStatuses) []ServiceTrafficStatuses { diff --git a/services/google/storage/alpha/bucket_internal.go b/services/google/storage/alpha/bucket_internal.go index d6346913c1..05fdea7385 100755 --- a/services/google/storage/alpha/bucket_internal.go +++ b/services/google/storage/alpha/bucket_internal.go @@ -690,23 +690,26 @@ func canonicalizeNewBucketCorsSet(c *Client, des, nw []BucketCors) []BucketCors if des == nil { return nw } - var reorderedNew []BucketCors + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BucketCors for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBucketCorsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBucketCors(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBucketCorsSlice(c *Client, des, nw []BucketCors) []BucketCors { @@ -799,23 +802,26 @@ func canonicalizeNewBucketLifecycleSet(c *Client, des, nw []BucketLifecycle) []B if des == nil { return nw } - var reorderedNew []BucketLifecycle + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BucketLifecycle for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBucketLifecycleNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBucketLifecycle(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBucketLifecycleSlice(c *Client, des, nw []BucketLifecycle) []BucketLifecycle { @@ -910,23 +916,26 @@ func canonicalizeNewBucketLifecycleRuleSet(c *Client, des, nw []BucketLifecycleR if des == nil { return nw } - var reorderedNew []BucketLifecycleRule + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BucketLifecycleRule for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBucketLifecycleRuleNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBucketLifecycleRule(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBucketLifecycleRuleSlice(c *Client, des, nw []BucketLifecycleRule) []BucketLifecycleRule { @@ -1031,23 +1040,26 @@ func canonicalizeNewBucketLifecycleRuleActionSet(c *Client, des, nw []BucketLife if des == nil { return nw } - var reorderedNew []BucketLifecycleRuleAction + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BucketLifecycleRuleAction for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBucketLifecycleRuleActionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBucketLifecycleRuleAction(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBucketLifecycleRuleActionSlice(c *Client, des, nw []BucketLifecycleRuleAction) []BucketLifecycleRuleAction { @@ -1170,23 +1182,26 @@ func canonicalizeNewBucketLifecycleRuleConditionSet(c *Client, des, nw []BucketL if des == nil { return nw } - var reorderedNew []BucketLifecycleRuleCondition + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BucketLifecycleRuleCondition for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBucketLifecycleRuleConditionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBucketLifecycleRuleCondition(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBucketLifecycleRuleConditionSlice(c *Client, des, nw []BucketLifecycleRuleCondition) []BucketLifecycleRuleCondition { @@ -1293,23 +1308,26 @@ func canonicalizeNewBucketLoggingSet(c *Client, des, nw []BucketLogging) []Bucke if des == nil { return nw } - var reorderedNew []BucketLogging + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BucketLogging for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBucketLoggingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBucketLogging(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBucketLoggingSlice(c *Client, des, nw []BucketLogging) []BucketLogging { @@ -1408,23 +1426,26 @@ func canonicalizeNewBucketVersioningSet(c *Client, des, nw []BucketVersioning) [ if des == nil { return nw } - var reorderedNew []BucketVersioning + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BucketVersioning for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBucketVersioningNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBucketVersioning(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBucketVersioningSlice(c *Client, des, nw []BucketVersioning) []BucketVersioning { @@ -1531,23 +1552,26 @@ func canonicalizeNewBucketWebsiteSet(c *Client, des, nw []BucketWebsite) []Bucke if des == nil { return nw } - var reorderedNew []BucketWebsite + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BucketWebsite for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBucketWebsiteNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBucketWebsite(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBucketWebsiteSlice(c *Client, des, nw []BucketWebsite) []BucketWebsite { diff --git a/services/google/storage/beta/bucket_internal.go b/services/google/storage/beta/bucket_internal.go index 2920c57fea..00867838c9 100755 --- a/services/google/storage/beta/bucket_internal.go +++ b/services/google/storage/beta/bucket_internal.go @@ -690,23 +690,26 @@ func canonicalizeNewBucketCorsSet(c *Client, des, nw []BucketCors) []BucketCors if des == nil { return nw } - var reorderedNew []BucketCors + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BucketCors for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBucketCorsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBucketCors(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBucketCorsSlice(c *Client, des, nw []BucketCors) []BucketCors { @@ -799,23 +802,26 @@ func canonicalizeNewBucketLifecycleSet(c *Client, des, nw []BucketLifecycle) []B if des == nil { return nw } - var reorderedNew []BucketLifecycle + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BucketLifecycle for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBucketLifecycleNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBucketLifecycle(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBucketLifecycleSlice(c *Client, des, nw []BucketLifecycle) []BucketLifecycle { @@ -910,23 +916,26 @@ func canonicalizeNewBucketLifecycleRuleSet(c *Client, des, nw []BucketLifecycleR if des == nil { return nw } - var reorderedNew []BucketLifecycleRule + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BucketLifecycleRule for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBucketLifecycleRuleNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBucketLifecycleRule(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBucketLifecycleRuleSlice(c *Client, des, nw []BucketLifecycleRule) []BucketLifecycleRule { @@ -1031,23 +1040,26 @@ func canonicalizeNewBucketLifecycleRuleActionSet(c *Client, des, nw []BucketLife if des == nil { return nw } - var reorderedNew []BucketLifecycleRuleAction + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BucketLifecycleRuleAction for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBucketLifecycleRuleActionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBucketLifecycleRuleAction(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBucketLifecycleRuleActionSlice(c *Client, des, nw []BucketLifecycleRuleAction) []BucketLifecycleRuleAction { @@ -1170,23 +1182,26 @@ func canonicalizeNewBucketLifecycleRuleConditionSet(c *Client, des, nw []BucketL if des == nil { return nw } - var reorderedNew []BucketLifecycleRuleCondition + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BucketLifecycleRuleCondition for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBucketLifecycleRuleConditionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBucketLifecycleRuleCondition(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBucketLifecycleRuleConditionSlice(c *Client, des, nw []BucketLifecycleRuleCondition) []BucketLifecycleRuleCondition { @@ -1293,23 +1308,26 @@ func canonicalizeNewBucketLoggingSet(c *Client, des, nw []BucketLogging) []Bucke if des == nil { return nw } - var reorderedNew []BucketLogging + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BucketLogging for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBucketLoggingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBucketLogging(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBucketLoggingSlice(c *Client, des, nw []BucketLogging) []BucketLogging { @@ -1408,23 +1426,26 @@ func canonicalizeNewBucketVersioningSet(c *Client, des, nw []BucketVersioning) [ if des == nil { return nw } - var reorderedNew []BucketVersioning + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BucketVersioning for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBucketVersioningNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBucketVersioning(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBucketVersioningSlice(c *Client, des, nw []BucketVersioning) []BucketVersioning { @@ -1531,23 +1552,26 @@ func canonicalizeNewBucketWebsiteSet(c *Client, des, nw []BucketWebsite) []Bucke if des == nil { return nw } - var reorderedNew []BucketWebsite + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BucketWebsite for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBucketWebsiteNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBucketWebsite(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBucketWebsiteSlice(c *Client, des, nw []BucketWebsite) []BucketWebsite { diff --git a/services/google/storage/bucket_internal.go b/services/google/storage/bucket_internal.go index 5108698eaf..af12c103da 100755 --- a/services/google/storage/bucket_internal.go +++ b/services/google/storage/bucket_internal.go @@ -690,23 +690,26 @@ func canonicalizeNewBucketCorsSet(c *Client, des, nw []BucketCors) []BucketCors if des == nil { return nw } - var reorderedNew []BucketCors + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BucketCors for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBucketCorsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBucketCors(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBucketCorsSlice(c *Client, des, nw []BucketCors) []BucketCors { @@ -799,23 +802,26 @@ func canonicalizeNewBucketLifecycleSet(c *Client, des, nw []BucketLifecycle) []B if des == nil { return nw } - var reorderedNew []BucketLifecycle + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BucketLifecycle for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBucketLifecycleNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBucketLifecycle(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBucketLifecycleSlice(c *Client, des, nw []BucketLifecycle) []BucketLifecycle { @@ -910,23 +916,26 @@ func canonicalizeNewBucketLifecycleRuleSet(c *Client, des, nw []BucketLifecycleR if des == nil { return nw } - var reorderedNew []BucketLifecycleRule + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BucketLifecycleRule for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBucketLifecycleRuleNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBucketLifecycleRule(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBucketLifecycleRuleSlice(c *Client, des, nw []BucketLifecycleRule) []BucketLifecycleRule { @@ -1031,23 +1040,26 @@ func canonicalizeNewBucketLifecycleRuleActionSet(c *Client, des, nw []BucketLife if des == nil { return nw } - var reorderedNew []BucketLifecycleRuleAction + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BucketLifecycleRuleAction for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBucketLifecycleRuleActionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBucketLifecycleRuleAction(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBucketLifecycleRuleActionSlice(c *Client, des, nw []BucketLifecycleRuleAction) []BucketLifecycleRuleAction { @@ -1170,23 +1182,26 @@ func canonicalizeNewBucketLifecycleRuleConditionSet(c *Client, des, nw []BucketL if des == nil { return nw } - var reorderedNew []BucketLifecycleRuleCondition + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BucketLifecycleRuleCondition for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBucketLifecycleRuleConditionNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBucketLifecycleRuleCondition(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBucketLifecycleRuleConditionSlice(c *Client, des, nw []BucketLifecycleRuleCondition) []BucketLifecycleRuleCondition { @@ -1293,23 +1308,26 @@ func canonicalizeNewBucketLoggingSet(c *Client, des, nw []BucketLogging) []Bucke if des == nil { return nw } - var reorderedNew []BucketLogging + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BucketLogging for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBucketLoggingNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBucketLogging(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBucketLoggingSlice(c *Client, des, nw []BucketLogging) []BucketLogging { @@ -1408,23 +1426,26 @@ func canonicalizeNewBucketVersioningSet(c *Client, des, nw []BucketVersioning) [ if des == nil { return nw } - var reorderedNew []BucketVersioning + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BucketVersioning for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBucketVersioningNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBucketVersioning(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBucketVersioningSlice(c *Client, des, nw []BucketVersioning) []BucketVersioning { @@ -1531,23 +1552,26 @@ func canonicalizeNewBucketWebsiteSet(c *Client, des, nw []BucketWebsite) []Bucke if des == nil { return nw } - var reorderedNew []BucketWebsite + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []BucketWebsite for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareBucketWebsiteNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewBucketWebsite(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewBucketWebsiteSlice(c *Client, des, nw []BucketWebsite) []BucketWebsite { diff --git a/services/google/vmware/alpha/cluster.go b/services/google/vmware/alpha/cluster.go index 711eca210e..19aa417b0e 100755 --- a/services/google/vmware/alpha/cluster.go +++ b/services/google/vmware/alpha/cluster.go @@ -15,8 +15,6 @@ package alpha import ( "context" - "crypto/sha256" - "encoding/json" "fmt" "time" @@ -25,16 +23,15 @@ import ( ) type Cluster struct { - Name *string `json:"name"` - CreateTime *string `json:"createTime"` - UpdateTime *string `json:"updateTime"` - State *ClusterStateEnum `json:"state"` - Management *bool `json:"management"` - Uid *string `json:"uid"` - NodeTypeConfigs map[string]ClusterNodeTypeConfigs `json:"nodeTypeConfigs"` - Project *string `json:"project"` - Location *string `json:"location"` - PrivateCloud *string `json:"privateCloud"` + Name *string `json:"name"` + CreateTime *string `json:"createTime"` + UpdateTime *string `json:"updateTime"` + State *ClusterStateEnum `json:"state"` + Management *bool `json:"management"` + Uid *string `json:"uid"` + Project *string `json:"project"` + Location *string `json:"location"` + PrivateCloud *string `json:"privateCloud"` } func (r *Cluster) String() string { @@ -68,55 +65,6 @@ func (v ClusterStateEnum) Validate() error { } } -type ClusterNodeTypeConfigs struct { - empty bool `json:"-"` - NodeCount *int64 `json:"nodeCount"` - CustomCoreCount *int64 `json:"customCoreCount"` -} - -type jsonClusterNodeTypeConfigs ClusterNodeTypeConfigs - -func (r *ClusterNodeTypeConfigs) UnmarshalJSON(data []byte) error { - var res jsonClusterNodeTypeConfigs - if err := json.Unmarshal(data, &res); err != nil { - return err - } - - var m map[string]interface{} - json.Unmarshal(data, &m) - - if len(m) == 0 { - *r = *EmptyClusterNodeTypeConfigs - } else { - - r.NodeCount = res.NodeCount - - r.CustomCoreCount = res.CustomCoreCount - - } - return nil -} - -// This object is used to assert a desired state where this ClusterNodeTypeConfigs is -// empty. Go lacks global const objects, but this object should be treated -// as one. Modifying this object will have undesirable results. -var EmptyClusterNodeTypeConfigs *ClusterNodeTypeConfigs = &ClusterNodeTypeConfigs{empty: true} - -func (r *ClusterNodeTypeConfigs) Empty() bool { - return r.empty -} - -func (r *ClusterNodeTypeConfigs) String() string { - return dcl.SprintResource(r) -} - -func (r *ClusterNodeTypeConfigs) HashCode() string { - // Placeholder for a more complex hash method that handles ordering, etc - // Hash resource body for easy comparison later - hash := sha256.New().Sum([]byte(r.String())) - return fmt.Sprintf("%x", hash) -} - // Describe returns a simple description of this resource to ensure that automated tools // can identify it. func (r *Cluster) Describe() dcl.ServiceTypeVersion { @@ -133,16 +81,15 @@ func (r *Cluster) ID() (string, error) { } nr := r.urlNormalized() params := map[string]interface{}{ - "name": dcl.ValueOrEmptyString(nr.Name), - "create_time": dcl.ValueOrEmptyString(nr.CreateTime), - "update_time": dcl.ValueOrEmptyString(nr.UpdateTime), - "state": dcl.ValueOrEmptyString(nr.State), - "management": dcl.ValueOrEmptyString(nr.Management), - "uid": dcl.ValueOrEmptyString(nr.Uid), - "node_type_configs": dcl.ValueOrEmptyString(nr.NodeTypeConfigs), - "project": dcl.ValueOrEmptyString(nr.Project), - "location": dcl.ValueOrEmptyString(nr.Location), - "private_cloud": dcl.ValueOrEmptyString(nr.PrivateCloud), + "name": dcl.ValueOrEmptyString(nr.Name), + "create_time": dcl.ValueOrEmptyString(nr.CreateTime), + "update_time": dcl.ValueOrEmptyString(nr.UpdateTime), + "state": dcl.ValueOrEmptyString(nr.State), + "management": dcl.ValueOrEmptyString(nr.Management), + "uid": dcl.ValueOrEmptyString(nr.Uid), + "project": dcl.ValueOrEmptyString(nr.Project), + "location": dcl.ValueOrEmptyString(nr.Location), + "private_cloud": dcl.ValueOrEmptyString(nr.PrivateCloud), } return dcl.Nprintf("projects/{{project}}/locations/{{location}}/privateClouds/{{private_cloud}}/clusters/{{name}}", params), nil } diff --git a/services/google/vmware/alpha/cluster.yaml b/services/google/vmware/alpha/cluster.yaml index fab9e277b1..4f6552f399 100755 --- a/services/google/vmware/alpha/cluster.yaml +++ b/services/google/vmware/alpha/cluster.yaml @@ -79,7 +79,6 @@ components: type: object required: - name - - nodeTypeConfigs - project - location - privateCloud @@ -111,30 +110,6 @@ components: are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: `projects/my-project/locations/us-west1-a/privateClouds/my-cloud/clusters/my-cluster`' x-kubernetes-immutable: true - nodeTypeConfigs: - type: object - additionalProperties: - type: object - x-dcl-go-type: ClusterNodeTypeConfigs - required: - - nodeCount - properties: - customCoreCount: - type: integer - format: int64 - x-dcl-go-name: CustomCoreCount - description: Optional. Customized number of cores available to each - node of the type. This number must always be one of `nodeType.availableCustomCoreCounts`. - If zero is provided max value from `nodeType.availableCustomCoreCounts` - will be used. - nodeCount: - type: integer - format: int64 - x-dcl-go-name: NodeCount - description: Required. The number of nodes of this type in the cluster - x-dcl-go-name: NodeTypeConfigs - description: Required. The map of cluster node types in this cluster, where - the key is canonical identifier of the node type (corresponds to the `NodeType`). privateCloud: type: string x-dcl-go-name: PrivateCloud diff --git a/services/google/vmware/alpha/cluster_alpha_yaml_embed.go b/services/google/vmware/alpha/cluster_alpha_yaml_embed.go index 7d0d2a7526..a45d208a8b 100755 --- a/services/google/vmware/alpha/cluster_alpha_yaml_embed.go +++ b/services/google/vmware/alpha/cluster_alpha_yaml_embed.go @@ -17,7 +17,7 @@ package alpha // blaze-out/k8-fastbuild/genfiles/cloud/graphite/mmv2/services/google/vmware/alpha/cluster.yaml -var YAML_cluster = []byte("info:\n title: Vmware/Cluster\n description: The Vmware Cluster resource\n x-dcl-struct-name: Cluster\n x-dcl-has-iam: false\npaths:\n get:\n description: The function used to get information about a Cluster\n parameters:\n - name: cluster\n required: true\n description: A full instance of a Cluster\n apply:\n description: The function used to apply information about a Cluster\n parameters:\n - name: cluster\n required: true\n description: A full instance of a Cluster\n delete:\n description: The function used to delete a Cluster\n parameters:\n - name: cluster\n required: true\n description: A full instance of a Cluster\n deleteAll:\n description: The function used to delete all Cluster\n parameters:\n - name: project\n required: true\n schema:\n type: string\n - name: location\n required: true\n schema:\n type: string\n - name: privateCloud\n required: true\n schema:\n type: string\n list:\n description: The function used to list information about many Cluster\n parameters:\n - name: project\n required: true\n schema:\n type: string\n - name: location\n required: true\n schema:\n type: string\n - name: privateCloud\n required: true\n schema:\n type: string\ncomponents:\n schemas:\n Cluster:\n title: Cluster\n x-dcl-id: projects/{{project}}/locations/{{location}}/privateClouds/{{private_cloud}}/clusters/{{name}}\n x-dcl-parent-container: project\n x-dcl-has-create: true\n x-dcl-has-iam: false\n x-dcl-read-timeout: 0\n x-dcl-apply-timeout: 9600\n x-dcl-delete-timeout: 7200\n type: object\n required:\n - name\n - nodeTypeConfigs\n - project\n - location\n - privateCloud\n properties:\n createTime:\n type: string\n format: date-time\n x-dcl-go-name: CreateTime\n readOnly: true\n description: Output only. Creation time of this resource.\n x-kubernetes-immutable: true\n location:\n type: string\n x-dcl-go-name: Location\n description: The location for the resource\n x-kubernetes-immutable: true\n management:\n type: boolean\n x-dcl-go-name: Management\n readOnly: true\n description: Output only. True if the cluster is a management cluster; false\n otherwise. There can only be one management cluster in a private cloud\n and it has to be the first one.\n x-kubernetes-immutable: true\n name:\n type: string\n x-dcl-go-name: Name\n description: 'Output only. The resource name of this cluster. Resource names\n are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names.\n For example: `projects/my-project/locations/us-west1-a/privateClouds/my-cloud/clusters/my-cluster`'\n x-kubernetes-immutable: true\n nodeTypeConfigs:\n type: object\n additionalProperties:\n type: object\n x-dcl-go-type: ClusterNodeTypeConfigs\n required:\n - nodeCount\n properties:\n customCoreCount:\n type: integer\n format: int64\n x-dcl-go-name: CustomCoreCount\n description: Optional. Customized number of cores available to each\n node of the type. This number must always be one of `nodeType.availableCustomCoreCounts`.\n If zero is provided max value from `nodeType.availableCustomCoreCounts`\n will be used.\n nodeCount:\n type: integer\n format: int64\n x-dcl-go-name: NodeCount\n description: Required. The number of nodes of this type in the cluster\n x-dcl-go-name: NodeTypeConfigs\n description: Required. The map of cluster node types in this cluster, where\n the key is canonical identifier of the node type (corresponds to the `NodeType`).\n privateCloud:\n type: string\n x-dcl-go-name: PrivateCloud\n description: The private_cloud for the resource\n x-kubernetes-immutable: true\n x-dcl-references:\n - resource: Vmwareengine/PrivateCloud\n field: name\n parent: true\n project:\n type: string\n x-dcl-go-name: Project\n description: The project for the resource\n x-kubernetes-immutable: true\n x-dcl-references:\n - resource: Cloudresourcemanager/Project\n field: name\n parent: true\n state:\n type: string\n x-dcl-go-name: State\n x-dcl-go-type: ClusterStateEnum\n readOnly: true\n description: 'Output only. State of the resource. Possible values: STATE_UNSPECIFIED,\n ACTIVE, CREATING, UPDATING, DELETING, REPAIRING'\n x-kubernetes-immutable: true\n enum:\n - STATE_UNSPECIFIED\n - ACTIVE\n - CREATING\n - UPDATING\n - DELETING\n - REPAIRING\n uid:\n type: string\n x-dcl-go-name: Uid\n readOnly: true\n description: Output only. System-generated unique identifier for the resource.\n x-kubernetes-immutable: true\n updateTime:\n type: string\n format: date-time\n x-dcl-go-name: UpdateTime\n readOnly: true\n description: Output only. Last update time of this resource.\n x-kubernetes-immutable: true\n") +var YAML_cluster = []byte("info:\n title: Vmware/Cluster\n description: The Vmware Cluster resource\n x-dcl-struct-name: Cluster\n x-dcl-has-iam: false\npaths:\n get:\n description: The function used to get information about a Cluster\n parameters:\n - name: cluster\n required: true\n description: A full instance of a Cluster\n apply:\n description: The function used to apply information about a Cluster\n parameters:\n - name: cluster\n required: true\n description: A full instance of a Cluster\n delete:\n description: The function used to delete a Cluster\n parameters:\n - name: cluster\n required: true\n description: A full instance of a Cluster\n deleteAll:\n description: The function used to delete all Cluster\n parameters:\n - name: project\n required: true\n schema:\n type: string\n - name: location\n required: true\n schema:\n type: string\n - name: privateCloud\n required: true\n schema:\n type: string\n list:\n description: The function used to list information about many Cluster\n parameters:\n - name: project\n required: true\n schema:\n type: string\n - name: location\n required: true\n schema:\n type: string\n - name: privateCloud\n required: true\n schema:\n type: string\ncomponents:\n schemas:\n Cluster:\n title: Cluster\n x-dcl-id: projects/{{project}}/locations/{{location}}/privateClouds/{{private_cloud}}/clusters/{{name}}\n x-dcl-parent-container: project\n x-dcl-has-create: true\n x-dcl-has-iam: false\n x-dcl-read-timeout: 0\n x-dcl-apply-timeout: 9600\n x-dcl-delete-timeout: 7200\n type: object\n required:\n - name\n - project\n - location\n - privateCloud\n properties:\n createTime:\n type: string\n format: date-time\n x-dcl-go-name: CreateTime\n readOnly: true\n description: Output only. Creation time of this resource.\n x-kubernetes-immutable: true\n location:\n type: string\n x-dcl-go-name: Location\n description: The location for the resource\n x-kubernetes-immutable: true\n management:\n type: boolean\n x-dcl-go-name: Management\n readOnly: true\n description: Output only. True if the cluster is a management cluster; false\n otherwise. There can only be one management cluster in a private cloud\n and it has to be the first one.\n x-kubernetes-immutable: true\n name:\n type: string\n x-dcl-go-name: Name\n description: 'Output only. The resource name of this cluster. Resource names\n are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names.\n For example: `projects/my-project/locations/us-west1-a/privateClouds/my-cloud/clusters/my-cluster`'\n x-kubernetes-immutable: true\n privateCloud:\n type: string\n x-dcl-go-name: PrivateCloud\n description: The private_cloud for the resource\n x-kubernetes-immutable: true\n x-dcl-references:\n - resource: Vmwareengine/PrivateCloud\n field: name\n parent: true\n project:\n type: string\n x-dcl-go-name: Project\n description: The project for the resource\n x-kubernetes-immutable: true\n x-dcl-references:\n - resource: Cloudresourcemanager/Project\n field: name\n parent: true\n state:\n type: string\n x-dcl-go-name: State\n x-dcl-go-type: ClusterStateEnum\n readOnly: true\n description: 'Output only. State of the resource. Possible values: STATE_UNSPECIFIED,\n ACTIVE, CREATING, UPDATING, DELETING, REPAIRING'\n x-kubernetes-immutable: true\n enum:\n - STATE_UNSPECIFIED\n - ACTIVE\n - CREATING\n - UPDATING\n - DELETING\n - REPAIRING\n uid:\n type: string\n x-dcl-go-name: Uid\n readOnly: true\n description: Output only. System-generated unique identifier for the resource.\n x-kubernetes-immutable: true\n updateTime:\n type: string\n format: date-time\n x-dcl-go-name: UpdateTime\n readOnly: true\n description: Output only. Last update time of this resource.\n x-kubernetes-immutable: true\n") -// 5655 bytes -// MD5: 249e1762421dc366398a979ddc05103e +// 4520 bytes +// MD5: 528e171aae7d1f489fc8ea87a22d5937 diff --git a/services/google/vmware/alpha/cluster_internal.go b/services/google/vmware/alpha/cluster_internal.go index bcfb93f6de..16411710d1 100755 --- a/services/google/vmware/alpha/cluster_internal.go +++ b/services/google/vmware/alpha/cluster_internal.go @@ -30,9 +30,6 @@ func (r *Cluster) validate() error { if err := dcl.RequiredParameter(r.Name, "Name"); err != nil { return err } - if err := dcl.Required(r, "nodeTypeConfigs"); err != nil { - return err - } if err := dcl.RequiredParameter(r.Project, "Project"); err != nil { return err } @@ -44,12 +41,6 @@ func (r *Cluster) validate() error { } return nil } -func (r *ClusterNodeTypeConfigs) validate() error { - if err := dcl.Required(r, "nodeCount"); err != nil { - return err - } - return nil -} func (r *Cluster) basePath() string { params := map[string]interface{}{} return dcl.Nprintf("https://vmwareengine.googleapis.com/v1/", params) @@ -114,11 +105,6 @@ func newUpdateClusterUpdateClusterRequest(ctx context.Context, f *Cluster, c *Cl res := f _ = res - if v, err := expandClusterNodeTypeConfigsMap(c, f.NodeTypeConfigs, res); err != nil { - return nil, fmt.Errorf("error expanding NodeTypeConfigs into nodeTypeConfigs: %w", err) - } else if !dcl.IsEmptyValueIndirect(v) { - req["nodeTypeConfigs"] = v - } req["name"] = fmt.Sprintf("projects/%s/locations/%s/privateClouds/%s/clusters/%s", *f.Project, *f.Location, *f.PrivateCloud, *f.Name) return req, nil @@ -459,12 +445,6 @@ func canonicalizeClusterDesiredState(rawDesired, rawInitial *Cluster, opts ...dc } else { canonicalDesired.Name = rawDesired.Name } - if dcl.IsZeroValue(rawDesired.NodeTypeConfigs) || (dcl.IsEmptyValueIndirect(rawDesired.NodeTypeConfigs) && dcl.IsEmptyValueIndirect(rawInitial.NodeTypeConfigs)) { - // Desired and initial values are equivalent, so set canonical desired value to initial value. - canonicalDesired.NodeTypeConfigs = rawInitial.NodeTypeConfigs - } else { - canonicalDesired.NodeTypeConfigs = rawDesired.NodeTypeConfigs - } if dcl.NameToSelfLink(rawDesired.Project, rawInitial.Project) { canonicalDesired.Project = rawInitial.Project } else { @@ -519,11 +499,6 @@ func canonicalizeClusterNewState(c *Client, rawNew, rawDesired *Cluster) (*Clust } } - if dcl.IsEmptyValueIndirect(rawNew.NodeTypeConfigs) && dcl.IsEmptyValueIndirect(rawDesired.NodeTypeConfigs) { - rawNew.NodeTypeConfigs = rawDesired.NodeTypeConfigs - } else { - } - rawNew.Project = rawDesired.Project rawNew.Location = rawDesired.Location @@ -533,124 +508,6 @@ func canonicalizeClusterNewState(c *Client, rawNew, rawDesired *Cluster) (*Clust return rawNew, nil } -func canonicalizeClusterNodeTypeConfigs(des, initial *ClusterNodeTypeConfigs, opts ...dcl.ApplyOption) *ClusterNodeTypeConfigs { - if des == nil { - return initial - } - if des.empty { - return des - } - - if initial == nil { - return des - } - - cDes := &ClusterNodeTypeConfigs{} - - if dcl.IsZeroValue(des.NodeCount) || (dcl.IsEmptyValueIndirect(des.NodeCount) && dcl.IsEmptyValueIndirect(initial.NodeCount)) { - // Desired and initial values are equivalent, so set canonical desired value to initial value. - cDes.NodeCount = initial.NodeCount - } else { - cDes.NodeCount = des.NodeCount - } - if dcl.IsZeroValue(des.CustomCoreCount) || (dcl.IsEmptyValueIndirect(des.CustomCoreCount) && dcl.IsEmptyValueIndirect(initial.CustomCoreCount)) { - // Desired and initial values are equivalent, so set canonical desired value to initial value. - cDes.CustomCoreCount = initial.CustomCoreCount - } else { - cDes.CustomCoreCount = des.CustomCoreCount - } - - return cDes -} - -func canonicalizeClusterNodeTypeConfigsSlice(des, initial []ClusterNodeTypeConfigs, opts ...dcl.ApplyOption) []ClusterNodeTypeConfigs { - if dcl.IsEmptyValueIndirect(des) { - return initial - } - - if len(des) != len(initial) { - - items := make([]ClusterNodeTypeConfigs, 0, len(des)) - for _, d := range des { - cd := canonicalizeClusterNodeTypeConfigs(&d, nil, opts...) - if cd != nil { - items = append(items, *cd) - } - } - return items - } - - items := make([]ClusterNodeTypeConfigs, 0, len(des)) - for i, d := range des { - cd := canonicalizeClusterNodeTypeConfigs(&d, &initial[i], opts...) - if cd != nil { - items = append(items, *cd) - } - } - return items - -} - -func canonicalizeNewClusterNodeTypeConfigs(c *Client, des, nw *ClusterNodeTypeConfigs) *ClusterNodeTypeConfigs { - - if des == nil { - return nw - } - - if nw == nil { - if dcl.IsEmptyValueIndirect(des) { - c.Config.Logger.Info("Found explicitly empty value for ClusterNodeTypeConfigs while comparing non-nil desired to nil actual. Returning desired object.") - return des - } - return nil - } - - return nw -} - -func canonicalizeNewClusterNodeTypeConfigsSet(c *Client, des, nw []ClusterNodeTypeConfigs) []ClusterNodeTypeConfigs { - if des == nil { - return nw - } - var reorderedNew []ClusterNodeTypeConfigs - for _, d := range des { - matchedNew := -1 - for idx, n := range nw { - if diffs, _ := compareClusterNodeTypeConfigsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx - break - } - } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) - } - } - reorderedNew = append(reorderedNew, nw...) - - return reorderedNew -} - -func canonicalizeNewClusterNodeTypeConfigsSlice(c *Client, des, nw []ClusterNodeTypeConfigs) []ClusterNodeTypeConfigs { - if des == nil { - return nw - } - - // Lengths are unequal. A diff will occur later, so we shouldn't canonicalize. - // Return the original array. - if len(des) != len(nw) { - return nw - } - - var items []ClusterNodeTypeConfigs - for i, d := range des { - n := nw[i] - items = append(items, *canonicalizeNewClusterNodeTypeConfigs(c, &d, &n)) - } - - return items -} - // The differ returns a list of diffs, along with a list of operations that should be taken // to remedy them. Right now, it does not attempt to consolidate operations - if several // fields can be fixed with a patch update, it will perform the patch several times. @@ -711,13 +568,6 @@ func diffCluster(c *Client, desired, actual *Cluster, opts ...dcl.ApplyOption) ( newDiffs = append(newDiffs, ds...) } - if ds, err := dcl.Diff(desired.NodeTypeConfigs, actual.NodeTypeConfigs, dcl.DiffInfo{ObjectFunction: compareClusterNodeTypeConfigsNewStyle, EmptyObject: EmptyClusterNodeTypeConfigs, OperationSelector: dcl.TriggersOperation("updateClusterUpdateClusterOperation")}, fn.AddNest("NodeTypeConfigs")); len(ds) != 0 || err != nil { - if err != nil { - return nil, err - } - newDiffs = append(newDiffs, ds...) - } - if ds, err := dcl.Diff(desired.Project, actual.Project, dcl.DiffInfo{Type: "ReferenceType", OperationSelector: dcl.RequiresRecreate()}, fn.AddNest("Project")); len(ds) != 0 || err != nil { if err != nil { return nil, err @@ -741,41 +591,6 @@ func diffCluster(c *Client, desired, actual *Cluster, opts ...dcl.ApplyOption) ( return newDiffs, nil } -func compareClusterNodeTypeConfigsNewStyle(d, a interface{}, fn dcl.FieldName) ([]*dcl.FieldDiff, error) { - var diffs []*dcl.FieldDiff - - desired, ok := d.(*ClusterNodeTypeConfigs) - if !ok { - desiredNotPointer, ok := d.(ClusterNodeTypeConfigs) - if !ok { - return nil, fmt.Errorf("obj %v is not a ClusterNodeTypeConfigs or *ClusterNodeTypeConfigs", d) - } - desired = &desiredNotPointer - } - actual, ok := a.(*ClusterNodeTypeConfigs) - if !ok { - actualNotPointer, ok := a.(ClusterNodeTypeConfigs) - if !ok { - return nil, fmt.Errorf("obj %v is not a ClusterNodeTypeConfigs", a) - } - actual = &actualNotPointer - } - - if ds, err := dcl.Diff(desired.NodeCount, actual.NodeCount, dcl.DiffInfo{OperationSelector: dcl.TriggersOperation("updateClusterUpdateClusterOperation")}, fn.AddNest("NodeCount")); len(ds) != 0 || err != nil { - if err != nil { - return nil, err - } - diffs = append(diffs, ds...) - } - - if ds, err := dcl.Diff(desired.CustomCoreCount, actual.CustomCoreCount, dcl.DiffInfo{OperationSelector: dcl.TriggersOperation("updateClusterUpdateClusterOperation")}, fn.AddNest("CustomCoreCount")); len(ds) != 0 || err != nil { - if err != nil { - return nil, err - } - diffs = append(diffs, ds...) - } - return diffs, nil -} // urlNormalized returns a copy of the resource struct with values normalized // for URL substitutions. For instance, it converts long-form self-links to @@ -846,11 +661,6 @@ func expandCluster(c *Client, f *Cluster) (map[string]interface{}, error) { } else if !dcl.IsEmptyValueIndirect(v) { m["name"] = v } - if v, err := expandClusterNodeTypeConfigsMap(c, f.NodeTypeConfigs, res); err != nil { - return nil, fmt.Errorf("error expanding NodeTypeConfigs into nodeTypeConfigs: %w", err) - } else if !dcl.IsEmptyValueIndirect(v) { - m["nodeTypeConfigs"] = v - } if v, err := dcl.EmptyValue(); err != nil { return nil, fmt.Errorf("error expanding Project into project: %w", err) } else if !dcl.IsEmptyValueIndirect(v) { @@ -888,7 +698,6 @@ func flattenCluster(c *Client, i interface{}, res *Cluster) *Cluster { resultRes.State = flattenClusterStateEnum(m["state"]) resultRes.Management = dcl.FlattenBool(m["management"]) resultRes.Uid = dcl.FlattenString(m["uid"]) - resultRes.NodeTypeConfigs = flattenClusterNodeTypeConfigsMap(c, m["nodeTypeConfigs"], res) resultRes.Project = dcl.FlattenString(m["project"]) resultRes.Location = dcl.FlattenString(m["location"]) resultRes.PrivateCloud = dcl.FlattenString(m["privateCloud"]) @@ -896,124 +705,6 @@ func flattenCluster(c *Client, i interface{}, res *Cluster) *Cluster { return resultRes } -// expandClusterNodeTypeConfigsMap expands the contents of ClusterNodeTypeConfigs into a JSON -// request object. -func expandClusterNodeTypeConfigsMap(c *Client, f map[string]ClusterNodeTypeConfigs, res *Cluster) (map[string]interface{}, error) { - if f == nil { - return nil, nil - } - - items := make(map[string]interface{}) - for k, item := range f { - i, err := expandClusterNodeTypeConfigs(c, &item, res) - if err != nil { - return nil, err - } - if i != nil { - items[k] = i - } - } - - return items, nil -} - -// expandClusterNodeTypeConfigsSlice expands the contents of ClusterNodeTypeConfigs into a JSON -// request object. -func expandClusterNodeTypeConfigsSlice(c *Client, f []ClusterNodeTypeConfigs, res *Cluster) ([]map[string]interface{}, error) { - if f == nil { - return nil, nil - } - - items := []map[string]interface{}{} - for _, item := range f { - i, err := expandClusterNodeTypeConfigs(c, &item, res) - if err != nil { - return nil, err - } - - items = append(items, i) - } - - return items, nil -} - -// flattenClusterNodeTypeConfigsMap flattens the contents of ClusterNodeTypeConfigs from a JSON -// response object. -func flattenClusterNodeTypeConfigsMap(c *Client, i interface{}, res *Cluster) map[string]ClusterNodeTypeConfigs { - a, ok := i.(map[string]interface{}) - if !ok { - return map[string]ClusterNodeTypeConfigs{} - } - - if len(a) == 0 { - return map[string]ClusterNodeTypeConfigs{} - } - - items := make(map[string]ClusterNodeTypeConfigs) - for k, item := range a { - items[k] = *flattenClusterNodeTypeConfigs(c, item.(map[string]interface{}), res) - } - - return items -} - -// flattenClusterNodeTypeConfigsSlice flattens the contents of ClusterNodeTypeConfigs from a JSON -// response object. -func flattenClusterNodeTypeConfigsSlice(c *Client, i interface{}, res *Cluster) []ClusterNodeTypeConfigs { - a, ok := i.([]interface{}) - if !ok { - return []ClusterNodeTypeConfigs{} - } - - if len(a) == 0 { - return []ClusterNodeTypeConfigs{} - } - - items := make([]ClusterNodeTypeConfigs, 0, len(a)) - for _, item := range a { - items = append(items, *flattenClusterNodeTypeConfigs(c, item.(map[string]interface{}), res)) - } - - return items -} - -// expandClusterNodeTypeConfigs expands an instance of ClusterNodeTypeConfigs into a JSON -// request object. -func expandClusterNodeTypeConfigs(c *Client, f *ClusterNodeTypeConfigs, res *Cluster) (map[string]interface{}, error) { - if dcl.IsEmptyValueIndirect(f) { - return nil, nil - } - - m := make(map[string]interface{}) - if v := f.NodeCount; !dcl.IsEmptyValueIndirect(v) { - m["nodeCount"] = v - } - if v := f.CustomCoreCount; !dcl.IsEmptyValueIndirect(v) { - m["customCoreCount"] = v - } - - return m, nil -} - -// flattenClusterNodeTypeConfigs flattens an instance of ClusterNodeTypeConfigs from a JSON -// response object. -func flattenClusterNodeTypeConfigs(c *Client, i interface{}, res *Cluster) *ClusterNodeTypeConfigs { - m, ok := i.(map[string]interface{}) - if !ok { - return nil - } - - r := &ClusterNodeTypeConfigs{} - - if dcl.IsEmptyValueIndirect(i) { - return EmptyClusterNodeTypeConfigs - } - r.NodeCount = dcl.FlattenInteger(m["nodeCount"]) - r.CustomCoreCount = dcl.FlattenInteger(m["customCoreCount"]) - - return r -} - // flattenClusterStateEnumMap flattens the contents of ClusterStateEnum from a JSON // response object. func flattenClusterStateEnumMap(c *Client, i interface{}, res *Cluster) map[string]ClusterStateEnum { @@ -1169,13 +860,7 @@ func convertOpNameToClusterApiOperation(opName string, fieldDiffs []*dcl.FieldDi func extractClusterFields(r *Cluster) error { return nil } -func extractClusterNodeTypeConfigsFields(r *Cluster, o *ClusterNodeTypeConfigs) error { - return nil -} func postReadExtractClusterFields(r *Cluster) error { return nil } -func postReadExtractClusterNodeTypeConfigsFields(r *Cluster, o *ClusterNodeTypeConfigs) error { - return nil -} diff --git a/services/google/vmware/alpha/cluster_schema.go b/services/google/vmware/alpha/cluster_schema.go index d1ca9beccf..d9b2a852c7 100755 --- a/services/google/vmware/alpha/cluster_schema.go +++ b/services/google/vmware/alpha/cluster_schema.go @@ -121,7 +121,6 @@ func DCLClusterSchema() *dcl.Schema { Type: "object", Required: []string{ "name", - "nodeTypeConfigs", "project", "location", "privateCloud", @@ -154,32 +153,6 @@ func DCLClusterSchema() *dcl.Schema { Description: "Output only. The resource name of this cluster. Resource names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names. For example: `projects/my-project/locations/us-west1-a/privateClouds/my-cloud/clusters/my-cluster`", Immutable: true, }, - "nodeTypeConfigs": &dcl.Property{ - Type: "object", - AdditionalProperties: &dcl.Property{ - Type: "object", - GoType: "ClusterNodeTypeConfigs", - Required: []string{ - "nodeCount", - }, - Properties: map[string]*dcl.Property{ - "customCoreCount": &dcl.Property{ - Type: "integer", - Format: "int64", - GoName: "CustomCoreCount", - Description: "Optional. Customized number of cores available to each node of the type. This number must always be one of `nodeType.availableCustomCoreCounts`. If zero is provided max value from `nodeType.availableCustomCoreCounts` will be used.", - }, - "nodeCount": &dcl.Property{ - Type: "integer", - Format: "int64", - GoName: "NodeCount", - Description: "Required. The number of nodes of this type in the cluster", - }, - }, - }, - GoName: "NodeTypeConfigs", - Description: "Required. The map of cluster node types in this cluster, where the key is canonical identifier of the node type (corresponds to the `NodeType`).", - }, "privateCloud": &dcl.Property{ Type: "string", GoName: "PrivateCloud", diff --git a/services/google/vmware/alpha/private_cloud.go b/services/google/vmware/alpha/private_cloud.go index 650e397ca6..a509256f6d 100755 --- a/services/google/vmware/alpha/private_cloud.go +++ b/services/google/vmware/alpha/private_cloud.go @@ -211,9 +211,8 @@ func (r *PrivateCloudNetworkConfig) HashCode() string { } type PrivateCloudManagementCluster struct { - empty bool `json:"-"` - ClusterId *string `json:"clusterId"` - NodeTypeConfigs map[string]PrivateCloudManagementClusterNodeTypeConfigs `json:"nodeTypeConfigs"` + empty bool `json:"-"` + ClusterId *string `json:"clusterId"` } type jsonPrivateCloudManagementCluster PrivateCloudManagementCluster @@ -233,8 +232,6 @@ func (r *PrivateCloudManagementCluster) UnmarshalJSON(data []byte) error { r.ClusterId = res.ClusterId - r.NodeTypeConfigs = res.NodeTypeConfigs - } return nil } @@ -259,55 +256,6 @@ func (r *PrivateCloudManagementCluster) HashCode() string { return fmt.Sprintf("%x", hash) } -type PrivateCloudManagementClusterNodeTypeConfigs struct { - empty bool `json:"-"` - NodeCount *int64 `json:"nodeCount"` - CustomCoreCount *int64 `json:"customCoreCount"` -} - -type jsonPrivateCloudManagementClusterNodeTypeConfigs PrivateCloudManagementClusterNodeTypeConfigs - -func (r *PrivateCloudManagementClusterNodeTypeConfigs) UnmarshalJSON(data []byte) error { - var res jsonPrivateCloudManagementClusterNodeTypeConfigs - if err := json.Unmarshal(data, &res); err != nil { - return err - } - - var m map[string]interface{} - json.Unmarshal(data, &m) - - if len(m) == 0 { - *r = *EmptyPrivateCloudManagementClusterNodeTypeConfigs - } else { - - r.NodeCount = res.NodeCount - - r.CustomCoreCount = res.CustomCoreCount - - } - return nil -} - -// This object is used to assert a desired state where this PrivateCloudManagementClusterNodeTypeConfigs is -// empty. Go lacks global const objects, but this object should be treated -// as one. Modifying this object will have undesirable results. -var EmptyPrivateCloudManagementClusterNodeTypeConfigs *PrivateCloudManagementClusterNodeTypeConfigs = &PrivateCloudManagementClusterNodeTypeConfigs{empty: true} - -func (r *PrivateCloudManagementClusterNodeTypeConfigs) Empty() bool { - return r.empty -} - -func (r *PrivateCloudManagementClusterNodeTypeConfigs) String() string { - return dcl.SprintResource(r) -} - -func (r *PrivateCloudManagementClusterNodeTypeConfigs) HashCode() string { - // Placeholder for a more complex hash method that handles ordering, etc - // Hash resource body for easy comparison later - hash := sha256.New().Sum([]byte(r.String())) - return fmt.Sprintf("%x", hash) -} - type PrivateCloudHcx struct { empty bool `json:"-"` InternalIP *string `json:"internalIP"` diff --git a/services/google/vmware/alpha/private_cloud.yaml b/services/google/vmware/alpha/private_cloud.yaml index aed363749f..bbb0aef881 100755 --- a/services/google/vmware/alpha/private_cloud.yaml +++ b/services/google/vmware/alpha/private_cloud.yaml @@ -153,7 +153,6 @@ components: x-dcl-mutable-unreadable: true required: - clusterId - - nodeTypeConfigs properties: clusterId: type: string @@ -164,32 +163,6 @@ components: character * Ends with a non-hyphen character * Not formatted as a UUID * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) (section 3.5)' - nodeTypeConfigs: - type: object - additionalProperties: - type: object - x-dcl-go-type: PrivateCloudManagementClusterNodeTypeConfigs - required: - - nodeCount - properties: - customCoreCount: - type: integer - format: int64 - x-dcl-go-name: CustomCoreCount - description: Optional. Customized number of cores available to - each node of the type. This number must always be one of `nodeType.availableCustomCoreCounts`. - If zero is provided max value from `nodeType.availableCustomCoreCounts` - will be used. - nodeCount: - type: integer - format: int64 - x-dcl-go-name: NodeCount - description: Required. The number of nodes of this type in the - cluster - x-dcl-go-name: NodeTypeConfigs - description: Required. The map of cluster node types in this cluster, - where the key is canonical identifier of the node type (corresponds - to the `NodeType`). name: type: string x-dcl-go-name: Name diff --git a/services/google/vmware/alpha/private_cloud_alpha_yaml_embed.go b/services/google/vmware/alpha/private_cloud_alpha_yaml_embed.go index 5251652c22..976bdc141a 100755 --- a/services/google/vmware/alpha/private_cloud_alpha_yaml_embed.go +++ b/services/google/vmware/alpha/private_cloud_alpha_yaml_embed.go @@ -17,7 +17,7 @@ package alpha // blaze-out/k8-fastbuild/genfiles/cloud/graphite/mmv2/services/google/vmware/alpha/private_cloud.yaml -var YAML_private_cloud = []byte("info:\n title: Vmware/PrivateCloud\n description: The Vmware PrivateCloud resource\n x-dcl-struct-name: PrivateCloud\n x-dcl-has-iam: true\npaths:\n get:\n description: The function used to get information about a PrivateCloud\n parameters:\n - name: privateCloud\n required: true\n description: A full instance of a PrivateCloud\n apply:\n description: The function used to apply information about a PrivateCloud\n parameters:\n - name: privateCloud\n required: true\n description: A full instance of a PrivateCloud\n delete:\n description: The function used to delete a PrivateCloud\n parameters:\n - name: privateCloud\n required: true\n description: A full instance of a PrivateCloud\n deleteAll:\n description: The function used to delete all PrivateCloud\n parameters:\n - name: project\n required: true\n schema:\n type: string\n - name: location\n required: true\n schema:\n type: string\n list:\n description: The function used to list information about many PrivateCloud\n parameters:\n - name: project\n required: true\n schema:\n type: string\n - name: location\n required: true\n schema:\n type: string\ncomponents:\n schemas:\n PrivateCloud:\n title: PrivateCloud\n x-dcl-id: projects/{{project}}/locations/{{location}}/privateClouds/{{name}}\n x-dcl-uses-state-hint: true\n x-dcl-parent-container: project\n x-dcl-has-create: true\n x-dcl-has-iam: true\n x-dcl-read-timeout: 0\n x-dcl-apply-timeout: 9600\n x-dcl-delete-timeout: 7200\n type: object\n required:\n - name\n - networkConfig\n - managementCluster\n - project\n - location\n properties:\n createTime:\n type: string\n format: date-time\n x-dcl-go-name: CreateTime\n readOnly: true\n description: Output only. Creation time of this resource.\n x-kubernetes-immutable: true\n deleteTime:\n type: string\n format: date-time\n x-dcl-go-name: DeleteTime\n readOnly: true\n description: Output only. Time when the resource was scheduled for deletion.\n x-kubernetes-immutable: true\n description:\n type: string\n x-dcl-go-name: Description\n description: User-provided description for this private cloud.\n expireTime:\n type: string\n format: date-time\n x-dcl-go-name: ExpireTime\n readOnly: true\n description: Output only. Time when the resource will be irreversibly deleted.\n x-kubernetes-immutable: true\n hcx:\n type: object\n x-dcl-go-name: Hcx\n x-dcl-go-type: PrivateCloudHcx\n readOnly: true\n description: Output only. HCX appliance.\n properties:\n fqdn:\n type: string\n x-dcl-go-name: Fqdn\n description: Fully qualified domain name of the appliance.\n internalIP:\n type: string\n x-dcl-go-name: InternalIP\n description: Internal IP address of the appliance.\n state:\n type: string\n x-dcl-go-name: State\n x-dcl-go-type: PrivateCloudHcxStateEnum\n readOnly: true\n description: 'Output only. The state of the appliance. Possible values:\n STATE_UNSPECIFIED, ACTIVE, CREATING'\n x-kubernetes-immutable: true\n enum:\n - STATE_UNSPECIFIED\n - ACTIVE\n - CREATING\n version:\n type: string\n x-dcl-go-name: Version\n description: Version of the appliance.\n location:\n type: string\n x-dcl-go-name: Location\n description: The location for the resource\n x-kubernetes-immutable: true\n x-dcl-references:\n - resource: Locations/Location\n field: name\n parent: true\n managementCluster:\n type: object\n x-dcl-go-name: ManagementCluster\n x-dcl-go-type: PrivateCloudManagementCluster\n description: 'Required. Input only. The management cluster for this private\n cloud. This field is required during creation of the private cloud to\n provide details for the default cluster. The following fields can''t be\n changed after private cloud creation: `ManagementCluster.clusterId`, `ManagementCluster.nodeTypeId`.'\n x-dcl-mutable-unreadable: true\n required:\n - clusterId\n - nodeTypeConfigs\n properties:\n clusterId:\n type: string\n x-dcl-go-name: ClusterId\n description: 'Required. The user-provided identifier of the new `Cluster`.\n The identifier must meet the following requirements: * Only contains\n 1-63 alphanumeric characters and hyphens * Begins with an alphabetical\n character * Ends with a non-hyphen character * Not formatted as a\n UUID * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)\n (section 3.5)'\n nodeTypeConfigs:\n type: object\n additionalProperties:\n type: object\n x-dcl-go-type: PrivateCloudManagementClusterNodeTypeConfigs\n required:\n - nodeCount\n properties:\n customCoreCount:\n type: integer\n format: int64\n x-dcl-go-name: CustomCoreCount\n description: Optional. Customized number of cores available to\n each node of the type. This number must always be one of `nodeType.availableCustomCoreCounts`.\n If zero is provided max value from `nodeType.availableCustomCoreCounts`\n will be used.\n nodeCount:\n type: integer\n format: int64\n x-dcl-go-name: NodeCount\n description: Required. The number of nodes of this type in the\n cluster\n x-dcl-go-name: NodeTypeConfigs\n description: Required. The map of cluster node types in this cluster,\n where the key is canonical identifier of the node type (corresponds\n to the `NodeType`).\n name:\n type: string\n x-dcl-go-name: Name\n description: 'Output only. The resource name of this private cloud. Resource\n names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names.\n For example: `projects/my-project/locations/us-west1-a/privateClouds/my-cloud`'\n x-kubernetes-immutable: true\n networkConfig:\n type: object\n x-dcl-go-name: NetworkConfig\n x-dcl-go-type: PrivateCloudNetworkConfig\n description: Required. Network configuration of the private cloud.\n required:\n - managementCidr\n properties:\n managementCidr:\n type: string\n x-dcl-go-name: ManagementCidr\n description: Required. Management CIDR used by VMware management appliances.\n managementIPAddressLayoutVersion:\n type: integer\n format: int64\n x-dcl-go-name: ManagementIPAddressLayoutVersion\n readOnly: true\n description: 'Output only. The IP address layout version of the management\n IP address range. Possible versions include: * `managementIpAddressLayoutVersion=1`:\n Indicates the legacy IP address layout used by some existing private\n clouds. This is no longer supported for new private clouds as it does\n not support all features. * `managementIpAddressLayoutVersion=2`:\n Indicates the latest IP address layout used by all newly created private\n clouds. This version supports all current features.'\n vmwareEngineNetwork:\n type: string\n x-dcl-go-name: VmwareEngineNetwork\n description: 'Optional. The relative resource name of the VMware Engine\n network attached to the private cloud. Specify the name in the following\n form: `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`\n where `{project}` can either be a project number or a project ID.'\n x-dcl-references:\n - resource: Vmwareengine/VmwareEngineNetwork\n field: name\n vmwareEngineNetworkCanonical:\n type: string\n x-dcl-go-name: VmwareEngineNetworkCanonical\n readOnly: true\n description: 'Output only. The canonical name of the VMware Engine network\n in the form: `projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`'\n x-dcl-references:\n - resource: Vmwareengine/VmwareEngineNetwork\n field: name\n nsx:\n type: object\n x-dcl-go-name: Nsx\n x-dcl-go-type: PrivateCloudNsx\n readOnly: true\n description: Output only. NSX appliance.\n properties:\n fqdn:\n type: string\n x-dcl-go-name: Fqdn\n description: Fully qualified domain name of the appliance.\n internalIP:\n type: string\n x-dcl-go-name: InternalIP\n description: Internal IP address of the appliance.\n state:\n type: string\n x-dcl-go-name: State\n x-dcl-go-type: PrivateCloudNsxStateEnum\n readOnly: true\n description: 'Output only. The state of the appliance. Possible values:\n STATE_UNSPECIFIED, ACTIVE, CREATING'\n x-kubernetes-immutable: true\n enum:\n - STATE_UNSPECIFIED\n - ACTIVE\n - CREATING\n version:\n type: string\n x-dcl-go-name: Version\n description: Version of the appliance.\n project:\n type: string\n x-dcl-go-name: Project\n description: The project for the resource\n x-kubernetes-immutable: true\n x-dcl-references:\n - resource: Cloudresourcemanager/Project\n field: name\n parent: true\n state:\n type: string\n x-dcl-go-name: State\n x-dcl-go-type: PrivateCloudStateEnum\n readOnly: true\n description: 'Output only. State of the resource. New values may be added\n to this enum when appropriate. Possible values: STATE_UNSPECIFIED, ACTIVE,\n CREATING, UPDATING, FAILED, DELETED, PURGING'\n x-kubernetes-immutable: true\n enum:\n - STATE_UNSPECIFIED\n - ACTIVE\n - CREATING\n - UPDATING\n - FAILED\n - DELETED\n - PURGING\n uid:\n type: string\n x-dcl-go-name: Uid\n readOnly: true\n description: Output only. System-generated unique identifier for the resource.\n x-kubernetes-immutable: true\n updateTime:\n type: string\n format: date-time\n x-dcl-go-name: UpdateTime\n readOnly: true\n description: Output only. Last update time of this resource.\n x-kubernetes-immutable: true\n vcenter:\n type: object\n x-dcl-go-name: Vcenter\n x-dcl-go-type: PrivateCloudVcenter\n readOnly: true\n description: Output only. Vcenter appliance.\n properties:\n fqdn:\n type: string\n x-dcl-go-name: Fqdn\n description: Fully qualified domain name of the appliance.\n internalIP:\n type: string\n x-dcl-go-name: InternalIP\n description: Internal IP address of the appliance.\n state:\n type: string\n x-dcl-go-name: State\n x-dcl-go-type: PrivateCloudVcenterStateEnum\n readOnly: true\n description: 'Output only. The state of the appliance. Possible values:\n STATE_UNSPECIFIED, ACTIVE, CREATING'\n x-kubernetes-immutable: true\n enum:\n - STATE_UNSPECIFIED\n - ACTIVE\n - CREATING\n version:\n type: string\n x-dcl-go-name: Version\n description: Version of the appliance.\n") +var YAML_private_cloud = []byte("info:\n title: Vmware/PrivateCloud\n description: The Vmware PrivateCloud resource\n x-dcl-struct-name: PrivateCloud\n x-dcl-has-iam: true\npaths:\n get:\n description: The function used to get information about a PrivateCloud\n parameters:\n - name: privateCloud\n required: true\n description: A full instance of a PrivateCloud\n apply:\n description: The function used to apply information about a PrivateCloud\n parameters:\n - name: privateCloud\n required: true\n description: A full instance of a PrivateCloud\n delete:\n description: The function used to delete a PrivateCloud\n parameters:\n - name: privateCloud\n required: true\n description: A full instance of a PrivateCloud\n deleteAll:\n description: The function used to delete all PrivateCloud\n parameters:\n - name: project\n required: true\n schema:\n type: string\n - name: location\n required: true\n schema:\n type: string\n list:\n description: The function used to list information about many PrivateCloud\n parameters:\n - name: project\n required: true\n schema:\n type: string\n - name: location\n required: true\n schema:\n type: string\ncomponents:\n schemas:\n PrivateCloud:\n title: PrivateCloud\n x-dcl-id: projects/{{project}}/locations/{{location}}/privateClouds/{{name}}\n x-dcl-uses-state-hint: true\n x-dcl-parent-container: project\n x-dcl-has-create: true\n x-dcl-has-iam: true\n x-dcl-read-timeout: 0\n x-dcl-apply-timeout: 9600\n x-dcl-delete-timeout: 7200\n type: object\n required:\n - name\n - networkConfig\n - managementCluster\n - project\n - location\n properties:\n createTime:\n type: string\n format: date-time\n x-dcl-go-name: CreateTime\n readOnly: true\n description: Output only. Creation time of this resource.\n x-kubernetes-immutable: true\n deleteTime:\n type: string\n format: date-time\n x-dcl-go-name: DeleteTime\n readOnly: true\n description: Output only. Time when the resource was scheduled for deletion.\n x-kubernetes-immutable: true\n description:\n type: string\n x-dcl-go-name: Description\n description: User-provided description for this private cloud.\n expireTime:\n type: string\n format: date-time\n x-dcl-go-name: ExpireTime\n readOnly: true\n description: Output only. Time when the resource will be irreversibly deleted.\n x-kubernetes-immutable: true\n hcx:\n type: object\n x-dcl-go-name: Hcx\n x-dcl-go-type: PrivateCloudHcx\n readOnly: true\n description: Output only. HCX appliance.\n properties:\n fqdn:\n type: string\n x-dcl-go-name: Fqdn\n description: Fully qualified domain name of the appliance.\n internalIP:\n type: string\n x-dcl-go-name: InternalIP\n description: Internal IP address of the appliance.\n state:\n type: string\n x-dcl-go-name: State\n x-dcl-go-type: PrivateCloudHcxStateEnum\n readOnly: true\n description: 'Output only. The state of the appliance. Possible values:\n STATE_UNSPECIFIED, ACTIVE, CREATING'\n x-kubernetes-immutable: true\n enum:\n - STATE_UNSPECIFIED\n - ACTIVE\n - CREATING\n version:\n type: string\n x-dcl-go-name: Version\n description: Version of the appliance.\n location:\n type: string\n x-dcl-go-name: Location\n description: The location for the resource\n x-kubernetes-immutable: true\n x-dcl-references:\n - resource: Locations/Location\n field: name\n parent: true\n managementCluster:\n type: object\n x-dcl-go-name: ManagementCluster\n x-dcl-go-type: PrivateCloudManagementCluster\n description: 'Required. Input only. The management cluster for this private\n cloud. This field is required during creation of the private cloud to\n provide details for the default cluster. The following fields can''t be\n changed after private cloud creation: `ManagementCluster.clusterId`, `ManagementCluster.nodeTypeId`.'\n x-dcl-mutable-unreadable: true\n required:\n - clusterId\n properties:\n clusterId:\n type: string\n x-dcl-go-name: ClusterId\n description: 'Required. The user-provided identifier of the new `Cluster`.\n The identifier must meet the following requirements: * Only contains\n 1-63 alphanumeric characters and hyphens * Begins with an alphabetical\n character * Ends with a non-hyphen character * Not formatted as a\n UUID * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034)\n (section 3.5)'\n name:\n type: string\n x-dcl-go-name: Name\n description: 'Output only. The resource name of this private cloud. Resource\n names are schemeless URIs that follow the conventions in https://cloud.google.com/apis/design/resource_names.\n For example: `projects/my-project/locations/us-west1-a/privateClouds/my-cloud`'\n x-kubernetes-immutable: true\n networkConfig:\n type: object\n x-dcl-go-name: NetworkConfig\n x-dcl-go-type: PrivateCloudNetworkConfig\n description: Required. Network configuration of the private cloud.\n required:\n - managementCidr\n properties:\n managementCidr:\n type: string\n x-dcl-go-name: ManagementCidr\n description: Required. Management CIDR used by VMware management appliances.\n managementIPAddressLayoutVersion:\n type: integer\n format: int64\n x-dcl-go-name: ManagementIPAddressLayoutVersion\n readOnly: true\n description: 'Output only. The IP address layout version of the management\n IP address range. Possible versions include: * `managementIpAddressLayoutVersion=1`:\n Indicates the legacy IP address layout used by some existing private\n clouds. This is no longer supported for new private clouds as it does\n not support all features. * `managementIpAddressLayoutVersion=2`:\n Indicates the latest IP address layout used by all newly created private\n clouds. This version supports all current features.'\n vmwareEngineNetwork:\n type: string\n x-dcl-go-name: VmwareEngineNetwork\n description: 'Optional. The relative resource name of the VMware Engine\n network attached to the private cloud. Specify the name in the following\n form: `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`\n where `{project}` can either be a project number or a project ID.'\n x-dcl-references:\n - resource: Vmwareengine/VmwareEngineNetwork\n field: name\n vmwareEngineNetworkCanonical:\n type: string\n x-dcl-go-name: VmwareEngineNetworkCanonical\n readOnly: true\n description: 'Output only. The canonical name of the VMware Engine network\n in the form: `projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}`'\n x-dcl-references:\n - resource: Vmwareengine/VmwareEngineNetwork\n field: name\n nsx:\n type: object\n x-dcl-go-name: Nsx\n x-dcl-go-type: PrivateCloudNsx\n readOnly: true\n description: Output only. NSX appliance.\n properties:\n fqdn:\n type: string\n x-dcl-go-name: Fqdn\n description: Fully qualified domain name of the appliance.\n internalIP:\n type: string\n x-dcl-go-name: InternalIP\n description: Internal IP address of the appliance.\n state:\n type: string\n x-dcl-go-name: State\n x-dcl-go-type: PrivateCloudNsxStateEnum\n readOnly: true\n description: 'Output only. The state of the appliance. Possible values:\n STATE_UNSPECIFIED, ACTIVE, CREATING'\n x-kubernetes-immutable: true\n enum:\n - STATE_UNSPECIFIED\n - ACTIVE\n - CREATING\n version:\n type: string\n x-dcl-go-name: Version\n description: Version of the appliance.\n project:\n type: string\n x-dcl-go-name: Project\n description: The project for the resource\n x-kubernetes-immutable: true\n x-dcl-references:\n - resource: Cloudresourcemanager/Project\n field: name\n parent: true\n state:\n type: string\n x-dcl-go-name: State\n x-dcl-go-type: PrivateCloudStateEnum\n readOnly: true\n description: 'Output only. State of the resource. New values may be added\n to this enum when appropriate. Possible values: STATE_UNSPECIFIED, ACTIVE,\n CREATING, UPDATING, FAILED, DELETED, PURGING'\n x-kubernetes-immutable: true\n enum:\n - STATE_UNSPECIFIED\n - ACTIVE\n - CREATING\n - UPDATING\n - FAILED\n - DELETED\n - PURGING\n uid:\n type: string\n x-dcl-go-name: Uid\n readOnly: true\n description: Output only. System-generated unique identifier for the resource.\n x-kubernetes-immutable: true\n updateTime:\n type: string\n format: date-time\n x-dcl-go-name: UpdateTime\n readOnly: true\n description: Output only. Last update time of this resource.\n x-kubernetes-immutable: true\n vcenter:\n type: object\n x-dcl-go-name: Vcenter\n x-dcl-go-type: PrivateCloudVcenter\n readOnly: true\n description: Output only. Vcenter appliance.\n properties:\n fqdn:\n type: string\n x-dcl-go-name: Fqdn\n description: Fully qualified domain name of the appliance.\n internalIP:\n type: string\n x-dcl-go-name: InternalIP\n description: Internal IP address of the appliance.\n state:\n type: string\n x-dcl-go-name: State\n x-dcl-go-type: PrivateCloudVcenterStateEnum\n readOnly: true\n description: 'Output only. The state of the appliance. Possible values:\n STATE_UNSPECIFIED, ACTIVE, CREATING'\n x-kubernetes-immutable: true\n enum:\n - STATE_UNSPECIFIED\n - ACTIVE\n - CREATING\n version:\n type: string\n x-dcl-go-name: Version\n description: Version of the appliance.\n") -// 12817 bytes -// MD5: 37420c7f1a4988fbedde879ce08d70b9 +// 11522 bytes +// MD5: d79a4b2c5143f65ae9edadcb032599ec diff --git a/services/google/vmware/alpha/private_cloud_internal.go b/services/google/vmware/alpha/private_cloud_internal.go index 5b17e05bf6..95af6cfa74 100755 --- a/services/google/vmware/alpha/private_cloud_internal.go +++ b/services/google/vmware/alpha/private_cloud_internal.go @@ -79,15 +79,6 @@ func (r *PrivateCloudManagementCluster) validate() error { if err := dcl.Required(r, "clusterId"); err != nil { return err } - if err := dcl.Required(r, "nodeTypeConfigs"); err != nil { - return err - } - return nil -} -func (r *PrivateCloudManagementClusterNodeTypeConfigs) validate() error { - if err := dcl.Required(r, "nodeCount"); err != nil { - return err - } return nil } func (r *PrivateCloudHcx) validate() error { @@ -695,23 +686,26 @@ func canonicalizeNewPrivateCloudNetworkConfigSet(c *Client, des, nw []PrivateClo if des == nil { return nw } - var reorderedNew []PrivateCloudNetworkConfig + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PrivateCloudNetworkConfig for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePrivateCloudNetworkConfigNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPrivateCloudNetworkConfig(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPrivateCloudNetworkConfigSlice(c *Client, des, nw []PrivateCloudNetworkConfig) []PrivateCloudNetworkConfig { @@ -753,12 +747,6 @@ func canonicalizePrivateCloudManagementCluster(des, initial *PrivateCloudManagem } else { cDes.ClusterId = des.ClusterId } - if dcl.IsZeroValue(des.NodeTypeConfigs) || (dcl.IsEmptyValueIndirect(des.NodeTypeConfigs) && dcl.IsEmptyValueIndirect(initial.NodeTypeConfigs)) { - // Desired and initial values are equivalent, so set canonical desired value to initial value. - cDes.NodeTypeConfigs = initial.NodeTypeConfigs - } else { - cDes.NodeTypeConfigs = des.NodeTypeConfigs - } return cDes } @@ -816,23 +804,26 @@ func canonicalizeNewPrivateCloudManagementClusterSet(c *Client, des, nw []Privat if des == nil { return nw } - var reorderedNew []PrivateCloudManagementCluster + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PrivateCloudManagementCluster for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePrivateCloudManagementClusterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPrivateCloudManagementCluster(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPrivateCloudManagementClusterSlice(c *Client, des, nw []PrivateCloudManagementCluster) []PrivateCloudManagementCluster { @@ -855,124 +846,6 @@ func canonicalizeNewPrivateCloudManagementClusterSlice(c *Client, des, nw []Priv return items } -func canonicalizePrivateCloudManagementClusterNodeTypeConfigs(des, initial *PrivateCloudManagementClusterNodeTypeConfigs, opts ...dcl.ApplyOption) *PrivateCloudManagementClusterNodeTypeConfigs { - if des == nil { - return initial - } - if des.empty { - return des - } - - if initial == nil { - return des - } - - cDes := &PrivateCloudManagementClusterNodeTypeConfigs{} - - if dcl.IsZeroValue(des.NodeCount) || (dcl.IsEmptyValueIndirect(des.NodeCount) && dcl.IsEmptyValueIndirect(initial.NodeCount)) { - // Desired and initial values are equivalent, so set canonical desired value to initial value. - cDes.NodeCount = initial.NodeCount - } else { - cDes.NodeCount = des.NodeCount - } - if dcl.IsZeroValue(des.CustomCoreCount) || (dcl.IsEmptyValueIndirect(des.CustomCoreCount) && dcl.IsEmptyValueIndirect(initial.CustomCoreCount)) { - // Desired and initial values are equivalent, so set canonical desired value to initial value. - cDes.CustomCoreCount = initial.CustomCoreCount - } else { - cDes.CustomCoreCount = des.CustomCoreCount - } - - return cDes -} - -func canonicalizePrivateCloudManagementClusterNodeTypeConfigsSlice(des, initial []PrivateCloudManagementClusterNodeTypeConfigs, opts ...dcl.ApplyOption) []PrivateCloudManagementClusterNodeTypeConfigs { - if dcl.IsEmptyValueIndirect(des) { - return initial - } - - if len(des) != len(initial) { - - items := make([]PrivateCloudManagementClusterNodeTypeConfigs, 0, len(des)) - for _, d := range des { - cd := canonicalizePrivateCloudManagementClusterNodeTypeConfigs(&d, nil, opts...) - if cd != nil { - items = append(items, *cd) - } - } - return items - } - - items := make([]PrivateCloudManagementClusterNodeTypeConfigs, 0, len(des)) - for i, d := range des { - cd := canonicalizePrivateCloudManagementClusterNodeTypeConfigs(&d, &initial[i], opts...) - if cd != nil { - items = append(items, *cd) - } - } - return items - -} - -func canonicalizeNewPrivateCloudManagementClusterNodeTypeConfigs(c *Client, des, nw *PrivateCloudManagementClusterNodeTypeConfigs) *PrivateCloudManagementClusterNodeTypeConfigs { - - if des == nil { - return nw - } - - if nw == nil { - if dcl.IsEmptyValueIndirect(des) { - c.Config.Logger.Info("Found explicitly empty value for PrivateCloudManagementClusterNodeTypeConfigs while comparing non-nil desired to nil actual. Returning desired object.") - return des - } - return nil - } - - return nw -} - -func canonicalizeNewPrivateCloudManagementClusterNodeTypeConfigsSet(c *Client, des, nw []PrivateCloudManagementClusterNodeTypeConfigs) []PrivateCloudManagementClusterNodeTypeConfigs { - if des == nil { - return nw - } - var reorderedNew []PrivateCloudManagementClusterNodeTypeConfigs - for _, d := range des { - matchedNew := -1 - for idx, n := range nw { - if diffs, _ := comparePrivateCloudManagementClusterNodeTypeConfigsNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx - break - } - } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) - } - } - reorderedNew = append(reorderedNew, nw...) - - return reorderedNew -} - -func canonicalizeNewPrivateCloudManagementClusterNodeTypeConfigsSlice(c *Client, des, nw []PrivateCloudManagementClusterNodeTypeConfigs) []PrivateCloudManagementClusterNodeTypeConfigs { - if des == nil { - return nw - } - - // Lengths are unequal. A diff will occur later, so we shouldn't canonicalize. - // Return the original array. - if len(des) != len(nw) { - return nw - } - - var items []PrivateCloudManagementClusterNodeTypeConfigs - for i, d := range des { - n := nw[i] - items = append(items, *canonicalizeNewPrivateCloudManagementClusterNodeTypeConfigs(c, &d, &n)) - } - - return items -} - func canonicalizePrivateCloudHcx(des, initial *PrivateCloudHcx, opts ...dcl.ApplyOption) *PrivateCloudHcx { if des == nil { return initial @@ -1065,23 +938,26 @@ func canonicalizeNewPrivateCloudHcxSet(c *Client, des, nw []PrivateCloudHcx) []P if des == nil { return nw } - var reorderedNew []PrivateCloudHcx + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PrivateCloudHcx for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePrivateCloudHcxNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPrivateCloudHcx(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPrivateCloudHcxSlice(c *Client, des, nw []PrivateCloudHcx) []PrivateCloudHcx { @@ -1196,23 +1072,26 @@ func canonicalizeNewPrivateCloudNsxSet(c *Client, des, nw []PrivateCloudNsx) []P if des == nil { return nw } - var reorderedNew []PrivateCloudNsx + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PrivateCloudNsx for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePrivateCloudNsxNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPrivateCloudNsx(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPrivateCloudNsxSlice(c *Client, des, nw []PrivateCloudNsx) []PrivateCloudNsx { @@ -1327,23 +1206,26 @@ func canonicalizeNewPrivateCloudVcenterSet(c *Client, des, nw []PrivateCloudVcen if des == nil { return nw } - var reorderedNew []PrivateCloudVcenter + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []PrivateCloudVcenter for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := comparePrivateCloudVcenterNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewPrivateCloudVcenter(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewPrivateCloudVcenterSlice(c *Client, des, nw []PrivateCloudVcenter) []PrivateCloudVcenter { @@ -1567,49 +1449,6 @@ func comparePrivateCloudManagementClusterNewStyle(d, a interface{}, fn dcl.Field } diffs = append(diffs, ds...) } - - if ds, err := dcl.Diff(desired.NodeTypeConfigs, actual.NodeTypeConfigs, dcl.DiffInfo{ObjectFunction: comparePrivateCloudManagementClusterNodeTypeConfigsNewStyle, EmptyObject: EmptyPrivateCloudManagementClusterNodeTypeConfigs, OperationSelector: dcl.TriggersOperation("updatePrivateCloudUpdatePrivateCloudOperation")}, fn.AddNest("NodeTypeConfigs")); len(ds) != 0 || err != nil { - if err != nil { - return nil, err - } - diffs = append(diffs, ds...) - } - return diffs, nil -} - -func comparePrivateCloudManagementClusterNodeTypeConfigsNewStyle(d, a interface{}, fn dcl.FieldName) ([]*dcl.FieldDiff, error) { - var diffs []*dcl.FieldDiff - - desired, ok := d.(*PrivateCloudManagementClusterNodeTypeConfigs) - if !ok { - desiredNotPointer, ok := d.(PrivateCloudManagementClusterNodeTypeConfigs) - if !ok { - return nil, fmt.Errorf("obj %v is not a PrivateCloudManagementClusterNodeTypeConfigs or *PrivateCloudManagementClusterNodeTypeConfigs", d) - } - desired = &desiredNotPointer - } - actual, ok := a.(*PrivateCloudManagementClusterNodeTypeConfigs) - if !ok { - actualNotPointer, ok := a.(PrivateCloudManagementClusterNodeTypeConfigs) - if !ok { - return nil, fmt.Errorf("obj %v is not a PrivateCloudManagementClusterNodeTypeConfigs", a) - } - actual = &actualNotPointer - } - - if ds, err := dcl.Diff(desired.NodeCount, actual.NodeCount, dcl.DiffInfo{OperationSelector: dcl.TriggersOperation("updatePrivateCloudUpdatePrivateCloudOperation")}, fn.AddNest("NodeCount")); len(ds) != 0 || err != nil { - if err != nil { - return nil, err - } - diffs = append(diffs, ds...) - } - - if ds, err := dcl.Diff(desired.CustomCoreCount, actual.CustomCoreCount, dcl.DiffInfo{OperationSelector: dcl.TriggersOperation("updatePrivateCloudUpdatePrivateCloudOperation")}, fn.AddNest("CustomCoreCount")); len(ds) != 0 || err != nil { - if err != nil { - return nil, err - } - diffs = append(diffs, ds...) - } return diffs, nil } @@ -2101,11 +1940,6 @@ func expandPrivateCloudManagementCluster(c *Client, f *PrivateCloudManagementClu if v := f.ClusterId; !dcl.IsEmptyValueIndirect(v) { m["clusterId"] = v } - if v, err := expandPrivateCloudManagementClusterNodeTypeConfigsMap(c, f.NodeTypeConfigs, res); err != nil { - return nil, fmt.Errorf("error expanding NodeTypeConfigs into nodeTypeConfigs: %w", err) - } else if !dcl.IsEmptyValueIndirect(v) { - m["nodeTypeConfigs"] = v - } return m, nil } @@ -2124,125 +1958,6 @@ func flattenPrivateCloudManagementCluster(c *Client, i interface{}, res *Private return EmptyPrivateCloudManagementCluster } r.ClusterId = dcl.FlattenString(m["clusterId"]) - r.NodeTypeConfigs = flattenPrivateCloudManagementClusterNodeTypeConfigsMap(c, m["nodeTypeConfigs"], res) - - return r -} - -// expandPrivateCloudManagementClusterNodeTypeConfigsMap expands the contents of PrivateCloudManagementClusterNodeTypeConfigs into a JSON -// request object. -func expandPrivateCloudManagementClusterNodeTypeConfigsMap(c *Client, f map[string]PrivateCloudManagementClusterNodeTypeConfigs, res *PrivateCloud) (map[string]interface{}, error) { - if f == nil { - return nil, nil - } - - items := make(map[string]interface{}) - for k, item := range f { - i, err := expandPrivateCloudManagementClusterNodeTypeConfigs(c, &item, res) - if err != nil { - return nil, err - } - if i != nil { - items[k] = i - } - } - - return items, nil -} - -// expandPrivateCloudManagementClusterNodeTypeConfigsSlice expands the contents of PrivateCloudManagementClusterNodeTypeConfigs into a JSON -// request object. -func expandPrivateCloudManagementClusterNodeTypeConfigsSlice(c *Client, f []PrivateCloudManagementClusterNodeTypeConfigs, res *PrivateCloud) ([]map[string]interface{}, error) { - if f == nil { - return nil, nil - } - - items := []map[string]interface{}{} - for _, item := range f { - i, err := expandPrivateCloudManagementClusterNodeTypeConfigs(c, &item, res) - if err != nil { - return nil, err - } - - items = append(items, i) - } - - return items, nil -} - -// flattenPrivateCloudManagementClusterNodeTypeConfigsMap flattens the contents of PrivateCloudManagementClusterNodeTypeConfigs from a JSON -// response object. -func flattenPrivateCloudManagementClusterNodeTypeConfigsMap(c *Client, i interface{}, res *PrivateCloud) map[string]PrivateCloudManagementClusterNodeTypeConfigs { - a, ok := i.(map[string]interface{}) - if !ok { - return map[string]PrivateCloudManagementClusterNodeTypeConfigs{} - } - - if len(a) == 0 { - return map[string]PrivateCloudManagementClusterNodeTypeConfigs{} - } - - items := make(map[string]PrivateCloudManagementClusterNodeTypeConfigs) - for k, item := range a { - items[k] = *flattenPrivateCloudManagementClusterNodeTypeConfigs(c, item.(map[string]interface{}), res) - } - - return items -} - -// flattenPrivateCloudManagementClusterNodeTypeConfigsSlice flattens the contents of PrivateCloudManagementClusterNodeTypeConfigs from a JSON -// response object. -func flattenPrivateCloudManagementClusterNodeTypeConfigsSlice(c *Client, i interface{}, res *PrivateCloud) []PrivateCloudManagementClusterNodeTypeConfigs { - a, ok := i.([]interface{}) - if !ok { - return []PrivateCloudManagementClusterNodeTypeConfigs{} - } - - if len(a) == 0 { - return []PrivateCloudManagementClusterNodeTypeConfigs{} - } - - items := make([]PrivateCloudManagementClusterNodeTypeConfigs, 0, len(a)) - for _, item := range a { - items = append(items, *flattenPrivateCloudManagementClusterNodeTypeConfigs(c, item.(map[string]interface{}), res)) - } - - return items -} - -// expandPrivateCloudManagementClusterNodeTypeConfigs expands an instance of PrivateCloudManagementClusterNodeTypeConfigs into a JSON -// request object. -func expandPrivateCloudManagementClusterNodeTypeConfigs(c *Client, f *PrivateCloudManagementClusterNodeTypeConfigs, res *PrivateCloud) (map[string]interface{}, error) { - if dcl.IsEmptyValueIndirect(f) { - return nil, nil - } - - m := make(map[string]interface{}) - if v := f.NodeCount; !dcl.IsEmptyValueIndirect(v) { - m["nodeCount"] = v - } - if v := f.CustomCoreCount; !dcl.IsEmptyValueIndirect(v) { - m["customCoreCount"] = v - } - - return m, nil -} - -// flattenPrivateCloudManagementClusterNodeTypeConfigs flattens an instance of PrivateCloudManagementClusterNodeTypeConfigs from a JSON -// response object. -func flattenPrivateCloudManagementClusterNodeTypeConfigs(c *Client, i interface{}, res *PrivateCloud) *PrivateCloudManagementClusterNodeTypeConfigs { - m, ok := i.(map[string]interface{}) - if !ok { - return nil - } - - r := &PrivateCloudManagementClusterNodeTypeConfigs{} - - if dcl.IsEmptyValueIndirect(i) { - return EmptyPrivateCloudManagementClusterNodeTypeConfigs - } - r.NodeCount = dcl.FlattenInteger(m["nodeCount"]) - r.CustomCoreCount = dcl.FlattenInteger(m["customCoreCount"]) return r } @@ -2977,9 +2692,6 @@ func extractPrivateCloudNetworkConfigFields(r *PrivateCloud, o *PrivateCloudNetw func extractPrivateCloudManagementClusterFields(r *PrivateCloud, o *PrivateCloudManagementCluster) error { return nil } -func extractPrivateCloudManagementClusterNodeTypeConfigsFields(r *PrivateCloud, o *PrivateCloudManagementClusterNodeTypeConfigs) error { - return nil -} func extractPrivateCloudHcxFields(r *PrivateCloud, o *PrivateCloudHcx) error { return nil } @@ -3054,9 +2766,6 @@ func postReadExtractPrivateCloudNetworkConfigFields(r *PrivateCloud, o *PrivateC func postReadExtractPrivateCloudManagementClusterFields(r *PrivateCloud, o *PrivateCloudManagementCluster) error { return nil } -func postReadExtractPrivateCloudManagementClusterNodeTypeConfigsFields(r *PrivateCloud, o *PrivateCloudManagementClusterNodeTypeConfigs) error { - return nil -} func postReadExtractPrivateCloudHcxFields(r *PrivateCloud, o *PrivateCloudHcx) error { return nil } diff --git a/services/google/vmware/alpha/private_cloud_schema.go b/services/google/vmware/alpha/private_cloud_schema.go index 490657e618..f30e3e4f79 100755 --- a/services/google/vmware/alpha/private_cloud_schema.go +++ b/services/google/vmware/alpha/private_cloud_schema.go @@ -203,7 +203,6 @@ func DCLPrivateCloudSchema() *dcl.Schema { Unreadable: true, Required: []string{ "clusterId", - "nodeTypeConfigs", }, Properties: map[string]*dcl.Property{ "clusterId": &dcl.Property{ @@ -211,32 +210,6 @@ func DCLPrivateCloudSchema() *dcl.Schema { GoName: "ClusterId", Description: "Required. The user-provided identifier of the new `Cluster`. The identifier must meet the following requirements: * Only contains 1-63 alphanumeric characters and hyphens * Begins with an alphabetical character * Ends with a non-hyphen character * Not formatted as a UUID * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) (section 3.5)", }, - "nodeTypeConfigs": &dcl.Property{ - Type: "object", - AdditionalProperties: &dcl.Property{ - Type: "object", - GoType: "PrivateCloudManagementClusterNodeTypeConfigs", - Required: []string{ - "nodeCount", - }, - Properties: map[string]*dcl.Property{ - "customCoreCount": &dcl.Property{ - Type: "integer", - Format: "int64", - GoName: "CustomCoreCount", - Description: "Optional. Customized number of cores available to each node of the type. This number must always be one of `nodeType.availableCustomCoreCounts`. If zero is provided max value from `nodeType.availableCustomCoreCounts` will be used.", - }, - "nodeCount": &dcl.Property{ - Type: "integer", - Format: "int64", - GoName: "NodeCount", - Description: "Required. The number of nodes of this type in the cluster", - }, - }, - }, - GoName: "NodeTypeConfigs", - Description: "Required. The map of cluster node types in this cluster, where the key is canonical identifier of the node type (corresponds to the `NodeType`).", - }, }, }, "name": &dcl.Property{ diff --git a/services/google/vmware/alpha/vmware_engine_network_internal.go b/services/google/vmware/alpha/vmware_engine_network_internal.go index 9ad1c628f3..9a0449b272 100755 --- a/services/google/vmware/alpha/vmware_engine_network_internal.go +++ b/services/google/vmware/alpha/vmware_engine_network_internal.go @@ -618,23 +618,26 @@ func canonicalizeNewVmwareEngineNetworkVPCNetworksSet(c *Client, des, nw []Vmwar if des == nil { return nw } - var reorderedNew []VmwareEngineNetworkVPCNetworks + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []VmwareEngineNetworkVPCNetworks for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareVmwareEngineNetworkVPCNetworksNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewVmwareEngineNetworkVPCNetworks(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewVmwareEngineNetworkVPCNetworksSlice(c *Client, des, nw []VmwareEngineNetworkVPCNetworks) []VmwareEngineNetworkVPCNetworks { diff --git a/services/google/vpcaccess/alpha/connector_internal.go b/services/google/vpcaccess/alpha/connector_internal.go index d6f0562df1..ebcbe6a743 100755 --- a/services/google/vpcaccess/alpha/connector_internal.go +++ b/services/google/vpcaccess/alpha/connector_internal.go @@ -575,23 +575,26 @@ func canonicalizeNewConnectorSubnetSet(c *Client, des, nw []ConnectorSubnet) []C if des == nil { return nw } - var reorderedNew []ConnectorSubnet + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConnectorSubnet for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConnectorSubnetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConnectorSubnet(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConnectorSubnetSlice(c *Client, des, nw []ConnectorSubnet) []ConnectorSubnet { diff --git a/services/google/vpcaccess/beta/connector_internal.go b/services/google/vpcaccess/beta/connector_internal.go index 6cff556430..e96d668201 100755 --- a/services/google/vpcaccess/beta/connector_internal.go +++ b/services/google/vpcaccess/beta/connector_internal.go @@ -575,23 +575,26 @@ func canonicalizeNewConnectorSubnetSet(c *Client, des, nw []ConnectorSubnet) []C if des == nil { return nw } - var reorderedNew []ConnectorSubnet + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConnectorSubnet for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConnectorSubnetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConnectorSubnet(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConnectorSubnetSlice(c *Client, des, nw []ConnectorSubnet) []ConnectorSubnet { diff --git a/services/google/vpcaccess/connector_internal.go b/services/google/vpcaccess/connector_internal.go index 72e999f832..208dc1d28c 100755 --- a/services/google/vpcaccess/connector_internal.go +++ b/services/google/vpcaccess/connector_internal.go @@ -575,23 +575,26 @@ func canonicalizeNewConnectorSubnetSet(c *Client, des, nw []ConnectorSubnet) []C if des == nil { return nw } - var reorderedNew []ConnectorSubnet + + // Find the elements in des that are also in nw and canonicalize them. Remove matched elements from nw. + var items []ConnectorSubnet for _, d := range des { - matchedNew := -1 - for idx, n := range nw { + matchedIndex := -1 + for i, n := range nw { if diffs, _ := compareConnectorSubnetNewStyle(&d, &n, dcl.FieldName{}); len(diffs) == 0 { - matchedNew = idx + matchedIndex = i break } } - if matchedNew != -1 { - reorderedNew = append(reorderedNew, nw[matchedNew]) - nw = append(nw[:matchedNew], nw[matchedNew+1:]...) + if matchedIndex != -1 { + items = append(items, *canonicalizeNewConnectorSubnet(c, &d, &nw[matchedIndex])) + nw = append(nw[:matchedIndex], nw[matchedIndex+1:]...) } } - reorderedNew = append(reorderedNew, nw...) + // Also include elements in nw that are not matched in des. + items = append(items, nw...) - return reorderedNew + return items } func canonicalizeNewConnectorSubnetSlice(c *Client, des, nw []ConnectorSubnet) []ConnectorSubnet { diff --git a/unstructured/google/vmware/alpha/cluster.go b/unstructured/google/vmware/alpha/cluster.go index e3a345904d..f88a2c7666 100755 --- a/unstructured/google/vmware/alpha/cluster.go +++ b/unstructured/google/vmware/alpha/cluster.go @@ -44,20 +44,6 @@ func ClusterToUnstructured(r *dclService.Cluster) *unstructured.Resource { if r.Name != nil { u.Object["name"] = *r.Name } - if r.NodeTypeConfigs != nil { - rNodeTypeConfigs := make(map[string]interface{}) - for k, v := range r.NodeTypeConfigs { - rNodeTypeConfigsMap := make(map[string]interface{}) - if v.CustomCoreCount != nil { - rNodeTypeConfigsMap["customCoreCount"] = *v.CustomCoreCount - } - if v.NodeCount != nil { - rNodeTypeConfigsMap["nodeCount"] = *v.NodeCount - } - rNodeTypeConfigs[k] = rNodeTypeConfigsMap - } - u.Object["nodeTypeConfigs"] = rNodeTypeConfigs - } if r.PrivateCloud != nil { u.Object["privateCloud"] = *r.PrivateCloud } @@ -106,36 +92,6 @@ func UnstructuredToCluster(u *unstructured.Resource) (*dclService.Cluster, error return nil, fmt.Errorf("r.Name: expected string") } } - if _, ok := u.Object["nodeTypeConfigs"]; ok { - if rNodeTypeConfigs, ok := u.Object["nodeTypeConfigs"].(map[string]interface{}); ok { - m := make(map[string]dclService.ClusterNodeTypeConfigs) - for k, v := range rNodeTypeConfigs { - if objval, ok := v.(map[string]interface{}); ok { - var rNodeTypeConfigsObj dclService.ClusterNodeTypeConfigs - if _, ok := objval["customCoreCount"]; ok { - if i, ok := objval["customCoreCount"].(int64); ok { - rNodeTypeConfigsObj.CustomCoreCount = dcl.Int64(i) - } else { - return nil, fmt.Errorf("rNodeTypeConfigsObj.CustomCoreCount: expected int64") - } - } - if _, ok := objval["nodeCount"]; ok { - if i, ok := objval["nodeCount"].(int64); ok { - rNodeTypeConfigsObj.NodeCount = dcl.Int64(i) - } else { - return nil, fmt.Errorf("rNodeTypeConfigsObj.NodeCount: expected int64") - } - } - m[k] = rNodeTypeConfigsObj - } else { - return nil, fmt.Errorf("r.NodeTypeConfigs: expected map[string]interface{}") - } - } - r.NodeTypeConfigs = m - } else { - return nil, fmt.Errorf("r.NodeTypeConfigs: expected map[string]interface{}") - } - } if _, ok := u.Object["privateCloud"]; ok { if s, ok := u.Object["privateCloud"].(string); ok { r.PrivateCloud = dcl.String(s) diff --git a/unstructured/google/vmware/alpha/private_cloud.go b/unstructured/google/vmware/alpha/private_cloud.go index 7671f6e485..1094799b07 100755 --- a/unstructured/google/vmware/alpha/private_cloud.go +++ b/unstructured/google/vmware/alpha/private_cloud.go @@ -70,20 +70,6 @@ func PrivateCloudToUnstructured(r *dclService.PrivateCloud) *unstructured.Resour if r.ManagementCluster.ClusterId != nil { rManagementCluster["clusterId"] = *r.ManagementCluster.ClusterId } - if r.ManagementCluster.NodeTypeConfigs != nil { - rManagementClusterNodeTypeConfigs := make(map[string]interface{}) - for k, v := range r.ManagementCluster.NodeTypeConfigs { - rManagementClusterNodeTypeConfigsMap := make(map[string]interface{}) - if v.CustomCoreCount != nil { - rManagementClusterNodeTypeConfigsMap["customCoreCount"] = *v.CustomCoreCount - } - if v.NodeCount != nil { - rManagementClusterNodeTypeConfigsMap["nodeCount"] = *v.NodeCount - } - rManagementClusterNodeTypeConfigs[k] = rManagementClusterNodeTypeConfigsMap - } - rManagementCluster["nodeTypeConfigs"] = rManagementClusterNodeTypeConfigs - } u.Object["managementCluster"] = rManagementCluster } if r.Name != nil { @@ -234,36 +220,6 @@ func UnstructuredToPrivateCloud(u *unstructured.Resource) (*dclService.PrivateCl return nil, fmt.Errorf("r.ManagementCluster.ClusterId: expected string") } } - if _, ok := rManagementCluster["nodeTypeConfigs"]; ok { - if rManagementClusterNodeTypeConfigs, ok := rManagementCluster["nodeTypeConfigs"].(map[string]interface{}); ok { - m := make(map[string]dclService.PrivateCloudManagementClusterNodeTypeConfigs) - for k, v := range rManagementClusterNodeTypeConfigs { - if objval, ok := v.(map[string]interface{}); ok { - var rManagementClusterNodeTypeConfigsObj dclService.PrivateCloudManagementClusterNodeTypeConfigs - if _, ok := objval["customCoreCount"]; ok { - if i, ok := objval["customCoreCount"].(int64); ok { - rManagementClusterNodeTypeConfigsObj.CustomCoreCount = dcl.Int64(i) - } else { - return nil, fmt.Errorf("rManagementClusterNodeTypeConfigsObj.CustomCoreCount: expected int64") - } - } - if _, ok := objval["nodeCount"]; ok { - if i, ok := objval["nodeCount"].(int64); ok { - rManagementClusterNodeTypeConfigsObj.NodeCount = dcl.Int64(i) - } else { - return nil, fmt.Errorf("rManagementClusterNodeTypeConfigsObj.NodeCount: expected int64") - } - } - m[k] = rManagementClusterNodeTypeConfigsObj - } else { - return nil, fmt.Errorf("r.ManagementCluster.NodeTypeConfigs: expected map[string]interface{}") - } - } - r.ManagementCluster.NodeTypeConfigs = m - } else { - return nil, fmt.Errorf("r.ManagementCluster.NodeTypeConfigs: expected map[string]interface{}") - } - } } else { return nil, fmt.Errorf("r.ManagementCluster: expected map[string]interface{}") }