File
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Un singolo file all'interno di un progetto di script. Un file è un codice sorgente di terze parti creato da uno o più sviluppatori. Può trattarsi di un codice JS lato server, HTML o un file di configurazione. Ogni progetto di script può contenere più file.
Rappresentazione JSON |
{
"name": string,
"type": enum (FileType ),
"source": string,
"lastModifyUser": {
object (User )
},
"createTime": string,
"updateTime": string,
"functionSet": {
object (FunctionSet )
}
} |
Campi |
name |
string
Il nome del file. L'estensione del file non fa parte del nome del file, che può essere identificato dal campo Tipo.
|
type |
enum (FileType )
Il tipo di file.
|
source |
string
Il contenuto del file.
|
lastModifyUser |
object (User )
L'utente che ha modificato il file più di recente. I dettagli visibili in questo oggetto sono controllati dalle impostazioni di visibilità del profilo dell'utente autore dell'ultima modifica.
|
createTime |
string (Timestamp format)
Timestamp della data di creazione. Un timestamp in formato "Zulu" UTC RFC3339, con risoluzione al nanosecondo e fino a nove cifre frazionarie. Esempi: "2014-10-02T15:01:23Z" e "2014-10-02T15:01:23.045123456Z" .
|
updateTime |
string (Timestamp format)
Timestamp della data dell'ultima modifica. Un timestamp in formato "Zulu" UTC RFC3339, con risoluzione al nanosecondo e fino a nove cifre frazionarie. Esempi: "2014-10-02T15:01:23Z" e "2014-10-02T15:01:23.045123456Z" .
|
functionSet |
object (FunctionSet )
Il set di funzioni definito nel file di script, se presente.
|
FileType
Un'enumerazione di diversi tipi di file.
Enum |
ENUM_TYPE_UNSPECIFIED |
Tipo di file non determinato; mai utilizzato. |
SERVER_JS |
Un file di codice lato server di Apps Script. |
HTML |
Un file contenente codice HTML lato client. |
JSON |
Un file in formato JSON. Questo tipo viene utilizzato solo per il manifest del progetto di script. I contenuti del file manifest devono corrispondere alla struttura di un ScriptManifest valido |
FunctionSet
Un insieme di funzioni. Non sono consentiti duplicati.
Rappresentazione JSON |
{
"values": [
{
object (Function )
}
]
} |
Campi |
values[] |
object (Function )
Un elenco delle funzioni che compongono l'insieme.
|
Funzione
Rappresenta una funzione in un progetto di script.
Rappresentazione JSON |
{
"name": string,
"parameters": [
string
]
} |
Campi |
name |
string
Il nome della funzione nel progetto di script.
|
parameters[] |
string
L'elenco ordinato dei nomi dei parametri della funzione nel progetto script.
|
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-08-17 UTC.
[null,null,["Ultimo aggiornamento 2025-08-17 UTC."],[[["\u003cp\u003eA file in a script project represents third-party source code and can be server-side JS, HTML, or a configuration file.\u003c/p\u003e\n"],["\u003cp\u003eEach script project can contain multiple files, each with properties like name, type, source code, and modification details.\u003c/p\u003e\n"],["\u003cp\u003eFiles can contain a set of functions, each defined by its name and parameters, contributing to the script's functionality.\u003c/p\u003e\n"],["\u003cp\u003eFiles can be of various types, including server-side JavaScript, HTML, JSON for the project manifest, ensuring diverse script capabilities.\u003c/p\u003e\n"]]],[],null,["# File\n\n- [JSON representation](#SCHEMA_REPRESENTATION)\n- [FileType](#FileType)\n- [FunctionSet](#FunctionSet)\n - [JSON representation](#FunctionSet.SCHEMA_REPRESENTATION)\n- [Function](#Function)\n - [JSON representation](#Function.SCHEMA_REPRESENTATION)\n\nAn individual file within a script project. A file is a third-party source code created by one or more developers. It can be a server-side JS code, HTML, or a configuration file. Each script project can contain multiple files.\n\n| JSON representation |\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"name\": string, \"type\": enum (/apps-script/api/reference/rest/v1/File#FileType), \"source\": string, \"lastModifyUser\": { object (/apps-script/api/reference/rest/v1/projects#User) }, \"createTime\": string, \"updateTime\": string, \"functionSet\": { object (/apps-script/api/reference/rest/v1/File#FunctionSet) } } ``` |\n\n| Fields ||\n|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` The name of the file. The file extension is not part of the file name, which can be identified from the type field. |\n| `type` | `enum (`[FileType](/apps-script/api/reference/rest/v1/File#FileType)`)` The type of the file. |\n| `source` | `string` The file content. |\n| `lastModifyUser` | `object (`[User](/apps-script/api/reference/rest/v1/projects#User)`)` The user who modified the file most recently. The details visible in this object are controlled by the profile visibility settings of the last modifying user. |\n| `createTime` | `string (`[Timestamp](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp)` format)` Creation date timestamp. A timestamp in RFC3339 UTC \"Zulu\" format, with nanosecond resolution and up to nine fractional digits. Examples: `\"2014-10-02T15:01:23Z\"` and `\"2014-10-02T15:01:23.045123456Z\"`. |\n| `updateTime` | `string (`[Timestamp](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp)` format)` Last modified date timestamp. A timestamp in RFC3339 UTC \"Zulu\" format, with nanosecond resolution and up to nine fractional digits. Examples: `\"2014-10-02T15:01:23Z\"` and `\"2014-10-02T15:01:23.045123456Z\"`. |\n| `functionSet` | `object (`[FunctionSet](/apps-script/api/reference/rest/v1/File#FunctionSet)`)` The defined set of functions in the script file, if any. |\n\nFileType\n--------\n\nAn enumeration of different types of files.\n\n| Enums ||\n|-------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `ENUM_TYPE_UNSPECIFIED` | Undetermined file type; never actually used. |\n| `SERVER_JS` | An Apps Script server-side code file. |\n| `HTML` | A file containing client-side HTML. |\n| `JSON` | A file in JSON format. This type is only used for the script project's manifest. The manifest file content must match the structure of a valid [ScriptManifest](/apps-script/concepts/manifests) |\n\nFunctionSet\n-----------\n\nA set of functions. No duplicates are permitted.\n\n| JSON representation |\n|-----------------------------------------------------------------------------------------|\n| ``` { \"values\": [ { object (/apps-script/api/reference/rest/v1/File#Function) } ] } ``` |\n\n| Fields ||\n|------------|------------------------------------------------------------------------------------------------------------------|\n| `values[]` | `object (`[Function](/apps-script/api/reference/rest/v1/File#Function)`)` A list of functions composing the set. |\n\nFunction\n--------\n\nRepresents a function in a script project.\n\n| JSON representation |\n|------------------------------------------------------|\n| ``` { \"name\": string, \"parameters\": [ string ] } ``` |\n\n| Fields ||\n|----------------|-------------------------------------------------------------------------------------|\n| `name` | `string` The function name in the script project. |\n| `parameters[]` | `string` The ordered list of parameter names of the function in the script project. |"]]