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