From e23b03aca10fd12efd28ddc30b6faa5f9ef07f20 Mon Sep 17 00:00:00 2001 From: Justin Chadwell Date: Wed, 17 Jan 2024 16:17:48 +0000 Subject: [PATCH] feat: add File.name (#6431) * feat: add File.name function Signed-off-by: Justin Chadwell * chore: add changelog for pr 6431 Signed-off-by: Justin Chadwell --------- Signed-off-by: Justin Chadwell --- dagger.gen.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dagger.gen.go b/dagger.gen.go index a60f3414e..e78b5c7a7 100644 --- a/dagger.gen.go +++ b/dagger.gen.go @@ -2234,6 +2234,7 @@ type File struct { contents *string export *bool id *FileID + name *string size *int sync *FileID } @@ -2325,6 +2326,19 @@ func (r *File) MarshalJSON() ([]byte, error) { return json.Marshal(id) } +// Retrieves the name of the file. +func (r *File) Name(ctx context.Context) (string, error) { + if r.name != nil { + return *r.name, nil + } + q := r.q.Select("name") + + var response string + + q = q.Bind(&response) + return response, q.Execute(ctx, r.c) +} + // Retrieves the size of the file, in bytes. func (r *File) Size(ctx context.Context) (int, error) { if r.size != nil {