github.com/hashicorp/terraform-plugin-sdk@v1.17.2/internal/tfdiags/simple_warning.go (about)

     1  package tfdiags
     2  
     3  type simpleWarning string
     4  
     5  var _ Diagnostic = simpleWarning("")
     6  
     7  // SimpleWarning constructs a simple (summary-only) warning diagnostic.
     8  func SimpleWarning(msg string) Diagnostic {
     9  	return simpleWarning(msg)
    10  }
    11  
    12  func (e simpleWarning) Severity() Severity {
    13  	return Warning
    14  }
    15  
    16  func (e simpleWarning) Description() Description {
    17  	return Description{
    18  		Summary: string(e),
    19  	}
    20  }
    21  
    22  func (e simpleWarning) Source() Source {
    23  	// No source information available for a simple warning
    24  	return Source{}
    25  }
    26  
    27  func (e simpleWarning) FromExpr() *FromExpr {
    28  	// Simple warnings are not expression-related
    29  	return nil
    30  }