code: func (os *ResourceInstanceObjectSrc) Decode(ty cty.Type) (*ResourceInstanceObject, error) {
  	var val cty.Value
  	var err error
  	if os.AttrsFlat != nil {
  		// Legacy mode. We'll do our best to unpick this from the flatmap.
  		val, err = hcl2shim.HCL2ValueFromFlatmap(os.AttrsFlat, ty)
  		if err != nil {
  			return nil, err
  		}
  	} else {
  		val, err = ctyjson.Unmarshal(os.AttrsJSON, ty)
  		if err != nil {
  			return nil, err
  		}
  	}
  
  	return &ResourceInstanceObject{
  		Value:        val,
  		Status:       os.Status,
  		Dependencies: os.Dependencies,
  		Private:      os.Private,
  	}, nil
  }
docs: // Decode unmarshals the raw representation of the object attributes. Pass the
  // implied type of the corresponding resource type schema for correct operation.
  //
  // Before calling Decode, the caller must check that the SchemaVersion field
  // exactly equals the version number of the schema whose implied type is being
  // passed, or else the result is undefined.
  //
  // The returned object may share internal references with the receiver and
  // so the caller must not mutate the receiver any further once once this
  // method is called.