44 "context"
55 "encoding/json"
66 "fmt"
7+ "strconv"
8+
79 "github.com/disaster37/go-kibana-rest/v8/kbapi"
810 "github.com/elastic/terraform-provider-elasticstack/internal/clients"
911 "github.com/elastic/terraform-provider-elasticstack/internal/utils"
@@ -25,7 +27,6 @@ import (
2527 "github.com/hashicorp/terraform-plugin-framework/tfsdk"
2628 "github.com/hashicorp/terraform-plugin-framework/types"
2729 "github.com/hashicorp/terraform-plugin-framework/types/basetypes"
28- "strconv"
2930)
3031
3132const (
@@ -857,7 +858,7 @@ func (v *tfModelV0) toMonitorFields(ctx context.Context) (kbapi.MonitorFields, d
857858
858859func toTFAlertConfig (ctx context.Context , v basetypes.ObjectValue ) * kbapi.MonitorAlertConfig {
859860 var alert * kbapi.MonitorAlertConfig
860- if ! ( v .IsNull () || v .IsUnknown () ) {
861+ if ! v .IsNull () && ! v .IsUnknown () {
861862 tfAlert := tfAlertConfigV0 {}
862863 tfsdk .ValueAs (ctx , v , & tfAlert )
863864 alert = tfAlert .toTfAlertConfigV0 ()
@@ -899,7 +900,7 @@ func tfInt64ToString(v types.Int64) string {
899900func toSSLConfig (ctx context.Context , dg diag.Diagnostics , v tfSSLConfig , p string ) (* kbapi.SSLConfig , diag.Diagnostics ) {
900901
901902 var ssl * kbapi.SSLConfig
902- if ! ( v .SslSupportedProtocols .IsNull () || v .SslSupportedProtocols .IsUnknown () ) {
903+ if ! v .SslSupportedProtocols .IsNull () && ! v .SslSupportedProtocols .IsUnknown () {
903904 sslSupportedProtocols := utils .ListTypeToSlice_String (ctx , v .SslSupportedProtocols , path .Root (p ).AtName ("ssl_supported_protocols" ), & dg )
904905 if dg .HasError () {
905906 return nil , dg
@@ -908,7 +909,7 @@ func toSSLConfig(ctx context.Context, dg diag.Diagnostics, v tfSSLConfig, p stri
908909 ssl .SupportedProtocols = sslSupportedProtocols
909910 }
910911
911- if ! ( v .SslVerificationMode .IsNull () || v .SslVerificationMode .IsUnknown () ) {
912+ if ! v .SslVerificationMode .IsNull () && ! v .SslVerificationMode .IsUnknown () {
912913 if ssl == nil {
913914 ssl = & kbapi.SSLConfig {}
914915 }
@@ -923,21 +924,21 @@ func toSSLConfig(ctx context.Context, dg diag.Diagnostics, v tfSSLConfig, p stri
923924 ssl .CertificateAuthorities = certAuths
924925 }
925926
926- if ! ( v .SslCertificate .IsUnknown () || v .SslCertificate .IsNull () ) {
927+ if ! v .SslCertificate .IsUnknown () && ! v .SslCertificate .IsNull () {
927928 if ssl == nil {
928929 ssl = & kbapi.SSLConfig {}
929930 }
930931 ssl .Certificate = v .SslCertificate .ValueString ()
931932 }
932933
933- if ! ( v .SslKey .IsUnknown () || v .SslKey .IsNull () ) {
934+ if ! v .SslKey .IsUnknown () && ! v .SslKey .IsNull () {
934935 if ssl == nil {
935936 ssl = & kbapi.SSLConfig {}
936937 }
937938 ssl .Key = v .SslKey .ValueString ()
938939 }
939940
940- if ! ( v .SslKeyPassphrase .IsUnknown () || v .SslKeyPassphrase .IsNull () ) {
941+ if ! v .SslKeyPassphrase .IsUnknown () && ! v .SslKeyPassphrase .IsNull () {
941942 if ssl == nil {
942943 ssl = & kbapi.SSLConfig {}
943944 }
0 commit comments