Skip to content

Commit

Permalink
Bug fix - Removed repeat code in SetData()
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaqchenO committed Nov 6, 2023
1 parent 3ef07ef commit 0c150d1
Show file tree
Hide file tree
Showing 256 changed files with 0 additions and 567 deletions.
1 change: 0 additions & 1 deletion internal/service/adm/adm_remediation_recipe_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ func (s *AdmRemediationRecipeDataSourceCrud) SetData() error {
s.D.Set("display_name", *s.Res.DisplayName)
}

s.D.Set("freeform_tags", s.Res.FreeformTags)
s.D.Set("freeform_tags", s.Res.FreeformTags)

if s.Res.IsRunTriggeredOnKbChange != nil {
Expand Down
7 changes: 0 additions & 7 deletions internal/service/adm/adm_remediation_recipe_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,6 @@ func (s *AdmRemediationRecipeResourceCrud) SetData() error {
s.D.Set("display_name", *s.Res.DisplayName)
}

s.D.Set("freeform_tags", s.Res.FreeformTags)
s.D.Set("freeform_tags", s.Res.FreeformTags)

if s.Res.IsRunTriggeredOnKbChange != nil {
Expand Down Expand Up @@ -922,7 +921,6 @@ func (s *AdmRemediationRecipeResourceCrud) mapToDetectConfiguration(fieldKeyForm
func DetectConfigurationToMap(obj *oci_adm.DetectConfiguration) map[string]interface{} {
result := map[string]interface{}{}

result["exclusions"] = obj.Exclusions
result["exclusions"] = obj.Exclusions

if obj.MaxPermissibleCvssV2Score != nil {
Expand Down Expand Up @@ -998,7 +996,6 @@ func RemediationRecipeSummaryToMap(obj oci_adm.RemediationRecipeSummary) map[str
result["display_name"] = string(*obj.DisplayName)
}

result["freeform_tags"] = obj.FreeformTags
result["freeform_tags"] = obj.FreeformTags

if obj.Id != nil {
Expand Down Expand Up @@ -1255,7 +1252,6 @@ func VerifyConfigurationToMap(obj *oci_adm.VerifyConfiguration) map[string]inter
case oci_adm.GitHubActionsConfiguration:
result["build_service_type"] = "GITHUB_ACTIONS"

result["additional_parameters"] = v.AdditionalParameters
result["additional_parameters"] = v.AdditionalParameters

if v.PatSecretId != nil {
Expand All @@ -1276,7 +1272,6 @@ func VerifyConfigurationToMap(obj *oci_adm.VerifyConfiguration) map[string]inter
case oci_adm.GitLabPipelineConfiguration:
result["build_service_type"] = "GITLAB_PIPELINE"

result["additional_parameters"] = v.AdditionalParameters
result["additional_parameters"] = v.AdditionalParameters

if v.PatSecretId != nil {
Expand All @@ -1297,7 +1292,6 @@ func VerifyConfigurationToMap(obj *oci_adm.VerifyConfiguration) map[string]inter
case oci_adm.JenkinsPipelineConfiguration:
result["build_service_type"] = "JENKINS_PIPELINE"

result["additional_parameters"] = v.AdditionalParameters
result["additional_parameters"] = v.AdditionalParameters

if v.JenkinsUrl != nil {
Expand All @@ -1320,7 +1314,6 @@ func VerifyConfigurationToMap(obj *oci_adm.VerifyConfiguration) map[string]inter
case oci_adm.OciDevOpsBuildConfiguration:
result["build_service_type"] = "OCI_DEVOPS_BUILD"

result["additional_parameters"] = v.AdditionalParameters
result["additional_parameters"] = v.AdditionalParameters

if v.PipelineId != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ func (s *AdmRemediationRunApplicationDependencyRecommendationsDataSourceCrud) Se
func ApplicationDependencyRecommendationSummaryToMap(obj oci_adm.ApplicationDependencyRecommendationSummary) map[string]interface{} {
result := map[string]interface{}{}

result["application_dependency_node_ids"] = obj.ApplicationDependencyNodeIds
result["application_dependency_node_ids"] = obj.ApplicationDependencyNodeIds

if obj.Gav != nil {
Expand Down
1 change: 0 additions & 1 deletion internal/service/adm/adm_remediation_run_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ func (s *AdmRemediationRunDataSourceCrud) SetData() error {
s.D.Set("display_name", *s.Res.DisplayName)
}

s.D.Set("freeform_tags", s.Res.FreeformTags)
s.D.Set("freeform_tags", s.Res.FreeformTags)

if s.Res.RemediationRecipeId != nil {
Expand Down
2 changes: 0 additions & 2 deletions internal/service/adm/adm_remediation_run_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,6 @@ func (s *AdmRemediationRunResourceCrud) SetData() error {
s.D.Set("display_name", *s.Res.DisplayName)
}

s.D.Set("freeform_tags", s.Res.FreeformTags)
s.D.Set("freeform_tags", s.Res.FreeformTags)

if s.Res.RemediationRecipeId != nil {
Expand Down Expand Up @@ -452,7 +451,6 @@ func RemediationRunSummaryToMap(obj oci_adm.RemediationRunSummary) map[string]in
result["display_name"] = string(*obj.DisplayName)
}

result["freeform_tags"] = obj.FreeformTags
result["freeform_tags"] = obj.FreeformTags

if obj.Id != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ func (s *AiAnomalyDetectionDetectAnomalyJobDataSourceCrud) SetData() error {
s.D.Set("display_name", *s.Res.DisplayName)
}

s.D.Set("freeform_tags", s.Res.FreeformTags)
s.D.Set("freeform_tags", s.Res.FreeformTags)

if s.Res.InputDetails != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,26 +256,22 @@ func EvaluationResultSummaryToMap(obj oci_ai_language.EvaluationResultSummary) m
}

result["freeform_tags"] = v.FreeformTags
result["freeform_tags"] = v.FreeformTags
case oci_ai_language.TextClassificationModelEvaluationResult:
result["model_type"] = "TEXT_CLASSIFICATION"

if v.Location != nil {
result["location"] = string(*v.Location)
}

result["predicted_labels"] = v.PredictedLabels
result["predicted_labels"] = v.PredictedLabels

result["true_labels"] = v.TrueLabels
result["true_labels"] = v.TrueLabels

if v.DefinedTags != nil {
result["defined_tags"] = tfresource.DefinedTagsToMap(v.DefinedTags)
}

result["freeform_tags"] = v.FreeformTags
result["freeform_tags"] = v.FreeformTags
default:
log.Printf("[WARN] Received 'model_type' of unknown type %v", obj)
return nil
Expand Down
1 change: 0 additions & 1 deletion internal/service/ai_language/ai_language_model_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -1381,7 +1381,6 @@ func LocationDetailsToMap(obj *oci_ai_language.LocationDetails) map[string]inter
}

result["object_names"] = v.ObjectNames
result["object_names"] = v.ObjectNames
default:
log.Printf("[WARN] Received 'location_type' of unknown type %v", *obj)
return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ func (s *AiLanguageModelTypeDataSourceCrud) SetData() error {
fmt.Printf("Capabilities%s\n", string(buf))
s.D.Set("capabilities", string(buf))

s.D.Set("versions", s.Res.Versions)
s.D.Set("versions", s.Res.Versions)

return nil
Expand Down
3 changes: 0 additions & 3 deletions internal/service/apigateway/apigateway_deployment_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -3506,10 +3506,8 @@ func (s *ApigatewayDeploymentResourceCrud) mapToAdditionalValidationPolicy(field
func AdditionalValidationPolicyToMap(obj *oci_apigateway.AdditionalValidationPolicy) map[string]interface{} {
result := map[string]interface{}{}

result["audiences"] = obj.Audiences
result["audiences"] = obj.Audiences

result["issuers"] = obj.Issuers
result["issuers"] = obj.Issuers

verifyClaims := []interface{}{}
Expand Down Expand Up @@ -4000,7 +3998,6 @@ func ApiSpecificationRouteBackendToMap(obj *oci_apigateway.ApiSpecificationRoute
case oci_apigateway.OAuth2LogoutBackend:
result["type"] = "OAUTH2_LOGOUT_BACKEND"

result["allowed_post_logout_uris"] = v.AllowedPostLogoutUris
result["allowed_post_logout_uris"] = v.AllowedPostLogoutUris

if v.PostLogoutState != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ func (s *BdsBdsInstanceGetOsPatchDataSourceCrud) SetData() error {
s.D.Set("min_bds_version", *s.Res.MinBdsVersion)
}

s.D.Set("min_compatible_odh_version_map", s.Res.MinCompatibleOdhVersionMap)
s.D.Set("min_compatible_odh_version_map", s.Res.MinCompatibleOdhVersionMap)

s.D.Set("patch_type", s.Res.PatchType)
Expand All @@ -158,7 +157,6 @@ func OsPatchPackageSummaryToMap(obj oci_bds.OsPatchPackageSummary) map[string]in
result["package_name"] = string(*obj.PackageName)
}

result["related_cv_es"] = obj.RelatedCVEs
result["related_cv_es"] = obj.RelatedCVEs

if obj.TargetVersion != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ func (s *CloudBridgeAgentDataSourceCrud) SetData() error {
s.D.Set("environment_id", *s.Res.EnvironmentId)
}

s.D.Set("freeform_tags", s.Res.FreeformTags)
s.D.Set("freeform_tags", s.Res.FreeformTags)

s.D.Set("heart_beat_status", s.Res.HeartBeatStatus)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ func (s *CloudBridgeAgentDependencyDataSourceCrud) SetData() error {
s.D.Set("e_tag", *s.Res.ETag)
}

s.D.Set("freeform_tags", s.Res.FreeformTags)
s.D.Set("freeform_tags", s.Res.FreeformTags)

if s.Res.LifecycleDetails != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,6 @@ func (s *CloudBridgeAgentDependencyResourceCrud) SetData() error {
s.D.Set("e_tag", *s.Res.ETag)
}

s.D.Set("freeform_tags", s.Res.FreeformTags)
s.D.Set("freeform_tags", s.Res.FreeformTags)

if s.Res.LifecycleDetails != nil {
Expand Down Expand Up @@ -618,7 +617,6 @@ func AgentDependencySummaryToMap(obj oci_cloud_bridge.AgentDependencySummary) ma
result["e_tag"] = string(*obj.ETag)
}

result["freeform_tags"] = obj.FreeformTags
result["freeform_tags"] = obj.FreeformTags

if obj.Id != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ func (s *CloudBridgeAgentPluginDataSourceCrud) SetData() error {

s.D.Set("desired_state", s.Res.DesiredState)

s.D.Set("freeform_tags", s.Res.FreeformTags)
s.D.Set("freeform_tags", s.Res.FreeformTags)

if s.Res.LifecycleDetails != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@ func (s *CloudBridgeAgentPluginResourceCrud) SetData() error {

s.D.Set("desired_state", s.Res.DesiredState)

s.D.Set("freeform_tags", s.Res.FreeformTags)
s.D.Set("freeform_tags", s.Res.FreeformTags)

if s.Res.LifecycleDetails != nil {
Expand Down
3 changes: 0 additions & 3 deletions internal/service/cloud_bridge/cloud_bridge_agent_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,6 @@ func (s *CloudBridgeAgentResourceCrud) SetData() error {
s.D.Set("environment_id", *s.Res.EnvironmentId)
}

s.D.Set("freeform_tags", s.Res.FreeformTags)
s.D.Set("freeform_tags", s.Res.FreeformTags)

s.D.Set("heart_beat_status", s.Res.HeartBeatStatus)
Expand Down Expand Up @@ -590,7 +589,6 @@ func AgentSummaryToMap(obj oci_cloud_bridge.AgentSummary) map[string]interface{}
result["environment_id"] = string(*obj.EnvironmentId)
}

result["freeform_tags"] = obj.FreeformTags
result["freeform_tags"] = obj.FreeformTags

result["heart_beat_status"] = string(obj.HeartBeatStatus)
Expand Down Expand Up @@ -639,7 +637,6 @@ func PluginSummaryToMap(obj oci_cloud_bridge.PluginSummary) map[string]interface
result["defined_tags"] = tfresource.DefinedTagsToMap(obj.DefinedTags)
}

result["freeform_tags"] = obj.FreeformTags
result["freeform_tags"] = obj.FreeformTags

if obj.LifecycleDetails != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ func ApplianceImageSummaryToMap(obj oci_cloud_bridge.ApplianceImageSummary) map[
result["format"] = string(*obj.Format)
}

result["freeform_tags"] = obj.FreeformTags
result["freeform_tags"] = obj.FreeformTags

if obj.Id != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ func (s *CloudBridgeAssetDataSourceCrud) SetData() error {
s.D.Set("vm", nil)
}

s.D.Set("asset_source_ids", v.AssetSourceIds)
s.D.Set("asset_source_ids", v.AssetSourceIds)

if v.CompartmentId != nil {
Expand All @@ -101,7 +100,6 @@ func (s *CloudBridgeAssetDataSourceCrud) SetData() error {
s.D.Set("external_asset_key", *v.ExternalAssetKey)
}

s.D.Set("freeform_tags", v.FreeformTags)
s.D.Set("freeform_tags", v.FreeformTags)

if v.InventoryId != nil {
Expand Down Expand Up @@ -152,7 +150,6 @@ func (s *CloudBridgeAssetDataSourceCrud) SetData() error {
s.D.Set("vmware_vm", nil)
}

s.D.Set("asset_source_ids", v.AssetSourceIds)
s.D.Set("asset_source_ids", v.AssetSourceIds)

if v.CompartmentId != nil {
Expand All @@ -171,7 +168,6 @@ func (s *CloudBridgeAssetDataSourceCrud) SetData() error {
s.D.Set("external_asset_key", *v.ExternalAssetKey)
}

s.D.Set("freeform_tags", v.FreeformTags)
s.D.Set("freeform_tags", v.FreeformTags)

if v.InventoryId != nil {
Expand Down
8 changes: 0 additions & 8 deletions internal/service/cloud_bridge/cloud_bridge_asset_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,6 @@ func (s *CloudBridgeAssetResourceCrud) SetData() error {
s.D.Set("vm", nil)
}

s.D.Set("asset_source_ids", v.AssetSourceIds)
s.D.Set("asset_source_ids", v.AssetSourceIds)

if v.CompartmentId != nil {
Expand All @@ -822,7 +821,6 @@ func (s *CloudBridgeAssetResourceCrud) SetData() error {
s.D.Set("external_asset_key", *v.ExternalAssetKey)
}

s.D.Set("freeform_tags", v.FreeformTags)
s.D.Set("freeform_tags", v.FreeformTags)

if v.Id != nil {
Expand Down Expand Up @@ -877,7 +875,6 @@ func (s *CloudBridgeAssetResourceCrud) SetData() error {
s.D.Set("vmware_vm", nil)
}

s.D.Set("asset_source_ids", v.AssetSourceIds)
s.D.Set("asset_source_ids", v.AssetSourceIds)

if v.CompartmentId != nil {
Expand All @@ -896,7 +893,6 @@ func (s *CloudBridgeAssetResourceCrud) SetData() error {
s.D.Set("external_asset_key", *v.ExternalAssetKey)
}

s.D.Set("freeform_tags", v.FreeformTags)
s.D.Set("freeform_tags", v.FreeformTags)

if v.Id != nil {
Expand Down Expand Up @@ -934,7 +930,6 @@ func (s *CloudBridgeAssetResourceCrud) SetData() error {
func AssetSummaryToMap(obj oci_cloud_bridge.AssetSummary) map[string]interface{} {
result := map[string]interface{}{}

result["asset_source_ids"] = obj.AssetSourceIds
result["asset_source_ids"] = obj.AssetSourceIds

result["asset_type"] = string(obj.AssetType)
Expand All @@ -955,7 +950,6 @@ func AssetSummaryToMap(obj oci_cloud_bridge.AssetSummary) map[string]interface{}
result["external_asset_key"] = string(*obj.ExternalAssetKey)
}

result["freeform_tags"] = obj.FreeformTags
result["freeform_tags"] = obj.FreeformTags

if obj.Id != nil {
Expand Down Expand Up @@ -1557,7 +1551,6 @@ func (s *CloudBridgeAssetResourceCrud) mapToNic(fieldKeyFormat string) (oci_clou
func NicToMap(obj oci_cloud_bridge.Nic) map[string]interface{} {
result := map[string]interface{}{}

result["ip_addresses"] = obj.IpAddresses
result["ip_addresses"] = obj.IpAddresses

if obj.Label != nil {
Expand Down Expand Up @@ -1857,7 +1850,6 @@ func VmwareVmPropertiesToMap(obj *oci_cloud_bridge.VmwareVmProperties) map[strin
result["cluster"] = string(*obj.Cluster)
}

result["customer_fields"] = obj.CustomerFields
result["customer_fields"] = obj.CustomerFields

customerTags := []interface{}{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ func (s *CloudBridgeAssetSourceDataSourceCrud) SetData() error {
s.D.Set("environment_id", *v.EnvironmentId)
}

s.D.Set("freeform_tags", v.FreeformTags)
s.D.Set("freeform_tags", v.FreeformTags)

if v.InventoryId != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,6 @@ func (s *CloudBridgeAssetSourceResourceCrud) SetData() error {
s.D.Set("environment_id", *v.EnvironmentId)
}

s.D.Set("freeform_tags", v.FreeformTags)
s.D.Set("freeform_tags", v.FreeformTags)

if v.InventoryId != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ func (s *CloudBridgeDiscoveryScheduleDataSourceCrud) SetData() error {
s.D.Set("execution_recurrences", *s.Res.ExecutionRecurrences)
}

s.D.Set("freeform_tags", s.Res.FreeformTags)
s.D.Set("freeform_tags", s.Res.FreeformTags)

if s.Res.LifecycleDetails != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ func (s *CloudBridgeDiscoveryScheduleResourceCrud) SetData() error {
s.D.Set("execution_recurrences", *s.Res.ExecutionRecurrences)
}

s.D.Set("freeform_tags", s.Res.FreeformTags)
s.D.Set("freeform_tags", s.Res.FreeformTags)

if s.Res.LifecycleDetails != nil {
Expand Down Expand Up @@ -319,7 +318,6 @@ func DiscoveryScheduleSummaryToMap(obj oci_cloud_bridge.DiscoveryScheduleSummary
result["display_name"] = string(*obj.DisplayName)
}

result["freeform_tags"] = obj.FreeformTags
result["freeform_tags"] = obj.FreeformTags

if obj.Id != nil {
Expand Down
Loading

0 comments on commit 0c150d1

Please sign in to comment.