class Projects extends Resource (View source)

The "projects" collection of methods.

Typical usage is:

 $scriptService = new Google\Service\Script(...);
 $projects = $scriptService->projects;

Methods

create(CreateProjectRequest $postBody, array $optParams = [])

Creates a new, empty script project with no script files and a base manifest file. (projects.create)

get(string $scriptId, array $optParams = [])

Gets a script project's metadata. (projects.get)

getContent(string $scriptId, array $optParams = [])

Gets the content of the script project, including the code source and metadata for each script file. (projects.getContent)

getMetrics(string $scriptId, array $optParams = [])

Get metrics data for scripts, such as number of executions and active users.

updateContent(string $scriptId, Content $postBody, array $optParams = [])

Updates the content of the specified script project. This content is stored as the HEAD version, and is used when the script is executed as a trigger, in the script editor, in add-on preview mode, or as a web app or Apps Script API in development mode. This clears all the existing files in the project.

Details

Project create(CreateProjectRequest $postBody, array $optParams = [])

Creates a new, empty script project with no script files and a base manifest file. (projects.create)

Parameters

CreateProjectRequest $postBody
array $optParams

Optional parameters.

Return Value

Project

Exceptions

Exception

Project get(string $scriptId, array $optParams = [])

Gets a script project's metadata. (projects.get)

Parameters

string $scriptId

The script project's Drive ID.

array $optParams

Optional parameters.

Return Value

Project

Exceptions

Exception

Content getContent(string $scriptId, array $optParams = [])

Gets the content of the script project, including the code source and metadata for each script file. (projects.getContent)

Parameters

string $scriptId

The script project's Drive ID.

array $optParams

Optional parameters.

Return Value

Content

Exceptions

Exception

Metrics getMetrics(string $scriptId, array $optParams = [])

Get metrics data for scripts, such as number of executions and active users.

(projects.getMetrics)

Parameters

string $scriptId

Required field indicating the script to get metrics for.

array $optParams

Optional parameters.

Return Value

Metrics

Exceptions

Exception

Content updateContent(string $scriptId, Content $postBody, array $optParams = [])

Updates the content of the specified script project. This content is stored as the HEAD version, and is used when the script is executed as a trigger, in the script editor, in add-on preview mode, or as a web app or Apps Script API in development mode. This clears all the existing files in the project.

(projects.updateContent)

Parameters

string $scriptId

The script project's Drive ID.

Content $postBody
array $optParams

Optional parameters.

Return Value

Content

Exceptions

Exception