Accessing a Class members in SwiftSyntax

I am trying to create a @freestanding macro to create a Sendable version of my classes.
assuming :

Class Foo{
  var name : String
  var age : Int
}

#SendableCreator<Foo>
//this should produce somthing like this
struct SendableFoo: Sendable{
  var name : String
  var age : Int
}

this is my currenct code :
declaration:

@freestanding(declaration,names:arbitrary)
public macro SendableTypeCreator<T>() = #externalMacro(
module: "DataBaseMacroMacros", 
type: "SendableTypeCreatorMacro"
)

implementation:

public struct SendableTypeCreatorMacro : DeclarationMacro {
    public static func expansion(of node: some SwiftSyntax.FreestandingMacroExpansionSyntax, in context: some SwiftSyntaxMacros.MacroExpansionContext) throws -> [SwiftSyntax.DeclSyntax] {

        
        guard let genericClass = node.genericArgumentClause?.arguments.first?.argument .as(IdentifierTypeSyntax.self) else{
            fatalError("Not a valid generic class")
        }
        
        let className = genericClass.name.text
        
        let sendableStruct = try StructDeclSyntax("struct Sendable\(raw: className) : Sendable") {
            try VariableDeclSyntax(#"var name : String = "" "#)
        }
        return [.init(sendableStruct)]
    }
    
    
}

but I also want to access the members of my genericArgument class. How can I do that ?!

You would have to implement this as an attached macro that would attach to the class definition. Since macros only have access to the part of the source file that they’re attached to, a freestanding macro can’t read the stored properties of the class.