code: func SetBoolPtr(d *schema.ResourceData, key string, val *bool) error {
  	if val == nil {
  		return nil
  	}
  	err := d.Set(key, val)
  	return err
  }
docs: // SetBoolPtr sets a ResourceData field depending on if a *bool exists or not.
  // The field is not set if it's nil.