func (d *ResourceData) Partial(on bool) {
	d.partial = on
	if on {
		if d.partialMap == nil {
			d.partialMap = make(map[string]struct{})
		}
	} else {
		d.partialMap = nil
	}
}
Partial turns partial state mode on/off.

When partial state mode is enabled, then only key prefixes specified
by SetPartial will be in the final state. This allows providers to return
partial states for partially applied resources (when errors occur).
package schema
import (
	"log"
	"reflect"
	"strings"
	"sync"
	"time"
	"github.com/hashicorp/terraform/terraform"
)
type ResourceData struct {
	schema   map[string]*Schema
	config   *terraform.ResourceConfig
	state    *terraform.InstanceState
	diff     *terraform.InstanceDiff
	meta     map[string]interface{}
	timeouts *ResourceTimeout
	multiReader *MultiLevelFieldReader
	setWriter   *MapFieldWriter
	newState    *terraform.InstanceState
	partial     bool
	partialMap  map[string]struct{}
	once        sync.Once
	isNew       bool
}
type getResult struct {
	Value          interface{}
	ValueProcessed interface{}
	Computed       bool
	Exists         bool
	Schema         *Schema
}
func (d *ResourceData) UnsafeSetFieldRaw(key string, value string) {
	d.once.Do(d.init)
	d.setWriter.unsafeWriteField(key, value)
}
func (d *ResourceData) Get(key string) interface{} {
	v, _ := d.GetOk(key)
	return v
}
func (d *ResourceData) GetChange(key string) (interface{}, interface{}) {
	o, n := d.getChange(key, getSourceState, getSourceDiff)
	return o.Value, n.Value
}
func (d *ResourceData) GetOk(key string) (interface{}, bool) {
	r := d.getRaw(key, getSourceSet)
	exists := r.Exists && !r.Computed
	if exists {
		value := r.Value
		zero := r.Schema.Type.Zero()
		if eq, ok := value.(Equal); ok {
			exists = !eq.Equal(zero)
		} else {
			exists = !reflect.DeepEqual(value, zero)
		}
	}
	return r.Value, exists
}
func (d *ResourceData) getRaw(key string, level getSource) getResult {
	var parts []string
	if key != "" {
		parts = strings.Split(key, ".")
	}
	return d.get(parts, level)
}
func (d *ResourceData) HasChange(key string) bool {
	o, n := d.GetChange(key)
	if eq, ok := o.(Equal); ok {
		return !eq.Equal(n)
	}
	return !reflect.DeepEqual(o, n)
}