code: func (t *ResourceTimeout) metaEncode(ids interface{}) error {
  	m := make(map[string]interface{})
  
  	if t.Create != nil {
  		m[TimeoutCreate] = t.Create.Nanoseconds()
  	}
  	if t.Read != nil {
  		m[TimeoutRead] = t.Read.Nanoseconds()
  	}
  	if t.Update != nil {
  		m[TimeoutUpdate] = t.Update.Nanoseconds()
  	}
  	if t.Delete != nil {
  		m[TimeoutDelete] = t.Delete.Nanoseconds()
  	}
  	if t.Default != nil {
  		m[TimeoutDefault] = t.Default.Nanoseconds()
  		// for any key above that is nil, if default is specified, we need to
  		// populate it with the default
  		for _, k := range timeoutKeys() {
  			if _, ok := m[k]; !ok {
  				m[k] = t.Default.Nanoseconds()
  			}
  		}
  	}
  
  	// only add the Timeout to the Meta if we have values
  	if len(m) > 0 {
  		switch instance := ids.(type) {
  		case *terraform.InstanceDiff:
  			if instance.Meta == nil {
  				instance.Meta = make(map[string]interface{})
  			}
  			instance.Meta[TimeoutKey] = m
  		case *terraform.InstanceState:
  			if instance.Meta == nil {
  				instance.Meta = make(map[string]interface{})
  			}
  			instance.Meta[TimeoutKey] = m
  		default:
  			return fmt.Errorf("Error matching type for Diff Encode")
  		}
  	}
  
  	return nil
  }
docs: // metaEncode encodes the ResourceTimeout into a map[string]interface{} format
  // and stores it in the Meta field of the interface it's given.
  // Assumes the interface is either *terraform.InstanceState or
  // *terraform.InstanceDiff, returns an error otherwise