initial working version

This commit is contained in:
Ben Miller
2024-11-04 01:06:00 -07:00
parent b2af2fc98c
commit 0fd89bc9ea
73 changed files with 38650 additions and 4 deletions

13
init.ps1 Normal file
View File

@ -0,0 +1,13 @@
# installs fnm (Fast Node Manager)
winget install Schniz.fnm
# configure fnm environment
fnm env --use-on-cd | Out-String | Invoke-Expression
# download and install Node.js
fnm use --install-if-missing 22
# verifies the right Node.js version is in the environment
node -v # should print `v22.11.0`
# verifies the right npm version is in the environment
npm -v # should print `10.9.0`
npm i -g '@google/clasp'
npm i -D '@types/google-apps-script'

14
node_modules/.package-lock.json generated vendored Normal file
View File

@ -0,0 +1,14 @@
{
"name": "product_inventory",
"lockfileVersion": 3,
"requires": true,
"packages": {
"node_modules/@types/google-apps-script": {
"version": "1.0.84",
"resolved": "https://registry.npmjs.org/@types/google-apps-script/-/google-apps-script-1.0.84.tgz",
"integrity": "sha512-qZBeCyk3vJBGEiWtBSRrV89KVovdo9qruw1rQH8OZAQUgXS8RNbMKnnPI5dW+PuJwM8rMiYZpvl6LeaW9IS+WA==",
"dev": true,
"license": "MIT"
}
}
}

21
node_modules/@types/google-apps-script/LICENSE generated vendored Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

15
node_modules/@types/google-apps-script/README.md generated vendored Normal file
View File

@ -0,0 +1,15 @@
# Installation
> `npm install --save @types/google-apps-script`
# Summary
This package contains type definitions for google-apps-script (https://developers.google.com/apps-script/).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/google-apps-script.
### Additional Details
* Last updated: Sun, 13 Oct 2024 11:07:15 GMT
* Dependencies: none
# Credits
These definitions were written by [PopGoesTheWza](https://github.com/PopGoesTheWza), [motemen](https://github.com/motemen), [pierluigi-montagna](https://github.com/pierluigi-montagna), and [mtgto](https://github.com/mtgto).

View File

@ -0,0 +1,232 @@
declare namespace GoogleAppsScript {
/**
* @summary Apps Script Addon Event Objects
* @see https://developers.google.com/workspace/add-ons/concepts/event-objects
*/
namespace Addons {
/**
* @summary Addon Event Object
* @see https://developers.google.com/workspace/add-ons/concepts/event-objects#event_object_structure
*/
interface EventObject {
commonEventObject: CommonEventObject;
calendar?: CalendarEventObject | undefined;
docs?: DocsEventObject | undefined;
drive?: DriveEventObject | undefined;
gmail?: GmailEventObject | undefined;
sheets?: SheetsEventObject | undefined;
slides?: SlidesEventObject | undefined;
}
type InvitationResponseStatus = "accepted" | "declined" | "needsAction" | "tentative";
/**
* @summary Object with information on individual attendees to Calendar events
* @see https://developers.google.com/workspace/add-ons/concepts/event-objects#attendee
*/
interface AttendeeObject {
additionalGuests: number;
comment: string;
displayName: string;
email: string;
optional: boolean;
organizer: boolean;
resource: boolean;
responseStatus: InvitationResponseStatus;
self: boolean;
}
type EntryPointFeature = "toll" | "toll_free";
type EntryPointType = "more" | "phone" | "sip" | "video";
/**
* @summary Object with information on means of accessing a conference
* @see https://developers.google.com/workspace/add-ons/concepts/event-objects#entry_point
*/
interface EntryPointObject {
accessCode: string;
entryPointFeatures: EntryPointFeature[];
entryPointType: EntryPointType;
label: string;
meetingCode: string;
passcode: string;
password: string;
pin: string;
regionCode: string;
uri: string;
}
/**
* @summary Object with information on conferences attached to Calendar events
* @see https://developers.google.com/workspace/add-ons/concepts/event-objects#conference_data
*/
interface ConferenceDataObject {
conferenceId: string;
conferenceSolution: {
iconUri: string;
key: {
type: "eventHangout" | "eventNamedHangout" | "hangoutsMeet";
};
name: string;
};
entryPoints: EntryPointObject[];
notes: string;
parameters: {
addOnParameters: { [key: string]: string };
};
}
/**
* @summary Event object with information on user's calendar and events
* @see https://developers.google.com/workspace/add-ons/concepts/event-objects#calendar_event_object
*/
interface CalendarEventObject {
attendees: AttendeeObject[];
calendarId: string;
id: string;
capabilities: {
canAddAttendees: boolean;
canSeeAttendees: boolean;
canSeeConferenceData: boolean;
canSetConferenceData: boolean;
conferenceData: ConferenceDataObject;
};
organizer: {
email: string;
};
recurringEventId: string;
}
/**
* @summary Event object with information on user's document and its contents
* @see https://developers.google.com/workspace/add-ons/concepts/event-objects#docs_event_object
*/
interface DocsEventObject {
id?: string | undefined;
title?: string | undefined;
addonHasFileScopePermission: boolean;
}
/**
* @summary Object with information on Drive items
* @see https://developers.google.com/workspace/add-ons/concepts/event-objects#drive_item
*/
interface DriveItemObject {
addonHasFileScopePermission: boolean;
id: string;
iconUrl: string;
mimeType: string;
title: string;
}
/**
* @summary Event object with information on user's Drive and its contents
* @see https://developers.google.com/workspace/add-ons/concepts/event-objects#drive_event_object
*/
interface DriveEventObject {
activeCursorItem: DriveItemObject;
selectedItems: DriveItemObject[];
}
/**
* @summary Event object with information on user's Gmail messages
* @see https://developers.google.com/workspace/add-ons/concepts/event-objects#gmail_event_object
*/
interface GmailEventObject {
accessToken: string;
bccRecipients?: string[] | undefined;
ccRecipients?: string[] | undefined;
messageId: string;
threadId: string;
toRecipients?: string[] | undefined;
}
/**
* @summary Event object with information on user's spreadsheet and its contents
* @see https://developers.google.com/workspace/add-ons/concepts/event-objects#sheets_event_object
*/
interface SheetsEventObject {
id?: string | undefined;
title?: string | undefined;
addonHasFileScopePermission: boolean;
}
/**
* @summary Event object with information on user's presentation and its contents
* @see https://developers.google.com/workspace/add-ons/concepts/event-objects#slides_event_object
*/
interface SlidesEventObject {
id?: string | undefined;
title?: string | undefined;
addonHasFileScopePermission: boolean;
}
type Platform = "WEB" | "IOS" | "ANDROID";
type HostApplication = "GMAIL" | "CALENDAR" | "DRIVE" | "DOCS" | "SHEETS" | "SLIDES";
/**
* @summary Event object with host-independent information
* @see https://developers.google.com/workspace/add-ons/concepts/event-objects#common_event_object
*/
interface CommonEventObject {
userLocale?: string | undefined;
timeZone?: {
id: string;
offset: string;
} | undefined;
platform: Platform;
parameters: { [key: string]: string };
hostApp: HostApplication;
formInputs: {
[ID: string]: {
// For Rhino, always one key only <"">
"": {
stringInputs?: StringInputObject | undefined;
dateInput?: DateInputObject | undefined;
timeInput?: TimeInputObject | undefined;
dateTimeInput?: DateTimeInputObject | undefined;
};
// For V8 (recommended)
stringInputs?: StringInputObject | undefined;
dateInput?: DateInputObject | undefined;
timeInput?: TimeInputObject | undefined;
dateTimeInput?: DateTimeInputObject | undefined;
};
};
}
/**
* @summary Signle and multi-value text widgets object
*/
interface StringInputObject {
value: string[];
}
/**
* @summary DatePicker formInputs object
* @see https://developers.google.com/workspace/add-ons/concepts/event-objects#date-input
*/
interface DateInputObject {
msSinceEpoch: string;
}
/**
* @summary TimePicker formInputs object
* @see https://developers.google.com/workspace/add-ons/concepts/event-objects#time-input
*/
interface TimeInputObject {
hours: number;
minutes: number;
}
/**
* @summary DateTimePicker formInputs object
* @see https://developers.google.com/workspace/add-ons/concepts/event-objects#date-time-input
*/
interface DateTimeInputObject {
hasDate: boolean;
hasTime: boolean;
msSinceEpoch: string;
}
}
}

View File

@ -0,0 +1,461 @@
declare namespace GoogleAppsScript {
namespace Adsense {
namespace Collection {
namespace Accounts {
namespace Adunits {
interface CustomchannelsCollection {
// List all custom channels which the specified ad unit belongs to.
list(accountId: string, adClientId: string, adUnitId: string): Adsense.Schema.CustomChannels;
// List all custom channels which the specified ad unit belongs to.
list(
accountId: string,
adClientId: string,
adUnitId: string,
optionalArgs: object,
): Adsense.Schema.CustomChannels;
}
}
namespace Customchannels {
interface AdunitsCollection {
// List all ad units in the specified custom channel.
list(accountId: string, adClientId: string, customChannelId: string): Adsense.Schema.AdUnits;
// List all ad units in the specified custom channel.
list(
accountId: string,
adClientId: string,
customChannelId: string,
optionalArgs: object,
): Adsense.Schema.AdUnits;
}
}
namespace Reports {
interface SavedCollection {
// Generate an AdSense report based on the saved report ID sent in the query parameters.
generate(
accountId: string,
savedReportId: string,
): Adsense.Schema.AdsenseReportsGenerateResponse;
// Generate an AdSense report based on the saved report ID sent in the query parameters.
generate(
accountId: string,
savedReportId: string,
optionalArgs: object,
): Adsense.Schema.AdsenseReportsGenerateResponse;
// List all saved reports in the specified AdSense account.
list(accountId: string): Adsense.Schema.SavedReports;
// List all saved reports in the specified AdSense account.
list(accountId: string, optionalArgs: object): Adsense.Schema.SavedReports;
}
}
interface AdclientsCollection {
// Get Auto ad code for a given ad client.
getAdCode(accountId: string, adClientId: string): Adsense.Schema.AdCode;
// List all ad clients in the specified account.
list(accountId: string): Adsense.Schema.AdClients;
// List all ad clients in the specified account.
list(accountId: string, optionalArgs: object): Adsense.Schema.AdClients;
}
interface AdunitsCollection {
Customchannels?: Adsense.Collection.Accounts.Adunits.CustomchannelsCollection | undefined;
// Gets the specified ad unit in the specified ad client for the specified account.
get(accountId: string, adClientId: string, adUnitId: string): Adsense.Schema.AdUnit;
// Get ad code for the specified ad unit.
getAdCode(accountId: string, adClientId: string, adUnitId: string): Adsense.Schema.AdCode;
// List all ad units in the specified ad client for the specified account.
list(accountId: string, adClientId: string): Adsense.Schema.AdUnits;
// List all ad units in the specified ad client for the specified account.
list(accountId: string, adClientId: string, optionalArgs: object): Adsense.Schema.AdUnits;
}
interface AlertsCollection {
// List the alerts for the specified AdSense account.
list(accountId: string): Adsense.Schema.Alerts;
// List the alerts for the specified AdSense account.
list(accountId: string, optionalArgs: object): Adsense.Schema.Alerts;
// Dismiss (delete) the specified alert from the specified publisher AdSense account.
remove(accountId: string, alertId: string): void;
}
interface CustomchannelsCollection {
Adunits?: Adsense.Collection.Accounts.Customchannels.AdunitsCollection | undefined;
// Get the specified custom channel from the specified ad client for the specified account.
get(accountId: string, adClientId: string, customChannelId: string): Adsense.Schema.CustomChannel;
// List all custom channels in the specified ad client for the specified account.
list(accountId: string, adClientId: string): Adsense.Schema.CustomChannels;
// List all custom channels in the specified ad client for the specified account.
list(accountId: string, adClientId: string, optionalArgs: object): Adsense.Schema.CustomChannels;
}
interface PaymentsCollection {
// List the payments for the specified AdSense account.
list(accountId: string): Adsense.Schema.Payments;
}
interface ReportsCollection {
Saved?: Adsense.Collection.Accounts.Reports.SavedCollection | undefined;
// Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify "alt=csv" as a query parameter.
generate(
accountId: string,
startDate: string,
endDate: string,
): Adsense.Schema.AdsenseReportsGenerateResponse;
// Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify "alt=csv" as a query parameter.
generate(
accountId: string,
startDate: string,
endDate: string,
optionalArgs: object,
): Adsense.Schema.AdsenseReportsGenerateResponse;
}
interface SavedadstylesCollection {
// List a specific saved ad style for the specified account.
get(accountId: string, savedAdStyleId: string): Adsense.Schema.SavedAdStyle;
// List all saved ad styles in the specified account.
list(accountId: string): Adsense.Schema.SavedAdStyles;
// List all saved ad styles in the specified account.
list(accountId: string, optionalArgs: object): Adsense.Schema.SavedAdStyles;
}
interface UrlchannelsCollection {
// List all URL channels in the specified ad client for the specified account.
list(accountId: string, adClientId: string): Adsense.Schema.UrlChannels;
// List all URL channels in the specified ad client for the specified account.
list(accountId: string, adClientId: string, optionalArgs: object): Adsense.Schema.UrlChannels;
}
}
namespace Adunits {
interface CustomchannelsCollection {
// List all custom channels which the specified ad unit belongs to.
list(adClientId: string, adUnitId: string): Adsense.Schema.CustomChannels;
// List all custom channels which the specified ad unit belongs to.
list(adClientId: string, adUnitId: string, optionalArgs: object): Adsense.Schema.CustomChannels;
}
}
namespace Customchannels {
interface AdunitsCollection {
// List all ad units in the specified custom channel.
list(adClientId: string, customChannelId: string): Adsense.Schema.AdUnits;
// List all ad units in the specified custom channel.
list(adClientId: string, customChannelId: string, optionalArgs: object): Adsense.Schema.AdUnits;
}
}
namespace Metadata {
interface DimensionsCollection {
// List the metadata for the dimensions available to this AdSense account.
list(): Adsense.Schema.Metadata;
}
interface MetricsCollection {
// List the metadata for the metrics available to this AdSense account.
list(): Adsense.Schema.Metadata;
}
}
namespace Reports {
interface SavedCollection {
// Generate an AdSense report based on the saved report ID sent in the query parameters.
generate(savedReportId: string): Adsense.Schema.AdsenseReportsGenerateResponse;
// Generate an AdSense report based on the saved report ID sent in the query parameters.
generate(
savedReportId: string,
optionalArgs: object,
): Adsense.Schema.AdsenseReportsGenerateResponse;
// List all saved reports in this AdSense account.
list(): Adsense.Schema.SavedReports;
// List all saved reports in this AdSense account.
list(optionalArgs: object): Adsense.Schema.SavedReports;
}
}
interface AccountsCollection {
Adclients?: Adsense.Collection.Accounts.AdclientsCollection | undefined;
Adunits?: Adsense.Collection.Accounts.AdunitsCollection | undefined;
Alerts?: Adsense.Collection.Accounts.AlertsCollection | undefined;
Customchannels?: Adsense.Collection.Accounts.CustomchannelsCollection | undefined;
Payments?: Adsense.Collection.Accounts.PaymentsCollection | undefined;
Reports?: Adsense.Collection.Accounts.ReportsCollection | undefined;
Savedadstyles?: Adsense.Collection.Accounts.SavedadstylesCollection | undefined;
Urlchannels?: Adsense.Collection.Accounts.UrlchannelsCollection | undefined;
// Get information about the selected AdSense account.
get(accountId: string): Adsense.Schema.Account;
// Get information about the selected AdSense account.
get(accountId: string, optionalArgs: object): Adsense.Schema.Account;
// List all accounts available to this AdSense account.
list(): Adsense.Schema.Accounts;
// List all accounts available to this AdSense account.
list(optionalArgs: object): Adsense.Schema.Accounts;
}
interface AdclientsCollection {
// List all ad clients in this AdSense account.
list(): Adsense.Schema.AdClients;
// List all ad clients in this AdSense account.
list(optionalArgs: object): Adsense.Schema.AdClients;
}
interface AdunitsCollection {
Customchannels?: Adsense.Collection.Adunits.CustomchannelsCollection | undefined;
// Gets the specified ad unit in the specified ad client.
get(adClientId: string, adUnitId: string): Adsense.Schema.AdUnit;
// Get ad code for the specified ad unit.
getAdCode(adClientId: string, adUnitId: string): Adsense.Schema.AdCode;
// List all ad units in the specified ad client for this AdSense account.
list(adClientId: string): Adsense.Schema.AdUnits;
// List all ad units in the specified ad client for this AdSense account.
list(adClientId: string, optionalArgs: object): Adsense.Schema.AdUnits;
}
interface AlertsCollection {
// List the alerts for this AdSense account.
list(): Adsense.Schema.Alerts;
// List the alerts for this AdSense account.
list(optionalArgs: object): Adsense.Schema.Alerts;
// Dismiss (delete) the specified alert from the publisher's AdSense account.
remove(alertId: string): void;
}
interface CustomchannelsCollection {
Adunits?: Adsense.Collection.Customchannels.AdunitsCollection | undefined;
// Get the specified custom channel from the specified ad client.
get(adClientId: string, customChannelId: string): Adsense.Schema.CustomChannel;
// List all custom channels in the specified ad client for this AdSense account.
list(adClientId: string): Adsense.Schema.CustomChannels;
// List all custom channels in the specified ad client for this AdSense account.
list(adClientId: string, optionalArgs: object): Adsense.Schema.CustomChannels;
}
interface MetadataCollection {
Dimensions?: Adsense.Collection.Metadata.DimensionsCollection | undefined;
Metrics?: Adsense.Collection.Metadata.MetricsCollection | undefined;
}
interface PaymentsCollection {
// List the payments for this AdSense account.
list(): Adsense.Schema.Payments;
}
interface ReportsCollection {
Saved?: Adsense.Collection.Reports.SavedCollection | undefined;
// Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify "alt=csv" as a query parameter.
generate(startDate: string, endDate: string): Adsense.Schema.AdsenseReportsGenerateResponse;
// Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify "alt=csv" as a query parameter.
generate(
startDate: string,
endDate: string,
optionalArgs: object,
): Adsense.Schema.AdsenseReportsGenerateResponse;
}
interface SavedadstylesCollection {
// Get a specific saved ad style from the user's account.
get(savedAdStyleId: string): Adsense.Schema.SavedAdStyle;
// List all saved ad styles in the user's account.
list(): Adsense.Schema.SavedAdStyles;
// List all saved ad styles in the user's account.
list(optionalArgs: object): Adsense.Schema.SavedAdStyles;
}
interface UrlchannelsCollection {
// List all URL channels in the specified ad client for this AdSense account.
list(adClientId: string): Adsense.Schema.UrlChannels;
// List all URL channels in the specified ad client for this AdSense account.
list(adClientId: string, optionalArgs: object): Adsense.Schema.UrlChannels;
}
}
namespace Schema {
interface Account {
creation_time?: string | undefined;
id?: string | undefined;
kind?: string | undefined;
name?: string | undefined;
premium?: boolean | undefined;
subAccounts?: Adsense.Schema.Account[] | undefined;
timezone?: string | undefined;
}
interface Accounts {
etag?: string | undefined;
items?: Adsense.Schema.Account[] | undefined;
kind?: string | undefined;
nextPageToken?: string | undefined;
}
interface AdClient {
arcOptIn?: boolean | undefined;
id?: string | undefined;
kind?: string | undefined;
productCode?: string | undefined;
supportsReporting?: boolean | undefined;
}
interface AdClients {
etag?: string | undefined;
items?: Adsense.Schema.AdClient[] | undefined;
kind?: string | undefined;
nextPageToken?: string | undefined;
}
interface AdCode {
adCode?: string | undefined;
ampBody?: string | undefined;
ampHead?: string | undefined;
kind?: string | undefined;
}
interface AdStyle {
colors?: Adsense.Schema.AdStyleColors | undefined;
corners?: string | undefined;
font?: Adsense.Schema.AdStyleFont | undefined;
kind?: string | undefined;
}
interface AdStyleColors {
background?: string | undefined;
border?: string | undefined;
text?: string | undefined;
title?: string | undefined;
url?: string | undefined;
}
interface AdStyleFont {
family?: string | undefined;
size?: string | undefined;
}
interface AdUnit {
code?: string | undefined;
contentAdsSettings?: Adsense.Schema.AdUnitContentAdsSettings | undefined;
customStyle?: Adsense.Schema.AdStyle | undefined;
feedAdsSettings?: Adsense.Schema.AdUnitFeedAdsSettings | undefined;
id?: string | undefined;
kind?: string | undefined;
mobileContentAdsSettings?: Adsense.Schema.AdUnitMobileContentAdsSettings | undefined;
name?: string | undefined;
savedStyleId?: string | undefined;
status?: string | undefined;
}
interface AdUnitContentAdsSettings {
backupOption?: Adsense.Schema.AdUnitContentAdsSettingsBackupOption | undefined;
size?: string | undefined;
type?: string | undefined;
}
interface AdUnitContentAdsSettingsBackupOption {
color?: string | undefined;
type?: string | undefined;
url?: string | undefined;
}
interface AdUnitFeedAdsSettings {
adPosition?: string | undefined;
frequency?: number | undefined;
minimumWordCount?: number | undefined;
type?: string | undefined;
}
interface AdUnitMobileContentAdsSettings {
markupLanguage?: string | undefined;
scriptingLanguage?: string | undefined;
size?: string | undefined;
type?: string | undefined;
}
interface AdUnits {
etag?: string | undefined;
items?: Adsense.Schema.AdUnit[] | undefined;
kind?: string | undefined;
nextPageToken?: string | undefined;
}
interface AdsenseReportsGenerateResponse {
averages?: string[] | undefined;
endDate?: string | undefined;
headers?: Adsense.Schema.AdsenseReportsGenerateResponseHeaders[] | undefined;
kind?: string | undefined;
rows?: string[][] | undefined;
startDate?: string | undefined;
totalMatchedRows?: string | undefined;
totals?: string[] | undefined;
warnings?: string[] | undefined;
}
interface AdsenseReportsGenerateResponseHeaders {
currency?: string | undefined;
name?: string | undefined;
type?: string | undefined;
}
interface Alert {
id?: string | undefined;
isDismissible?: boolean | undefined;
kind?: string | undefined;
message?: string | undefined;
severity?: string | undefined;
type?: string | undefined;
}
interface Alerts {
items?: Adsense.Schema.Alert[] | undefined;
kind?: string | undefined;
}
interface CustomChannel {
code?: string | undefined;
id?: string | undefined;
kind?: string | undefined;
name?: string | undefined;
targetingInfo?: Adsense.Schema.CustomChannelTargetingInfo | undefined;
}
interface CustomChannelTargetingInfo {
adsAppearOn?: string | undefined;
description?: string | undefined;
location?: string | undefined;
siteLanguage?: string | undefined;
}
interface CustomChannels {
etag?: string | undefined;
items?: Adsense.Schema.CustomChannel[] | undefined;
kind?: string | undefined;
nextPageToken?: string | undefined;
}
interface Metadata {
items?: Adsense.Schema.ReportingMetadataEntry[] | undefined;
kind?: string | undefined;
}
interface Payment {
id?: string | undefined;
kind?: string | undefined;
paymentAmount?: string | undefined;
paymentAmountCurrencyCode?: string | undefined;
paymentDate?: string | undefined;
}
interface Payments {
items?: Adsense.Schema.Payment[] | undefined;
kind?: string | undefined;
}
interface ReportingMetadataEntry {
compatibleDimensions?: string[] | undefined;
compatibleMetrics?: string[] | undefined;
id?: string | undefined;
kind?: string | undefined;
requiredDimensions?: string[] | undefined;
requiredMetrics?: string[] | undefined;
supportedProducts?: string[] | undefined;
}
interface SavedAdStyle {
adStyle?: Adsense.Schema.AdStyle | undefined;
id?: string | undefined;
kind?: string | undefined;
name?: string | undefined;
}
interface SavedAdStyles {
etag?: string | undefined;
items?: Adsense.Schema.SavedAdStyle[] | undefined;
kind?: string | undefined;
nextPageToken?: string | undefined;
}
interface SavedReport {
id?: string | undefined;
kind?: string | undefined;
name?: string | undefined;
}
interface SavedReports {
etag?: string | undefined;
items?: Adsense.Schema.SavedReport[] | undefined;
kind?: string | undefined;
nextPageToken?: string | undefined;
}
interface UrlChannel {
id?: string | undefined;
kind?: string | undefined;
urlPattern?: string | undefined;
}
interface UrlChannels {
etag?: string | undefined;
items?: Adsense.Schema.UrlChannel[] | undefined;
kind?: string | undefined;
nextPageToken?: string | undefined;
}
}
}
interface Adsense {
Accounts?: Adsense.Collection.AccountsCollection | undefined;
Adclients?: Adsense.Collection.AdclientsCollection | undefined;
Adunits?: Adsense.Collection.AdunitsCollection | undefined;
Alerts?: Adsense.Collection.AlertsCollection | undefined;
Customchannels?: Adsense.Collection.CustomchannelsCollection | undefined;
Metadata?: Adsense.Collection.MetadataCollection | undefined;
Payments?: Adsense.Collection.PaymentsCollection | undefined;
Reports?: Adsense.Collection.ReportsCollection | undefined;
Savedadstyles?: Adsense.Collection.SavedadstylesCollection | undefined;
Urlchannels?: Adsense.Collection.UrlchannelsCollection | undefined;
}
}
declare var Adsense: GoogleAppsScript.Adsense;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,357 @@
declare namespace GoogleAppsScript {
namespace AnalyticsReporting {
namespace Collection {
interface ReportsCollection {
// Returns the Analytics data.
batchGet(resource: Schema.GetReportsRequest): AnalyticsReporting.Schema.GetReportsResponse;
}
interface UserActivityCollection {
// Returns User Activity data.
search(
resource: Schema.SearchUserActivityRequest,
): AnalyticsReporting.Schema.SearchUserActivityResponse;
}
}
namespace Schema {
interface Activity {
activityTime?: string | undefined;
activityType?: string | undefined;
appview?: AnalyticsReporting.Schema.ScreenviewData | undefined;
campaign?: string | undefined;
channelGrouping?: string | undefined;
customDimension?: AnalyticsReporting.Schema.CustomDimension[] | undefined;
ecommerce?: AnalyticsReporting.Schema.EcommerceData | undefined;
event?: AnalyticsReporting.Schema.EventData | undefined;
goals?: AnalyticsReporting.Schema.GoalSetData | undefined;
hostname?: string | undefined;
keyword?: string | undefined;
landingPagePath?: string | undefined;
medium?: string | undefined;
pageview?: AnalyticsReporting.Schema.PageviewData | undefined;
source?: string | undefined;
}
interface Cohort {
dateRange?: AnalyticsReporting.Schema.DateRange | undefined;
name?: string | undefined;
type?: string | undefined;
}
interface CohortGroup {
cohorts?: AnalyticsReporting.Schema.Cohort[] | undefined;
lifetimeValue?: boolean | undefined;
}
interface ColumnHeader {
dimensions?: string[] | undefined;
metricHeader?: AnalyticsReporting.Schema.MetricHeader | undefined;
}
interface CustomDimension {
index?: number | undefined;
value?: string | undefined;
}
interface DateRange {
endDate?: string | undefined;
startDate?: string | undefined;
}
interface DateRangeValues {
pivotValueRegions?: AnalyticsReporting.Schema.PivotValueRegion[] | undefined;
values?: string[] | undefined;
}
interface Dimension {
histogramBuckets?: string[] | undefined;
name?: string | undefined;
}
interface DimensionFilter {
caseSensitive?: boolean | undefined;
dimensionName?: string | undefined;
expressions?: string[] | undefined;
not?: boolean | undefined;
operator?: string | undefined;
}
interface DimensionFilterClause {
filters?: AnalyticsReporting.Schema.DimensionFilter[] | undefined;
operator?: string | undefined;
}
interface DynamicSegment {
name?: string | undefined;
sessionSegment?: AnalyticsReporting.Schema.SegmentDefinition | undefined;
userSegment?: AnalyticsReporting.Schema.SegmentDefinition | undefined;
}
interface EcommerceData {
actionType?: string | undefined;
ecommerceType?: string | undefined;
products?: AnalyticsReporting.Schema.ProductData[] | undefined;
transaction?: AnalyticsReporting.Schema.TransactionData | undefined;
}
interface EventData {
eventAction?: string | undefined;
eventCategory?: string | undefined;
eventCount?: string | undefined;
eventLabel?: string | undefined;
eventValue?: string | undefined;
}
interface GetReportsRequest {
reportRequests?: AnalyticsReporting.Schema.ReportRequest[] | undefined;
useResourceQuotas?: boolean | undefined;
}
interface GetReportsResponse {
queryCost?: number | undefined;
reports?: AnalyticsReporting.Schema.Report[] | undefined;
resourceQuotasRemaining?: AnalyticsReporting.Schema.ResourceQuotasRemaining | undefined;
}
interface GoalData {
goalCompletionLocation?: string | undefined;
goalCompletions?: string | undefined;
goalIndex?: number | undefined;
goalName?: string | undefined;
goalPreviousStep1?: string | undefined;
goalPreviousStep2?: string | undefined;
goalPreviousStep3?: string | undefined;
goalValue?: number | undefined;
}
interface GoalSetData {
goals?: AnalyticsReporting.Schema.GoalData[] | undefined;
}
interface Metric {
alias?: string | undefined;
expression?: string | undefined;
formattingType?: string | undefined;
}
interface MetricFilter {
comparisonValue?: string | undefined;
metricName?: string | undefined;
not?: boolean | undefined;
operator?: string | undefined;
}
interface MetricFilterClause {
filters?: AnalyticsReporting.Schema.MetricFilter[] | undefined;
operator?: string | undefined;
}
interface MetricHeader {
metricHeaderEntries?: AnalyticsReporting.Schema.MetricHeaderEntry[] | undefined;
pivotHeaders?: AnalyticsReporting.Schema.PivotHeader[] | undefined;
}
interface MetricHeaderEntry {
name?: string | undefined;
type?: string | undefined;
}
interface OrFiltersForSegment {
segmentFilterClauses?: AnalyticsReporting.Schema.SegmentFilterClause[] | undefined;
}
interface OrderBy {
fieldName?: string | undefined;
orderType?: string | undefined;
sortOrder?: string | undefined;
}
interface PageviewData {
pagePath?: string | undefined;
pageTitle?: string | undefined;
}
interface Pivot {
dimensionFilterClauses?: AnalyticsReporting.Schema.DimensionFilterClause[] | undefined;
dimensions?: AnalyticsReporting.Schema.Dimension[] | undefined;
maxGroupCount?: number | undefined;
metrics?: AnalyticsReporting.Schema.Metric[] | undefined;
startGroup?: number | undefined;
}
interface PivotHeader {
pivotHeaderEntries?: AnalyticsReporting.Schema.PivotHeaderEntry[] | undefined;
totalPivotGroupsCount?: number | undefined;
}
interface PivotHeaderEntry {
dimensionNames?: string[] | undefined;
dimensionValues?: string[] | undefined;
metric?: AnalyticsReporting.Schema.MetricHeaderEntry | undefined;
}
interface PivotValueRegion {
values?: string[] | undefined;
}
interface ProductData {
itemRevenue?: number | undefined;
productName?: string | undefined;
productQuantity?: string | undefined;
productSku?: string | undefined;
}
interface Report {
columnHeader?: AnalyticsReporting.Schema.ColumnHeader | undefined;
data?: AnalyticsReporting.Schema.ReportData | undefined;
nextPageToken?: string | undefined;
}
interface ReportData {
dataLastRefreshed?: string | undefined;
isDataGolden?: boolean | undefined;
maximums?: AnalyticsReporting.Schema.DateRangeValues[] | undefined;
minimums?: AnalyticsReporting.Schema.DateRangeValues[] | undefined;
rowCount?: number | undefined;
rows?: AnalyticsReporting.Schema.ReportRow[] | undefined;
samplesReadCounts?: string[] | undefined;
samplingSpaceSizes?: string[] | undefined;
totals?: AnalyticsReporting.Schema.DateRangeValues[] | undefined;
}
interface ReportRequest {
cohortGroup?: AnalyticsReporting.Schema.CohortGroup | undefined;
dateRanges?: AnalyticsReporting.Schema.DateRange[] | undefined;
dimensionFilterClauses?: AnalyticsReporting.Schema.DimensionFilterClause[] | undefined;
dimensions?: AnalyticsReporting.Schema.Dimension[] | undefined;
filtersExpression?: string | undefined;
hideTotals?: boolean | undefined;
hideValueRanges?: boolean | undefined;
includeEmptyRows?: boolean | undefined;
metricFilterClauses?: AnalyticsReporting.Schema.MetricFilterClause[] | undefined;
metrics?: AnalyticsReporting.Schema.Metric[] | undefined;
orderBys?: AnalyticsReporting.Schema.OrderBy[] | undefined;
pageSize?: number | undefined;
pageToken?: string | undefined;
pivots?: AnalyticsReporting.Schema.Pivot[] | undefined;
samplingLevel?: string | undefined;
segments?: AnalyticsReporting.Schema.Segment[] | undefined;
viewId?: string | undefined;
}
interface ReportRow {
dimensions?: string[] | undefined;
metrics?: AnalyticsReporting.Schema.DateRangeValues[] | undefined;
}
interface ResourceQuotasRemaining {
dailyQuotaTokensRemaining?: number | undefined;
hourlyQuotaTokensRemaining?: number | undefined;
}
interface ScreenviewData {
appName?: string | undefined;
mobileDeviceBranding?: string | undefined;
mobileDeviceModel?: string | undefined;
screenName?: string | undefined;
}
interface SearchUserActivityRequest {
activityTypes?: string[] | undefined;
dateRange?: AnalyticsReporting.Schema.DateRange | undefined;
pageSize?: number | undefined;
pageToken?: string | undefined;
user?: AnalyticsReporting.Schema.User | undefined;
viewId?: string | undefined;
}
interface SearchUserActivityResponse {
nextPageToken?: string | undefined;
sampleRate?: number | undefined;
sessions?: AnalyticsReporting.Schema.UserActivitySession[] | undefined;
totalRows?: number | undefined;
}
interface Segment {
dynamicSegment?: AnalyticsReporting.Schema.DynamicSegment | undefined;
segmentId?: string | undefined;
}
interface SegmentDefinition {
segmentFilters?: AnalyticsReporting.Schema.SegmentFilter[] | undefined;
}
interface SegmentDimensionFilter {
caseSensitive?: boolean | undefined;
dimensionName?: string | undefined;
expressions?: string[] | undefined;
maxComparisonValue?: string | undefined;
minComparisonValue?: string | undefined;
operator?: string | undefined;
}
interface SegmentFilter {
not?: boolean | undefined;
sequenceSegment?: AnalyticsReporting.Schema.SequenceSegment | undefined;
simpleSegment?: AnalyticsReporting.Schema.SimpleSegment | undefined;
}
interface SegmentFilterClause {
dimensionFilter?: AnalyticsReporting.Schema.SegmentDimensionFilter | undefined;
metricFilter?: AnalyticsReporting.Schema.SegmentMetricFilter | undefined;
not?: boolean | undefined;
}
interface SegmentMetricFilter {
comparisonValue?: string | undefined;
maxComparisonValue?: string | undefined;
metricName?: string | undefined;
operator?: string | undefined;
scope?: string | undefined;
}
interface SegmentSequenceStep {
matchType?: string | undefined;
orFiltersForSegment?: AnalyticsReporting.Schema.OrFiltersForSegment[] | undefined;
}
interface SequenceSegment {
firstStepShouldMatchFirstHit?: boolean | undefined;
segmentSequenceSteps?: AnalyticsReporting.Schema.SegmentSequenceStep[] | undefined;
}
interface SimpleSegment {
orFiltersForSegment?: AnalyticsReporting.Schema.OrFiltersForSegment[] | undefined;
}
interface TransactionData {
transactionId?: string | undefined;
transactionRevenue?: number | undefined;
transactionShipping?: number | undefined;
transactionTax?: number | undefined;
}
interface User {
type?: string | undefined;
userId?: string | undefined;
}
interface UserActivitySession {
activities?: AnalyticsReporting.Schema.Activity[] | undefined;
dataSource?: string | undefined;
deviceCategory?: string | undefined;
platform?: string | undefined;
sessionDate?: string | undefined;
sessionId?: string | undefined;
}
}
}
interface AnalyticsReporting {
Reports?: AnalyticsReporting.Collection.ReportsCollection | undefined;
UserActivity?: AnalyticsReporting.Collection.UserActivityCollection | undefined;
// Create a new instance of Cohort
newCohort(): AnalyticsReporting.Schema.Cohort;
// Create a new instance of CohortGroup
newCohortGroup(): AnalyticsReporting.Schema.CohortGroup;
// Create a new instance of DateRange
newDateRange(): AnalyticsReporting.Schema.DateRange;
// Create a new instance of Dimension
newDimension(): AnalyticsReporting.Schema.Dimension;
// Create a new instance of DimensionFilter
newDimensionFilter(): AnalyticsReporting.Schema.DimensionFilter;
// Create a new instance of DimensionFilterClause
newDimensionFilterClause(): AnalyticsReporting.Schema.DimensionFilterClause;
// Create a new instance of DynamicSegment
newDynamicSegment(): AnalyticsReporting.Schema.DynamicSegment;
// Create a new instance of GetReportsRequest
newGetReportsRequest(): AnalyticsReporting.Schema.GetReportsRequest;
// Create a new instance of Metric
newMetric(): AnalyticsReporting.Schema.Metric;
// Create a new instance of MetricFilter
newMetricFilter(): AnalyticsReporting.Schema.MetricFilter;
// Create a new instance of MetricFilterClause
newMetricFilterClause(): AnalyticsReporting.Schema.MetricFilterClause;
// Create a new instance of OrFiltersForSegment
newOrFiltersForSegment(): AnalyticsReporting.Schema.OrFiltersForSegment;
// Create a new instance of OrderBy
newOrderBy(): AnalyticsReporting.Schema.OrderBy;
// Create a new instance of Pivot
newPivot(): AnalyticsReporting.Schema.Pivot;
// Create a new instance of ReportRequest
newReportRequest(): AnalyticsReporting.Schema.ReportRequest;
// Create a new instance of SearchUserActivityRequest
newSearchUserActivityRequest(): AnalyticsReporting.Schema.SearchUserActivityRequest;
// Create a new instance of Segment
newSegment(): AnalyticsReporting.Schema.Segment;
// Create a new instance of SegmentDefinition
newSegmentDefinition(): AnalyticsReporting.Schema.SegmentDefinition;
// Create a new instance of SegmentDimensionFilter
newSegmentDimensionFilter(): AnalyticsReporting.Schema.SegmentDimensionFilter;
// Create a new instance of SegmentFilter
newSegmentFilter(): AnalyticsReporting.Schema.SegmentFilter;
// Create a new instance of SegmentFilterClause
newSegmentFilterClause(): AnalyticsReporting.Schema.SegmentFilterClause;
// Create a new instance of SegmentMetricFilter
newSegmentMetricFilter(): AnalyticsReporting.Schema.SegmentMetricFilter;
// Create a new instance of SegmentSequenceStep
newSegmentSequenceStep(): AnalyticsReporting.Schema.SegmentSequenceStep;
// Create a new instance of SequenceSegment
newSequenceSegment(): AnalyticsReporting.Schema.SequenceSegment;
// Create a new instance of SimpleSegment
newSimpleSegment(): AnalyticsReporting.Schema.SimpleSegment;
// Create a new instance of User
newUser(): AnalyticsReporting.Schema.User;
}
}
declare var AnalyticsReporting: GoogleAppsScript.AnalyticsReporting;

View File

@ -0,0 +1,78 @@
declare namespace GoogleAppsScript {
namespace Appsactivity {
namespace Collection {
interface ActivitiesCollection {
// Returns a list of activities visible to the current logged in user. Visible activities are determined by the visiblity settings of the object that was acted on, e.g. Drive files a user can see. An activity is a record of past events. Multiple events may be merged if they are similar. A request is scoped to activities from a given Google service using the source parameter.
list(): Appsactivity.Schema.ListActivitiesResponse;
// Returns a list of activities visible to the current logged in user. Visible activities are determined by the visiblity settings of the object that was acted on, e.g. Drive files a user can see. An activity is a record of past events. Multiple events may be merged if they are similar. A request is scoped to activities from a given Google service using the source parameter.
list(optionalArgs: object): Appsactivity.Schema.ListActivitiesResponse;
}
}
namespace Schema {
interface Activity {
combinedEvent?: Appsactivity.Schema.Event | undefined;
singleEvents?: Appsactivity.Schema.Event[] | undefined;
}
interface Event {
additionalEventTypes?: string[] | undefined;
eventTimeMillis?: string | undefined;
fromUserDeletion?: boolean | undefined;
move?: Appsactivity.Schema.Move | undefined;
permissionChanges?: Appsactivity.Schema.PermissionChange[] | undefined;
primaryEventType?: string | undefined;
rename?: Appsactivity.Schema.Rename | undefined;
target?: Appsactivity.Schema.Target | undefined;
user?: Appsactivity.Schema.User | undefined;
}
interface ListActivitiesResponse {
activities?: Appsactivity.Schema.Activity[] | undefined;
nextPageToken?: string | undefined;
}
interface Move {
addedParents?: Appsactivity.Schema.Parent[] | undefined;
removedParents?: Appsactivity.Schema.Parent[] | undefined;
}
interface Parent {
id?: string | undefined;
isRoot?: boolean | undefined;
title?: string | undefined;
}
interface Permission {
name?: string | undefined;
permissionId?: string | undefined;
role?: string | undefined;
type?: string | undefined;
user?: Appsactivity.Schema.User | undefined;
withLink?: boolean | undefined;
}
interface PermissionChange {
addedPermissions?: Appsactivity.Schema.Permission[] | undefined;
removedPermissions?: Appsactivity.Schema.Permission[] | undefined;
}
interface Photo {
url?: string | undefined;
}
interface Rename {
newTitle?: string | undefined;
oldTitle?: string | undefined;
}
interface Target {
id?: string | undefined;
mimeType?: string | undefined;
name?: string | undefined;
}
interface User {
isDeleted?: boolean | undefined;
isMe?: boolean | undefined;
name?: string | undefined;
permissionId?: string | undefined;
photo?: Appsactivity.Schema.Photo | undefined;
}
}
}
interface Appsactivity {
Activities?: Appsactivity.Collection.ActivitiesCollection | undefined;
}
}
declare var Appsactivity: GoogleAppsScript.Appsactivity;

View File

@ -0,0 +1,821 @@
declare namespace GoogleAppsScript {
namespace BigQuery {
namespace Collection {
interface DatasetsCollection {
// Returns the dataset specified by datasetID.
get(projectId: string, datasetId: string): BigQuery.Schema.Dataset;
// Creates a new empty dataset.
insert(resource: BigQuery.Schema.Dataset, projectId: string): BigQuery.Schema.Dataset;
// Lists all datasets in the specified project to which you have been granted the READER dataset role.
list(projectId: string): BigQuery.Schema.DatasetList;
// Lists all datasets in the specified project to which you have been granted the READER dataset role.
list(projectId: string, optionalArgs: object): BigQuery.Schema.DatasetList;
// Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that are provided in the submitted dataset resource. This method supports patch semantics.
patch(resource: BigQuery.Schema.Dataset, projectId: string, datasetId: string): BigQuery.Schema.Dataset;
// Deletes the dataset specified by the datasetId value. Before you can delete a dataset, you must delete all its tables, either manually or by specifying deleteContents. Immediately after deletion, you can create another dataset with the same name.
remove(projectId: string, datasetId: string): void;
// Deletes the dataset specified by the datasetId value. Before you can delete a dataset, you must delete all its tables, either manually or by specifying deleteContents. Immediately after deletion, you can create another dataset with the same name.
remove(projectId: string, datasetId: string, optionalArgs: object): void;
// Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that are provided in the submitted dataset resource.
update(
resource: BigQuery.Schema.Dataset,
projectId: string,
datasetId: string,
): BigQuery.Schema.Dataset;
}
interface JobsCollection {
// Requests that a job be cancelled. This call will return immediately, and the client will need to poll for the job status to see if the cancel completed successfully. Cancelled jobs may still incur costs.
cancel(projectId: string, jobId: string): BigQuery.Schema.JobCancelResponse;
// Requests that a job be cancelled. This call will return immediately, and the client will need to poll for the job status to see if the cancel completed successfully. Cancelled jobs may still incur costs.
cancel(projectId: string, jobId: string, optionalArgs: object): BigQuery.Schema.JobCancelResponse;
// Returns information about a specific job. Job information is available for a six month period after creation. Requires that you're the person who ran the job, or have the Is Owner project role.
get(projectId: string, jobId: string): BigQuery.Schema.Job;
// Returns information about a specific job. Job information is available for a six month period after creation. Requires that you're the person who ran the job, or have the Is Owner project role.
get(projectId: string, jobId: string, optionalArgs: object): BigQuery.Schema.Job;
// Retrieves the results of a query job.
getQueryResults(projectId: string, jobId: string): BigQuery.Schema.GetQueryResultsResponse;
// Retrieves the results of a query job.
getQueryResults(
projectId: string,
jobId: string,
optionalArgs: object,
): BigQuery.Schema.GetQueryResultsResponse;
// Starts a new asynchronous job. Requires the Can View project role.
insert(resource: BigQuery.Schema.Job, projectId: string): BigQuery.Schema.Job;
// Starts a new asynchronous job. Requires the Can View project role.
insert(resource: BigQuery.Schema.Job, projectId: string, mediaData: any): BigQuery.Schema.Job;
// Lists all jobs that you started in the specified project. Job information is available for a six month period after creation. The job list is sorted in reverse chronological order, by job creation time. Requires the Can View project role, or the Is Owner project role if you set the allUsers property.
list(projectId: string): BigQuery.Schema.JobList;
// Lists all jobs that you started in the specified project. Job information is available for a six month period after creation. The job list is sorted in reverse chronological order, by job creation time. Requires the Can View project role, or the Is Owner project role if you set the allUsers property.
list(projectId: string, optionalArgs: object): BigQuery.Schema.JobList;
// Runs a BigQuery SQL query synchronously and returns query results if the query completes within a specified timeout.
query(resource: BigQuery.Schema.QueryRequest, projectId: string): BigQuery.Schema.QueryResponse;
}
interface ProjectsCollection {
// Returns the email address of the service account for your project used for interactions with Google Cloud KMS.
getServiceAccount(projectId: string): BigQuery.Schema.GetServiceAccountResponse;
// Lists all projects to which you have been granted any project role.
list(): BigQuery.Schema.ProjectList;
// Lists all projects to which you have been granted any project role.
list(optionalArgs: object): BigQuery.Schema.ProjectList;
}
interface TabledataCollection {
// Streams data into BigQuery one record at a time without needing to run a load job. Requires the WRITER dataset role.
insertAll(
resource: BigQuery.Schema.TableDataInsertAllRequest,
projectId: string,
datasetId: string,
tableId: string,
): BigQuery.Schema.TableDataInsertAllResponse;
// Retrieves table data from a specified set of rows. Requires the READER dataset role.
list(projectId: string, datasetId: string, tableId: string): BigQuery.Schema.TableDataList;
// Retrieves table data from a specified set of rows. Requires the READER dataset role.
list(
projectId: string,
datasetId: string,
tableId: string,
optionalArgs: object,
): BigQuery.Schema.TableDataList;
}
interface TablesCollection {
// Gets the specified table resource by table ID. This method does not return the data in the table, it only returns the table resource, which describes the structure of this table.
get(projectId: string, datasetId: string, tableId: string): BigQuery.Schema.Table;
// Gets the specified table resource by table ID. This method does not return the data in the table, it only returns the table resource, which describes the structure of this table.
get(projectId: string, datasetId: string, tableId: string, optionalArgs: object): BigQuery.Schema.Table;
// Creates a new, empty table in the dataset.
insert(resource: BigQuery.Schema.Table, projectId: string, datasetId: string): BigQuery.Schema.Table;
// Lists all tables in the specified dataset. Requires the READER dataset role.
list(projectId: string, datasetId: string): BigQuery.Schema.TableList;
// Lists all tables in the specified dataset. Requires the READER dataset role.
list(projectId: string, datasetId: string, optionalArgs: object): BigQuery.Schema.TableList;
// Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource. This method supports patch semantics.
patch(
resource: BigQuery.Schema.Table,
projectId: string,
datasetId: string,
tableId: string,
): BigQuery.Schema.Table;
// Deletes the table specified by tableId from the dataset. If the table contains data, all the data will be deleted.
remove(projectId: string, datasetId: string, tableId: string): void;
// Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource.
update(
resource: BigQuery.Schema.Table,
projectId: string,
datasetId: string,
tableId: string,
): BigQuery.Schema.Table;
}
}
namespace Schema {
interface BigQueryModelTraining {
currentIteration?: number | undefined;
expectedTotalIterations?: string | undefined;
}
interface BigtableColumn {
encoding?: string | undefined;
fieldName?: string | undefined;
onlyReadLatest?: boolean | undefined;
qualifierEncoded?: string | undefined;
qualifierString?: string | undefined;
type?: string | undefined;
}
interface BigtableColumnFamily {
columns?: BigQuery.Schema.BigtableColumn[] | undefined;
encoding?: string | undefined;
familyId?: string | undefined;
onlyReadLatest?: boolean | undefined;
type?: string | undefined;
}
interface BigtableOptions {
columnFamilies?: BigQuery.Schema.BigtableColumnFamily[] | undefined;
ignoreUnspecifiedColumnFamilies?: boolean | undefined;
readRowkeyAsString?: boolean | undefined;
}
interface BqmlIterationResult {
durationMs?: string | undefined;
evalLoss?: number | undefined;
index?: number | undefined;
learnRate?: number | undefined;
trainingLoss?: number | undefined;
}
interface BqmlTrainingRun {
iterationResults?: BigQuery.Schema.BqmlIterationResult[] | undefined;
startTime?: string | undefined;
state?: string | undefined;
trainingOptions?: BigQuery.Schema.BqmlTrainingRunTrainingOptions | undefined;
}
interface BqmlTrainingRunTrainingOptions {
earlyStop?: boolean | undefined;
l1Reg?: number | undefined;
l2Reg?: number | undefined;
learnRate?: number | undefined;
learnRateStrategy?: string | undefined;
lineSearchInitLearnRate?: number | undefined;
maxIteration?: string | undefined;
minRelProgress?: number | undefined;
warmStart?: boolean | undefined;
}
interface Clustering {
fields?: string[] | undefined;
}
interface CsvOptions {
allowJaggedRows?: boolean | undefined;
allowQuotedNewlines?: boolean | undefined;
encoding?: string | undefined;
fieldDelimiter?: string | undefined;
quote?: string | undefined;
skipLeadingRows?: string | undefined;
}
interface Dataset {
access?: BigQuery.Schema.DatasetAccess[] | undefined;
creationTime?: string | undefined;
datasetReference?: BigQuery.Schema.DatasetReference | undefined;
defaultPartitionExpirationMs?: string | undefined;
defaultTableExpirationMs?: string | undefined;
description?: string | undefined;
etag?: string | undefined;
friendlyName?: string | undefined;
id?: string | undefined;
kind?: string | undefined;
labels?: object | undefined;
lastModifiedTime?: string | undefined;
location?: string | undefined;
selfLink?: string | undefined;
}
interface DatasetAccess {
domain?: string | undefined;
groupByEmail?: string | undefined;
iamMember?: string | undefined;
role?: string | undefined;
specialGroup?: string | undefined;
userByEmail?: string | undefined;
view?: BigQuery.Schema.TableReference | undefined;
}
interface DatasetList {
datasets?: BigQuery.Schema.DatasetListDatasets[] | undefined;
etag?: string | undefined;
kind?: string | undefined;
nextPageToken?: string | undefined;
}
interface DatasetListDatasets {
datasetReference?: BigQuery.Schema.DatasetReference | undefined;
friendlyName?: string | undefined;
id?: string | undefined;
kind?: string | undefined;
labels?: object | undefined;
location?: string | undefined;
}
interface DatasetReference {
datasetId?: string | undefined;
projectId?: string | undefined;
}
interface DestinationTableProperties {
description?: string | undefined;
friendlyName?: string | undefined;
labels?: object | undefined;
}
interface EncryptionConfiguration {
kmsKeyName?: string | undefined;
}
interface ErrorProto {
debugInfo?: string | undefined;
location?: string | undefined;
message?: string | undefined;
reason?: string | undefined;
}
interface ExplainQueryStage {
completedParallelInputs?: string | undefined;
computeMsAvg?: string | undefined;
computeMsMax?: string | undefined;
computeRatioAvg?: number | undefined;
computeRatioMax?: number | undefined;
endMs?: string | undefined;
id?: string | undefined;
inputStages?: string[] | undefined;
name?: string | undefined;
parallelInputs?: string | undefined;
readMsAvg?: string | undefined;
readMsMax?: string | undefined;
readRatioAvg?: number | undefined;
readRatioMax?: number | undefined;
recordsRead?: string | undefined;
recordsWritten?: string | undefined;
shuffleOutputBytes?: string | undefined;
shuffleOutputBytesSpilled?: string | undefined;
startMs?: string | undefined;
status?: string | undefined;
steps?: BigQuery.Schema.ExplainQueryStep[] | undefined;
waitMsAvg?: string | undefined;
waitMsMax?: string | undefined;
waitRatioAvg?: number | undefined;
waitRatioMax?: number | undefined;
writeMsAvg?: string | undefined;
writeMsMax?: string | undefined;
writeRatioAvg?: number | undefined;
writeRatioMax?: number | undefined;
}
interface ExplainQueryStep {
kind?: string | undefined;
substeps?: string[] | undefined;
}
interface ExternalDataConfiguration {
autodetect?: boolean | undefined;
bigtableOptions?: BigQuery.Schema.BigtableOptions | undefined;
compression?: string | undefined;
csvOptions?: BigQuery.Schema.CsvOptions | undefined;
googleSheetsOptions?: BigQuery.Schema.GoogleSheetsOptions | undefined;
hivePartitioningMode?: string | undefined;
ignoreUnknownValues?: boolean | undefined;
maxBadRecords?: number | undefined;
schema?: BigQuery.Schema.TableSchema | undefined;
sourceFormat?: string | undefined;
sourceUris?: string[] | undefined;
}
interface GetQueryResultsResponse {
cacheHit?: boolean | undefined;
errors?: BigQuery.Schema.ErrorProto[] | undefined;
etag?: string | undefined;
jobComplete?: boolean | undefined;
jobReference?: BigQuery.Schema.JobReference | undefined;
kind?: string | undefined;
numDmlAffectedRows?: string | undefined;
pageToken?: string | undefined;
rows?: BigQuery.Schema.TableRow[] | undefined;
schema?: BigQuery.Schema.TableSchema | undefined;
totalBytesProcessed?: string | undefined;
totalRows?: string | undefined;
}
interface GetServiceAccountResponse {
email?: string | undefined;
kind?: string | undefined;
}
interface GoogleSheetsOptions {
range?: string | undefined;
skipLeadingRows?: string | undefined;
}
interface Job {
configuration?: BigQuery.Schema.JobConfiguration | undefined;
etag?: string | undefined;
id?: string | undefined;
jobReference?: BigQuery.Schema.JobReference | undefined;
kind?: string | undefined;
selfLink?: string | undefined;
statistics?: BigQuery.Schema.JobStatistics | undefined;
status?: BigQuery.Schema.JobStatus | undefined;
user_email?: string | undefined;
}
interface JobCancelResponse {
job?: BigQuery.Schema.Job | undefined;
kind?: string | undefined;
}
interface JobConfiguration {
copy?: BigQuery.Schema.JobConfigurationTableCopy | undefined;
dryRun?: boolean | undefined;
extract?: BigQuery.Schema.JobConfigurationExtract | undefined;
jobTimeoutMs?: string | undefined;
jobType?: string | undefined;
labels?: object | undefined;
load?: BigQuery.Schema.JobConfigurationLoad | undefined;
query?: BigQuery.Schema.JobConfigurationQuery | undefined;
}
interface JobConfigurationExtract {
compression?: string | undefined;
destinationFormat?: string | undefined;
destinationUri?: string | undefined;
destinationUris?: string[] | undefined;
fieldDelimiter?: string | undefined;
printHeader?: boolean | undefined;
sourceTable?: BigQuery.Schema.TableReference | undefined;
}
interface JobConfigurationLoad {
allowJaggedRows?: boolean | undefined;
allowQuotedNewlines?: boolean | undefined;
autodetect?: boolean | undefined;
clustering?: BigQuery.Schema.Clustering | undefined;
createDisposition?: string | undefined;
destinationEncryptionConfiguration?: BigQuery.Schema.EncryptionConfiguration | undefined;
destinationTable?: BigQuery.Schema.TableReference | undefined;
destinationTableProperties?: BigQuery.Schema.DestinationTableProperties | undefined;
encoding?: string | undefined;
fieldDelimiter?: string | undefined;
hivePartitioningMode?: string | undefined;
ignoreUnknownValues?: boolean | undefined;
maxBadRecords?: number | undefined;
nullMarker?: string | undefined;
projectionFields?: string[] | undefined;
quote?: string | undefined;
rangePartitioning?: BigQuery.Schema.RangePartitioning | undefined;
schema?: BigQuery.Schema.TableSchema | undefined;
schemaInline?: string | undefined;
schemaInlineFormat?: string | undefined;
schemaUpdateOptions?: string[] | undefined;
skipLeadingRows?: number | undefined;
sourceFormat?: string | undefined;
sourceUris?: string[] | undefined;
timePartitioning?: BigQuery.Schema.TimePartitioning | undefined;
useAvroLogicalTypes?: boolean | undefined;
writeDisposition?: string | undefined;
}
interface JobConfigurationQuery {
allowLargeResults?: boolean | undefined;
clustering?: BigQuery.Schema.Clustering | undefined;
createDisposition?: string | undefined;
defaultDataset?: BigQuery.Schema.DatasetReference | undefined;
destinationEncryptionConfiguration?: BigQuery.Schema.EncryptionConfiguration | undefined;
destinationTable?: BigQuery.Schema.TableReference | undefined;
flattenResults?: boolean | undefined;
maximumBillingTier?: number | undefined;
maximumBytesBilled?: string | undefined;
parameterMode?: string | undefined;
preserveNulls?: boolean | undefined;
priority?: string | undefined;
query?: string | undefined;
queryParameters?: BigQuery.Schema.QueryParameter[] | undefined;
rangePartitioning?: BigQuery.Schema.RangePartitioning | undefined;
schemaUpdateOptions?: string[] | undefined;
tableDefinitions?: object | undefined;
timePartitioning?: BigQuery.Schema.TimePartitioning | undefined;
useLegacySql?: boolean | undefined;
useQueryCache?: boolean | undefined;
userDefinedFunctionResources?: BigQuery.Schema.UserDefinedFunctionResource[] | undefined;
writeDisposition?: string | undefined;
}
interface JobConfigurationTableCopy {
createDisposition?: string | undefined;
destinationEncryptionConfiguration?: BigQuery.Schema.EncryptionConfiguration | undefined;
destinationTable?: BigQuery.Schema.TableReference | undefined;
sourceTable?: BigQuery.Schema.TableReference | undefined;
sourceTables?: BigQuery.Schema.TableReference[] | undefined;
writeDisposition?: string | undefined;
}
interface JobList {
etag?: string | undefined;
jobs?: BigQuery.Schema.JobListJobs[] | undefined;
kind?: string | undefined;
nextPageToken?: string | undefined;
}
interface JobListJobs {
configuration?: BigQuery.Schema.JobConfiguration | undefined;
errorResult?: BigQuery.Schema.ErrorProto | undefined;
id?: string | undefined;
jobReference?: BigQuery.Schema.JobReference | undefined;
kind?: string | undefined;
state?: string | undefined;
statistics?: BigQuery.Schema.JobStatistics | undefined;
status?: BigQuery.Schema.JobStatus | undefined;
user_email?: string | undefined;
}
interface JobReference {
jobId?: string | undefined;
location?: string | undefined;
projectId?: string | undefined;
}
interface JobStatistics {
completionRatio?: number | undefined;
creationTime?: string | undefined;
endTime?: string | undefined;
extract?: BigQuery.Schema.JobStatistics4 | undefined;
load?: BigQuery.Schema.JobStatistics3 | undefined;
numChildJobs?: string | undefined;
parentJobId?: string | undefined;
query?: BigQuery.Schema.JobStatistics2 | undefined;
quotaDeferments?: string[] | undefined;
reservationUsage?: BigQuery.Schema.JobStatisticsReservationUsage[] | undefined;
startTime?: string | undefined;
totalBytesProcessed?: string | undefined;
totalSlotMs?: string | undefined;
}
interface JobStatistics2 {
billingTier?: number | undefined;
cacheHit?: boolean | undefined;
ddlOperationPerformed?: string | undefined;
ddlTargetRoutine?: BigQuery.Schema.RoutineReference | undefined;
ddlTargetTable?: BigQuery.Schema.TableReference | undefined;
estimatedBytesProcessed?: string | undefined;
modelTraining?: BigQuery.Schema.BigQueryModelTraining | undefined;
modelTrainingCurrentIteration?: number | undefined;
modelTrainingExpectedTotalIteration?: string | undefined;
numDmlAffectedRows?: string | undefined;
queryPlan?: BigQuery.Schema.ExplainQueryStage[] | undefined;
referencedTables?: BigQuery.Schema.TableReference[] | undefined;
reservationUsage?: BigQuery.Schema.JobStatistics2ReservationUsage[] | undefined;
schema?: BigQuery.Schema.TableSchema | undefined;
statementType?: string | undefined;
timeline?: BigQuery.Schema.QueryTimelineSample[] | undefined;
totalBytesBilled?: string | undefined;
totalBytesProcessed?: string | undefined;
totalBytesProcessedAccuracy?: string | undefined;
totalPartitionsProcessed?: string | undefined;
totalSlotMs?: string | undefined;
undeclaredQueryParameters?: BigQuery.Schema.QueryParameter[] | undefined;
}
interface JobStatistics2ReservationUsage {
name?: string | undefined;
slotMs?: string | undefined;
}
interface JobStatistics3 {
badRecords?: string | undefined;
inputFileBytes?: string | undefined;
inputFiles?: string | undefined;
outputBytes?: string | undefined;
outputRows?: string | undefined;
}
interface JobStatistics4 {
destinationUriFileCounts?: string[] | undefined;
inputBytes?: string | undefined;
}
interface JobStatisticsReservationUsage {
name?: string | undefined;
slotMs?: string | undefined;
}
interface JobStatus {
errorResult?: BigQuery.Schema.ErrorProto | undefined;
errors?: BigQuery.Schema.ErrorProto[] | undefined;
state?: string | undefined;
}
interface MaterializedViewDefinition {
lastRefreshTime?: string | undefined;
query?: string | undefined;
}
interface ModelDefinition {
modelOptions?: BigQuery.Schema.ModelDefinitionModelOptions | undefined;
trainingRuns?: BigQuery.Schema.BqmlTrainingRun[] | undefined;
}
interface ModelDefinitionModelOptions {
labels?: string[] | undefined;
lossType?: string | undefined;
modelType?: string | undefined;
}
interface ProjectList {
etag?: string | undefined;
kind?: string | undefined;
nextPageToken?: string | undefined;
projects?: BigQuery.Schema.ProjectListProjects[] | undefined;
totalItems?: number | undefined;
}
interface ProjectListProjects {
friendlyName?: string | undefined;
id?: string | undefined;
kind?: string | undefined;
numericId?: string | undefined;
projectReference?: BigQuery.Schema.ProjectReference | undefined;
}
interface ProjectReference {
projectId?: string | undefined;
}
interface QueryParameter {
name?: string | undefined;
parameterType?: BigQuery.Schema.QueryParameterType | undefined;
parameterValue?: BigQuery.Schema.QueryParameterValue | undefined;
}
interface QueryParameterType {
arrayType?: BigQuery.Schema.QueryParameterType | undefined;
structTypes?: BigQuery.Schema.QueryParameterTypeStructTypes[] | undefined;
type?: string | undefined;
}
interface QueryParameterTypeStructTypes {
description?: string | undefined;
name?: string | undefined;
type?: BigQuery.Schema.QueryParameterType | undefined;
}
interface QueryParameterValue {
arrayValues?: BigQuery.Schema.QueryParameterValue[] | undefined;
structValues?: object | undefined;
value?: string | undefined;
}
interface QueryRequest {
defaultDataset?: BigQuery.Schema.DatasetReference | undefined;
dryRun?: boolean | undefined;
kind?: string | undefined;
location?: string | undefined;
maxResults?: number | undefined;
parameterMode?: string | undefined;
preserveNulls?: boolean | undefined;
query?: string | undefined;
queryParameters?: BigQuery.Schema.QueryParameter[] | undefined;
timeoutMs?: number | undefined;
useLegacySql?: boolean | undefined;
useQueryCache?: boolean | undefined;
}
interface QueryResponse {
cacheHit?: boolean | undefined;
errors?: BigQuery.Schema.ErrorProto[] | undefined;
jobComplete?: boolean | undefined;
jobReference?: BigQuery.Schema.JobReference | undefined;
kind?: string | undefined;
numDmlAffectedRows?: string | undefined;
pageToken?: string | undefined;
rows?: BigQuery.Schema.TableRow[] | undefined;
schema?: BigQuery.Schema.TableSchema | undefined;
totalBytesProcessed?: string | undefined;
totalRows?: string | undefined;
}
interface QueryTimelineSample {
activeUnits?: string | undefined;
completedUnits?: string | undefined;
elapsedMs?: string | undefined;
pendingUnits?: string | undefined;
totalSlotMs?: string | undefined;
}
interface RangePartitioning {
field?: string | undefined;
range?: BigQuery.Schema.RangePartitioningRange | undefined;
}
interface RangePartitioningRange {
end?: string | undefined;
interval?: string | undefined;
start?: string | undefined;
}
interface RoutineReference {
datasetId?: string | undefined;
projectId?: string | undefined;
routineId?: string | undefined;
}
interface Streamingbuffer {
estimatedBytes?: string | undefined;
estimatedRows?: string | undefined;
oldestEntryTime?: string | undefined;
}
interface Table {
clustering?: BigQuery.Schema.Clustering | undefined;
creationTime?: string | undefined;
description?: string | undefined;
encryptionConfiguration?: BigQuery.Schema.EncryptionConfiguration | undefined;
etag?: string | undefined;
expirationTime?: string | undefined;
externalDataConfiguration?: BigQuery.Schema.ExternalDataConfiguration | undefined;
friendlyName?: string | undefined;
id?: string | undefined;
kind?: string | undefined;
labels?: object | undefined;
lastModifiedTime?: string | undefined;
location?: string | undefined;
materializedView?: BigQuery.Schema.MaterializedViewDefinition | undefined;
model?: BigQuery.Schema.ModelDefinition | undefined;
numBytes?: string | undefined;
numLongTermBytes?: string | undefined;
numPhysicalBytes?: string | undefined;
numRows?: string | undefined;
rangePartitioning?: BigQuery.Schema.RangePartitioning | undefined;
requirePartitionFilter?: boolean | undefined;
schema?: BigQuery.Schema.TableSchema | undefined;
selfLink?: string | undefined;
streamingBuffer?: BigQuery.Schema.Streamingbuffer | undefined;
tableReference?: BigQuery.Schema.TableReference | undefined;
timePartitioning?: BigQuery.Schema.TimePartitioning | undefined;
type?: string | undefined;
view?: BigQuery.Schema.ViewDefinition | undefined;
}
interface TableCell {
v?: object | undefined;
}
interface TableDataInsertAllRequest {
ignoreUnknownValues?: boolean | undefined;
kind?: string | undefined;
rows?: BigQuery.Schema.TableDataInsertAllRequestRows[] | undefined;
skipInvalidRows?: boolean | undefined;
templateSuffix?: string | undefined;
}
interface TableDataInsertAllRequestRows {
insertId?: string | undefined;
json?: object | undefined;
}
interface TableDataInsertAllResponse {
insertErrors?: BigQuery.Schema.TableDataInsertAllResponseInsertErrors[] | undefined;
kind?: string | undefined;
}
interface TableDataInsertAllResponseInsertErrors {
errors?: BigQuery.Schema.ErrorProto[] | undefined;
index?: number | undefined;
}
interface TableDataList {
etag?: string | undefined;
kind?: string | undefined;
pageToken?: string | undefined;
rows?: BigQuery.Schema.TableRow[] | undefined;
totalRows?: string | undefined;
}
interface TableFieldSchema {
categories?: BigQuery.Schema.TableFieldSchemaCategories | undefined;
description?: string | undefined;
fields?: BigQuery.Schema.TableFieldSchema[] | undefined;
mode?: string | undefined;
name?: string | undefined;
type?: string | undefined;
}
interface TableFieldSchemaCategories {
names?: string[] | undefined;
}
interface TableList {
etag?: string | undefined;
kind?: string | undefined;
nextPageToken?: string | undefined;
tables?: BigQuery.Schema.TableListTables[] | undefined;
totalItems?: number | undefined;
}
interface TableListTables {
clustering?: BigQuery.Schema.Clustering | undefined;
creationTime?: string | undefined;
expirationTime?: string | undefined;
friendlyName?: string | undefined;
id?: string | undefined;
kind?: string | undefined;
labels?: object | undefined;
tableReference?: BigQuery.Schema.TableReference | undefined;
timePartitioning?: BigQuery.Schema.TimePartitioning | undefined;
type?: string | undefined;
view?: BigQuery.Schema.TableListTablesView | undefined;
}
interface TableListTablesView {
useLegacySql?: boolean | undefined;
}
interface TableReference {
datasetId?: string | undefined;
projectId?: string | undefined;
tableId?: string | undefined;
}
interface TableRow {
f?: BigQuery.Schema.TableCell[] | undefined;
}
interface TableSchema {
fields?: BigQuery.Schema.TableFieldSchema[] | undefined;
}
interface TimePartitioning {
expirationMs?: string | undefined;
field?: string | undefined;
requirePartitionFilter?: boolean | undefined;
type?: string | undefined;
}
interface UserDefinedFunctionResource {
inlineCode?: string | undefined;
resourceUri?: string | undefined;
}
interface ViewDefinition {
query?: string | undefined;
useLegacySql?: boolean | undefined;
userDefinedFunctionResources?: BigQuery.Schema.UserDefinedFunctionResource[] | undefined;
}
}
}
interface BigQuery {
Datasets?: BigQuery.Collection.DatasetsCollection | undefined;
Jobs?: BigQuery.Collection.JobsCollection | undefined;
Projects?: BigQuery.Collection.ProjectsCollection | undefined;
Tabledata?: BigQuery.Collection.TabledataCollection | undefined;
Tables?: BigQuery.Collection.TablesCollection | undefined;
// Create a new instance of BigQueryModelTraining
newBigQueryModelTraining(): BigQuery.Schema.BigQueryModelTraining;
// Create a new instance of BigtableColumn
newBigtableColumn(): BigQuery.Schema.BigtableColumn;
// Create a new instance of BigtableColumnFamily
newBigtableColumnFamily(): BigQuery.Schema.BigtableColumnFamily;
// Create a new instance of BigtableOptions
newBigtableOptions(): BigQuery.Schema.BigtableOptions;
// Create a new instance of BqmlIterationResult
newBqmlIterationResult(): BigQuery.Schema.BqmlIterationResult;
// Create a new instance of BqmlTrainingRun
newBqmlTrainingRun(): BigQuery.Schema.BqmlTrainingRun;
// Create a new instance of BqmlTrainingRunTrainingOptions
newBqmlTrainingRunTrainingOptions(): BigQuery.Schema.BqmlTrainingRunTrainingOptions;
// Create a new instance of Clustering
newClustering(): BigQuery.Schema.Clustering;
// Create a new instance of CsvOptions
newCsvOptions(): BigQuery.Schema.CsvOptions;
// Create a new instance of Dataset
newDataset(): BigQuery.Schema.Dataset;
// Create a new instance of DatasetAccess
newDatasetAccess(): BigQuery.Schema.DatasetAccess;
// Create a new instance of DatasetReference
newDatasetReference(): BigQuery.Schema.DatasetReference;
// Create a new instance of DestinationTableProperties
newDestinationTableProperties(): BigQuery.Schema.DestinationTableProperties;
// Create a new instance of EncryptionConfiguration
newEncryptionConfiguration(): BigQuery.Schema.EncryptionConfiguration;
// Create a new instance of ErrorProto
newErrorProto(): BigQuery.Schema.ErrorProto;
// Create a new instance of ExplainQueryStage
newExplainQueryStage(): BigQuery.Schema.ExplainQueryStage;
// Create a new instance of ExplainQueryStep
newExplainQueryStep(): BigQuery.Schema.ExplainQueryStep;
// Create a new instance of ExternalDataConfiguration
newExternalDataConfiguration(): BigQuery.Schema.ExternalDataConfiguration;
// Create a new instance of GoogleSheetsOptions
newGoogleSheetsOptions(): BigQuery.Schema.GoogleSheetsOptions;
// Create a new instance of Job
newJob(): BigQuery.Schema.Job;
// Create a new instance of JobConfiguration
newJobConfiguration(): BigQuery.Schema.JobConfiguration;
// Create a new instance of JobConfigurationExtract
newJobConfigurationExtract(): BigQuery.Schema.JobConfigurationExtract;
// Create a new instance of JobConfigurationLoad
newJobConfigurationLoad(): BigQuery.Schema.JobConfigurationLoad;
// Create a new instance of JobConfigurationQuery
newJobConfigurationQuery(): BigQuery.Schema.JobConfigurationQuery;
// Create a new instance of JobConfigurationTableCopy
newJobConfigurationTableCopy(): BigQuery.Schema.JobConfigurationTableCopy;
// Create a new instance of JobReference
newJobReference(): BigQuery.Schema.JobReference;
// Create a new instance of JobStatistics
newJobStatistics(): BigQuery.Schema.JobStatistics;
// Create a new instance of JobStatistics2
newJobStatistics2(): BigQuery.Schema.JobStatistics2;
// Create a new instance of JobStatistics2ReservationUsage
newJobStatistics2ReservationUsage(): BigQuery.Schema.JobStatistics2ReservationUsage;
// Create a new instance of JobStatistics3
newJobStatistics3(): BigQuery.Schema.JobStatistics3;
// Create a new instance of JobStatistics4
newJobStatistics4(): BigQuery.Schema.JobStatistics4;
// Create a new instance of JobStatisticsReservationUsage
newJobStatisticsReservationUsage(): BigQuery.Schema.JobStatisticsReservationUsage;
// Create a new instance of JobStatus
newJobStatus(): BigQuery.Schema.JobStatus;
// Create a new instance of MaterializedViewDefinition
newMaterializedViewDefinition(): BigQuery.Schema.MaterializedViewDefinition;
// Create a new instance of ModelDefinition
newModelDefinition(): BigQuery.Schema.ModelDefinition;
// Create a new instance of ModelDefinitionModelOptions
newModelDefinitionModelOptions(): BigQuery.Schema.ModelDefinitionModelOptions;
// Create a new instance of QueryParameter
newQueryParameter(): BigQuery.Schema.QueryParameter;
// Create a new instance of QueryParameterType
newQueryParameterType(): BigQuery.Schema.QueryParameterType;
// Create a new instance of QueryParameterTypeStructTypes
newQueryParameterTypeStructTypes(): BigQuery.Schema.QueryParameterTypeStructTypes;
// Create a new instance of QueryParameterValue
newQueryParameterValue(): BigQuery.Schema.QueryParameterValue;
// Create a new instance of QueryRequest
newQueryRequest(): BigQuery.Schema.QueryRequest;
// Create a new instance of QueryTimelineSample
newQueryTimelineSample(): BigQuery.Schema.QueryTimelineSample;
// Create a new instance of RangePartitioning
newRangePartitioning(): BigQuery.Schema.RangePartitioning;
// Create a new instance of RangePartitioningRange
newRangePartitioningRange(): BigQuery.Schema.RangePartitioningRange;
// Create a new instance of RoutineReference
newRoutineReference(): BigQuery.Schema.RoutineReference;
// Create a new instance of Streamingbuffer
newStreamingbuffer(): BigQuery.Schema.Streamingbuffer;
// Create a new instance of Table
newTable(): BigQuery.Schema.Table;
// Create a new instance of TableDataInsertAllRequest
newTableDataInsertAllRequest(): BigQuery.Schema.TableDataInsertAllRequest;
// Create a new instance of TableDataInsertAllRequestRows
newTableDataInsertAllRequestRows(): BigQuery.Schema.TableDataInsertAllRequestRows;
// Create a new instance of TableFieldSchema
newTableFieldSchema(): BigQuery.Schema.TableFieldSchema;
// Create a new instance of TableFieldSchemaCategories
newTableFieldSchemaCategories(): BigQuery.Schema.TableFieldSchemaCategories;
// Create a new instance of TableReference
newTableReference(): BigQuery.Schema.TableReference;
// Create a new instance of TableSchema
newTableSchema(): BigQuery.Schema.TableSchema;
// Create a new instance of TimePartitioning
newTimePartitioning(): BigQuery.Schema.TimePartitioning;
// Create a new instance of UserDefinedFunctionResource
newUserDefinedFunctionResource(): BigQuery.Schema.UserDefinedFunctionResource;
// Create a new instance of ViewDefinition
newViewDefinition(): BigQuery.Schema.ViewDefinition;
}
}
declare var BigQuery: GoogleAppsScript.BigQuery;

View File

@ -0,0 +1,731 @@
declare namespace GoogleAppsScript {
namespace Calendar {
namespace Collection {
interface AclCollection {
// Returns an access control rule.
get(calendarId: string, ruleId: string): Calendar.Schema.AclRule;
// Returns an access control rule.
get(calendarId: string, ruleId: string, optionalArgs: object, headers: object): Calendar.Schema.AclRule;
// Creates an access control rule.
insert(resource: Schema.AclRule, calendarId: string): Calendar.Schema.AclRule;
// Creates an access control rule.
insert(resource: Schema.AclRule, calendarId: string, optionalArgs: object): Calendar.Schema.AclRule;
// Creates an access control rule.
insert(
resource: Schema.AclRule,
calendarId: string,
optionalArgs: object,
headers: object,
): Calendar.Schema.AclRule;
// Returns the rules in the access control list for the calendar.
list(calendarId: string): Calendar.Schema.Acl;
// Returns the rules in the access control list for the calendar.
list(calendarId: string, optionalArgs: object): Calendar.Schema.Acl;
// Returns the rules in the access control list for the calendar.
list(calendarId: string, optionalArgs: object, headers: object): Calendar.Schema.Acl;
// Updates an access control rule. This method supports patch semantics.
patch(resource: Schema.AclRule, calendarId: string, ruleId: string): Calendar.Schema.AclRule;
// Updates an access control rule. This method supports patch semantics.
patch(
resource: Schema.AclRule,
calendarId: string,
ruleId: string,
optionalArgs: object,
): Calendar.Schema.AclRule;
// Updates an access control rule. This method supports patch semantics.
patch(
resource: Schema.AclRule,
calendarId: string,
ruleId: string,
optionalArgs: object,
headers: object,
): Calendar.Schema.AclRule;
// Deletes an access control rule.
remove(calendarId: string, ruleId: string): void;
// Deletes an access control rule.
remove(calendarId: string, ruleId: string, optionalArgs: object, headers: object): void;
// Updates an access control rule.
update(resource: Schema.AclRule, calendarId: string, ruleId: string): Calendar.Schema.AclRule;
// Updates an access control rule.
update(
resource: Schema.AclRule,
calendarId: string,
ruleId: string,
optionalArgs: object,
): Calendar.Schema.AclRule;
// Updates an access control rule.
update(
resource: Schema.AclRule,
calendarId: string,
ruleId: string,
optionalArgs: object,
headers: object,
): Calendar.Schema.AclRule;
// Watch for changes to ACL resources.
watch(resource: Schema.Channel, calendarId: string): Calendar.Schema.Channel;
// Watch for changes to ACL resources.
watch(resource: Schema.Channel, calendarId: string, optionalArgs: object): Calendar.Schema.Channel;
// Watch for changes to ACL resources.
watch(
resource: Schema.Channel,
calendarId: string,
optionalArgs: object,
headers: object,
): Calendar.Schema.Channel;
}
interface CalendarListCollection {
// Returns a calendar from the user's calendar list.
get(calendarId: string): Calendar.Schema.CalendarListEntry;
// Returns a calendar from the user's calendar list.
get(calendarId: string, optionalArgs: object, headers: object): Calendar.Schema.CalendarListEntry;
// Inserts an existing calendar into the user's calendar list.
insert(resource: Schema.CalendarListEntry): Calendar.Schema.CalendarListEntry;
// Inserts an existing calendar into the user's calendar list.
insert(resource: Schema.CalendarListEntry, optionalArgs: object): Calendar.Schema.CalendarListEntry;
// Inserts an existing calendar into the user's calendar list.
insert(
resource: Schema.CalendarListEntry,
optionalArgs: object,
headers: object,
): Calendar.Schema.CalendarListEntry;
// Returns the calendars on the user's calendar list.
list(): Calendar.Schema.CalendarList;
// Returns the calendars on the user's calendar list.
list(optionalArgs: object): Calendar.Schema.CalendarList;
// Returns the calendars on the user's calendar list.
list(optionalArgs: object, headers: object): Calendar.Schema.CalendarList;
// Updates an existing calendar on the user's calendar list. This method supports patch semantics.
patch(resource: Schema.CalendarListEntry, calendarId: string): Calendar.Schema.CalendarListEntry;
// Updates an existing calendar on the user's calendar list. This method supports patch semantics.
patch(
resource: Schema.CalendarListEntry,
calendarId: string,
optionalArgs: object,
): Calendar.Schema.CalendarListEntry;
// Updates an existing calendar on the user's calendar list. This method supports patch semantics.
patch(
resource: Schema.CalendarListEntry,
calendarId: string,
optionalArgs: object,
headers: object,
): Calendar.Schema.CalendarListEntry;
// Removes a calendar from the user's calendar list.
remove(calendarId: string): void;
// Removes a calendar from the user's calendar list.
remove(calendarId: string, optionalArgs: object, headers: object): void;
// Updates an existing calendar on the user's calendar list.
update(resource: Schema.CalendarListEntry, calendarId: string): Calendar.Schema.CalendarListEntry;
// Updates an existing calendar on the user's calendar list.
update(
resource: Schema.CalendarListEntry,
calendarId: string,
optionalArgs: object,
): Calendar.Schema.CalendarListEntry;
// Updates an existing calendar on the user's calendar list.
update(
resource: Schema.CalendarListEntry,
calendarId: string,
optionalArgs: object,
headers: object,
): Calendar.Schema.CalendarListEntry;
// Watch for changes to CalendarList resources.
watch(resource: Schema.Channel): Calendar.Schema.Channel;
// Watch for changes to CalendarList resources.
watch(resource: Schema.Channel, optionalArgs: object): Calendar.Schema.Channel;
// Watch for changes to CalendarList resources.
watch(resource: Schema.Channel, optionalArgs: object, headers: object): Calendar.Schema.Channel;
}
interface CalendarsCollection {
// Clears a primary calendar. This operation deletes all events associated with the primary calendar of an account.
clear(calendarId: string): void;
// Clears a primary calendar. This operation deletes all events associated with the primary calendar of an account.
clear(calendarId: string, optionalArgs: object, headers: object): void;
// Returns metadata for a calendar.
get(calendarId: string): Calendar.Schema.Calendar;
// Returns metadata for a calendar.
get(calendarId: string, optionalArgs: object, headers: object): Calendar.Schema.Calendar;
// Creates a secondary calendar.
insert(resource: Schema.Calendar): Calendar.Schema.Calendar;
// Creates a secondary calendar.
insert(resource: Schema.Calendar, optionalArgs: object, headers: object): Calendar.Schema.Calendar;
// Updates metadata for a calendar. This method supports patch semantics.
patch(resource: Schema.Calendar, calendarId: string): Calendar.Schema.Calendar;
// Updates metadata for a calendar. This method supports patch semantics.
patch(
resource: Schema.Calendar,
calendarId: string,
optionalArgs: object,
headers: object,
): Calendar.Schema.Calendar;
// Deletes a secondary calendar. Use calendars.clear for clearing all events on primary calendars.
remove(calendarId: string): void;
// Deletes a secondary calendar. Use calendars.clear for clearing all events on primary calendars.
remove(calendarId: string, optionalArgs: object, headers: object): void;
// Updates metadata for a calendar.
update(resource: Schema.Calendar, calendarId: string): Calendar.Schema.Calendar;
// Updates metadata for a calendar.
update(
resource: Schema.Calendar,
calendarId: string,
optionalArgs: object,
headers: object,
): Calendar.Schema.Calendar;
}
interface ChannelsCollection {
// Stop watching resources through this channel
stop(resource: Schema.Channel): void;
// Stop watching resources through this channel
stop(resource: Schema.Channel, optionalArgs: object, headers: object): void;
}
interface ColorsCollection {
// Returns the color definitions for calendars and events.
get(): Calendar.Schema.Colors;
// Returns the color definitions for calendars and events.
get(optionalArgs: object, headers: object): Calendar.Schema.Colors;
}
interface EventsCollection {
// Returns an event.
get(calendarId: string, eventId: string): Calendar.Schema.Event;
// Returns an event.
get(calendarId: string, eventId: string, optionalArgs: object): Calendar.Schema.Event;
// Returns an event.
get(calendarId: string, eventId: string, optionalArgs: object, headers: object): Calendar.Schema.Event;
// Imports an event. This operation is used to add a private copy of an existing event to a calendar.
import(resource: Schema.Event, calendarId: string): Calendar.Schema.Event;
// Imports an event. This operation is used to add a private copy of an existing event to a calendar.
import(resource: Schema.Event, calendarId: string, optionalArgs: object): Calendar.Schema.Event;
// Imports an event. This operation is used to add a private copy of an existing event to a calendar.
import(
resource: Schema.Event,
calendarId: string,
optionalArgs: object,
headers: object,
): Calendar.Schema.Event;
// Creates an event.
insert(resource: Schema.Event, calendarId: string): Calendar.Schema.Event;
// Creates an event.
insert(resource: Schema.Event, calendarId: string, optionalArgs: object): Calendar.Schema.Event;
// Creates an event.
insert(
resource: Schema.Event,
calendarId: string,
optionalArgs: object,
headers: object,
): Calendar.Schema.Event;
// Returns instances of the specified recurring event.
instances(calendarId: string, eventId: string): Calendar.Schema.Events;
// Returns instances of the specified recurring event.
instances(calendarId: string, eventId: string, optionalArgs: object): Calendar.Schema.Events;
// Returns instances of the specified recurring event.
instances(
calendarId: string,
eventId: string,
optionalArgs: object,
headers: object,
): Calendar.Schema.Events;
// Returns events on the specified calendar.
list(calendarId: string): Calendar.Schema.Events;
// Returns events on the specified calendar.
list(calendarId: string, optionalArgs: object): Calendar.Schema.Events;
// Returns events on the specified calendar.
list(calendarId: string, optionalArgs: object, headers: object): Calendar.Schema.Events;
// Moves an event to another calendar, i.e. changes an event's organizer.
move(calendarId: string, eventId: string, destination: string): Calendar.Schema.Event;
// Moves an event to another calendar, i.e. changes an event's organizer.
move(
calendarId: string,
eventId: string,
destination: string,
optionalArgs: object,
): Calendar.Schema.Event;
// Moves an event to another calendar, i.e. changes an event's organizer.
move(
calendarId: string,
eventId: string,
destination: string,
optionalArgs: object,
headers: object,
): Calendar.Schema.Event;
// Updates an event. This method supports patch semantics.
patch(resource: Schema.Event, calendarId: string, eventId: string): Calendar.Schema.Event;
// Updates an event. This method supports patch semantics.
patch(
resource: Schema.Event,
calendarId: string,
eventId: string,
optionalArgs: object,
): Calendar.Schema.Event;
// Updates an event. This method supports patch semantics.
patch(
resource: Schema.Event,
calendarId: string,
eventId: string,
optionalArgs: object,
headers: object,
): Calendar.Schema.Event;
// Creates an event based on a simple text string.
quickAdd(calendarId: string, text: string): Calendar.Schema.Event;
// Creates an event based on a simple text string.
quickAdd(calendarId: string, text: string, optionalArgs: object): Calendar.Schema.Event;
// Creates an event based on a simple text string.
quickAdd(
calendarId: string,
text: string,
optionalArgs: object,
headers: object,
): Calendar.Schema.Event;
// Deletes an event.
remove(calendarId: string, eventId: string): void;
// Deletes an event.
remove(calendarId: string, eventId: string, optionalArgs: object): void;
// Deletes an event.
remove(calendarId: string, eventId: string, optionalArgs: object, headers: object): void;
// Updates an event.
update(resource: Schema.Event, calendarId: string, eventId: string): Calendar.Schema.Event;
// Updates an event.
update(
resource: Schema.Event,
calendarId: string,
eventId: string,
optionalArgs: object,
): Calendar.Schema.Event;
// Updates an event.
update(
resource: Schema.Event,
calendarId: string,
eventId: string,
optionalArgs: object,
headers: object,
): Calendar.Schema.Event;
// Watch for changes to Events resources.
watch(resource: Schema.Channel, calendarId: string): Calendar.Schema.Channel;
// Watch for changes to Events resources.
watch(resource: Schema.Channel, calendarId: string, optionalArgs: object): Calendar.Schema.Channel;
// Watch for changes to Events resources.
watch(
resource: Schema.Channel,
calendarId: string,
optionalArgs: object,
headers: object,
): Calendar.Schema.Channel;
}
interface FreebusyCollection {
// Returns free/busy information for a set of calendars.
query(resource: Schema.FreeBusyRequest): Calendar.Schema.FreeBusyResponse;
// Returns free/busy information for a set of calendars.
query(
resource: Schema.FreeBusyRequest,
optionalArgs: object,
headers: object,
): Calendar.Schema.FreeBusyResponse;
}
interface SettingsCollection {
// Returns a single user setting.
get(setting: string): Calendar.Schema.Setting;
// Returns a single user setting.
get(setting: string, optionalArgs: object, headers: object): Calendar.Schema.Setting;
// Returns all user settings for the authenticated user.
list(): Calendar.Schema.Settings;
// Returns all user settings for the authenticated user.
list(optionalArgs: object): Calendar.Schema.Settings;
// Returns all user settings for the authenticated user.
list(optionalArgs: object, headers: object): Calendar.Schema.Settings;
// Watch for changes to Settings resources.
watch(resource: Schema.Channel): Calendar.Schema.Channel;
// Watch for changes to Settings resources.
watch(resource: Schema.Channel, optionalArgs: object): Calendar.Schema.Channel;
// Watch for changes to Settings resources.
watch(resource: Schema.Channel, optionalArgs: object, headers: object): Calendar.Schema.Channel;
}
}
namespace Schema {
interface Acl {
etag?: string | undefined;
items?: Calendar.Schema.AclRule[] | undefined;
kind?: string | undefined;
nextPageToken?: string | undefined;
nextSyncToken?: string | undefined;
}
interface AclRule {
etag?: string | undefined;
id?: string | undefined;
kind?: string | undefined;
role?: string | undefined;
scope?: Calendar.Schema.AclRuleScope | undefined;
}
interface AclRuleScope {
type?: string | undefined;
value?: string | undefined;
}
interface Calendar {
conferenceProperties?: Calendar.Schema.ConferenceProperties | undefined;
description?: string | undefined;
etag?: string | undefined;
id?: string | undefined;
kind?: string | undefined;
location?: string | undefined;
summary?: string | undefined;
timeZone?: string | undefined;
}
interface CalendarList {
etag?: string | undefined;
items?: Calendar.Schema.CalendarListEntry[] | undefined;
kind?: string | undefined;
nextPageToken?: string | undefined;
nextSyncToken?: string | undefined;
}
interface CalendarListEntry {
accessRole?: string | undefined;
backgroundColor?: string | undefined;
colorId?: string | undefined;
conferenceProperties?: Calendar.Schema.ConferenceProperties | undefined;
defaultReminders?: Calendar.Schema.EventReminder[] | undefined;
deleted?: boolean | undefined;
description?: string | undefined;
etag?: string | undefined;
foregroundColor?: string | undefined;
hidden?: boolean | undefined;
id?: string | undefined;
kind?: string | undefined;
location?: string | undefined;
notificationSettings?: Calendar.Schema.CalendarListEntryNotificationSettings | undefined;
primary?: boolean | undefined;
selected?: boolean | undefined;
summary?: string | undefined;
summaryOverride?: string | undefined;
timeZone?: string | undefined;
}
interface CalendarListEntryNotificationSettings {
notifications?: Calendar.Schema.CalendarNotification[] | undefined;
}
interface CalendarNotification {
method?: string | undefined;
type?: string | undefined;
}
interface Channel {
address?: string | undefined;
expiration?: string | undefined;
id?: string | undefined;
kind?: string | undefined;
params?: object | undefined;
payload?: boolean | undefined;
resourceId?: string | undefined;
resourceUri?: string | undefined;
token?: string | undefined;
type?: string | undefined;
}
interface ColorDefinition {
background?: string | undefined;
foreground?: string | undefined;
}
interface Colors {
calendar?: object | undefined;
event?: object | undefined;
kind?: string | undefined;
updated?: string | undefined;
}
interface ConferenceData {
conferenceId?: string | undefined;
conferenceSolution?: Calendar.Schema.ConferenceSolution | undefined;
createRequest?: Calendar.Schema.CreateConferenceRequest | undefined;
entryPoints?: Calendar.Schema.EntryPoint[] | undefined;
notes?: string | undefined;
parameters?: Calendar.Schema.ConferenceParameters | undefined;
signature?: string | undefined;
}
interface ConferenceParameters {
addOnParameters?: Calendar.Schema.ConferenceParametersAddOnParameters | undefined;
}
interface ConferenceParametersAddOnParameters {
parameters?: Record<string, string> | undefined;
}
interface ConferenceProperties {
allowedConferenceSolutionTypes?: string[] | undefined;
}
interface ConferenceRequestStatus {
statusCode?: string | undefined;
}
interface ConferenceSolution {
iconUri?: string | undefined;
key?: Calendar.Schema.ConferenceSolutionKey | undefined;
name?: string | undefined;
}
interface ConferenceSolutionKey {
type?: string | undefined;
}
interface CreateConferenceRequest {
conferenceSolutionKey?: Calendar.Schema.ConferenceSolutionKey | undefined;
requestId?: string | undefined;
status?: Calendar.Schema.ConferenceRequestStatus | undefined;
}
interface EntryPoint {
accessCode?: string | undefined;
entryPointFeatures?: string[] | undefined;
entryPointType?: string | undefined;
label?: string | undefined;
meetingCode?: string | undefined;
passcode?: string | undefined;
password?: string | undefined;
pin?: string | undefined;
regionCode?: string | undefined;
uri?: string | undefined;
}
interface Error {
domain?: string | undefined;
reason?: string | undefined;
}
interface Event {
anyoneCanAddSelf?: boolean | undefined;
attachments?: Calendar.Schema.EventAttachment[] | undefined;
attendees?: Calendar.Schema.EventAttendee[] | undefined;
attendeesOmitted?: boolean | undefined;
colorId?: string | undefined;
conferenceData?: Calendar.Schema.ConferenceData | undefined;
created?: string | undefined;
creator?: Calendar.Schema.EventCreator | undefined;
description?: string | undefined;
end?: Calendar.Schema.EventDateTime | undefined;
endTimeUnspecified?: boolean | undefined;
etag?: string | undefined;
eventType?: "default" | "outOfOffice" | "focusTime" | "workingLocation";
extendedProperties?: Calendar.Schema.EventExtendedProperties | undefined;
gadget?: Calendar.Schema.EventGadget | undefined;
guestsCanInviteOthers?: boolean | undefined;
guestsCanModify?: boolean | undefined;
guestsCanSeeOtherGuests?: boolean | undefined;
hangoutLink?: string | undefined;
htmlLink?: string | undefined;
iCalUID?: string | undefined;
id?: string | undefined;
kind?: string | undefined;
location?: string | undefined;
locked?: boolean | undefined;
organizer?: Calendar.Schema.EventOrganizer | undefined;
originalStartTime?: Calendar.Schema.EventDateTime | undefined;
privateCopy?: boolean | undefined;
recurrence?: string[] | undefined;
recurringEventId?: string | undefined;
reminders?: Calendar.Schema.EventReminders | undefined;
sequence?: number | undefined;
source?: Calendar.Schema.EventSource | undefined;
start?: Calendar.Schema.EventDateTime | undefined;
status?: string | undefined;
summary?: string | undefined;
transparency?: string | undefined;
updated?: string | undefined;
visibility?: string | undefined;
workingLocationProperties?: Calendar.Schema.EventWorkingLocationProperties | undefined;
}
interface EventAttachment {
fileId?: string | undefined;
fileUrl?: string | undefined;
iconLink?: string | undefined;
mimeType?: string | undefined;
title?: string | undefined;
}
interface EventAttendee {
additionalGuests?: number | undefined;
comment?: string | undefined;
displayName?: string | undefined;
email?: string | undefined;
id?: string | undefined;
optional?: boolean | undefined;
organizer?: boolean | undefined;
resource?: boolean | undefined;
responseStatus?: string | undefined;
self?: boolean | undefined;
}
interface EventCreator {
displayName?: string | undefined;
email?: string | undefined;
id?: string | undefined;
self?: boolean | undefined;
}
interface EventDateTime {
date?: string | undefined;
dateTime?: string | undefined;
timeZone?: string | undefined;
}
interface EventExtendedProperties {
private?: Record<string, string> | undefined;
shared?: Record<string, string> | undefined;
}
interface EventGadget {
display?: string | undefined;
height?: number | undefined;
iconLink?: string | undefined;
link?: string | undefined;
preferences?: object | undefined;
title?: string | undefined;
type?: string | undefined;
width?: number | undefined;
}
interface EventOrganizer {
displayName?: string | undefined;
email?: string | undefined;
id?: string | undefined;
self?: boolean | undefined;
}
interface EventReminder {
method?: string | undefined;
minutes?: number | undefined;
}
interface EventReminders {
overrides?: Calendar.Schema.EventReminder[] | undefined;
useDefault?: boolean | undefined;
}
interface EventSource {
title?: string | undefined;
url?: string | undefined;
}
interface Events {
accessRole?: string | undefined;
defaultReminders?: Calendar.Schema.EventReminder[] | undefined;
description?: string | undefined;
etag?: string | undefined;
items?: Calendar.Schema.Event[] | undefined;
kind?: string | undefined;
nextPageToken?: string | undefined;
nextSyncToken?: string | undefined;
summary?: string | undefined;
timeZone?: string | undefined;
updated?: string | undefined;
}
interface FreeBusyCalendar {
busy?: Calendar.Schema.TimePeriod[] | undefined;
errors?: Calendar.Schema.Error[] | undefined;
}
interface FreeBusyGroup {
calendars?: string[] | undefined;
errors?: Calendar.Schema.Error[] | undefined;
}
interface FreeBusyRequest {
calendarExpansionMax?: number | undefined;
groupExpansionMax?: number | undefined;
items?: Calendar.Schema.FreeBusyRequestItem[] | undefined;
timeMax?: string | undefined;
timeMin?: string | undefined;
timeZone?: string | undefined;
}
interface FreeBusyRequestItem {
id?: string | undefined;
}
interface FreeBusyResponse {
calendars?: object | undefined;
groups?: object | undefined;
kind?: string | undefined;
timeMax?: string | undefined;
timeMin?: string | undefined;
}
interface Setting {
etag?: string | undefined;
id?: string | undefined;
kind?: string | undefined;
value?: string | undefined;
}
interface Settings {
etag?: string | undefined;
items?: Calendar.Schema.Setting[] | undefined;
kind?: string | undefined;
nextPageToken?: string | undefined;
nextSyncToken?: string | undefined;
}
interface TimePeriod {
end?: string | undefined;
start?: string | undefined;
}
interface EventWorkingLocationPropertiesOfficeLocation {
buildingId?: string | undefined;
floorId?: string | undefined;
floorSectionId?: string | undefined;
deskId?: string | undefined;
label?: string | undefined;
}
interface EventWorkingLocationPropertiesCustomLocation {
label: string;
}
interface EventWorkingLocationProperties {
type?: string | undefined;
homeOffice?: object | undefined;
customLocation?: EventWorkingLocationPropertiesCustomLocation | undefined;
officeLocation?: EventWorkingLocationPropertiesOfficeLocation | undefined;
}
}
}
interface Calendar {
Acl?: Calendar.Collection.AclCollection | undefined;
CalendarList?: Calendar.Collection.CalendarListCollection | undefined;
Calendars?: Calendar.Collection.CalendarsCollection | undefined;
Channels?: Calendar.Collection.ChannelsCollection | undefined;
Colors?: Calendar.Collection.ColorsCollection | undefined;
Events?: Calendar.Collection.EventsCollection | undefined;
Freebusy?: Calendar.Collection.FreebusyCollection | undefined;
Settings?: Calendar.Collection.SettingsCollection | undefined;
// Create a new instance of AclRule
newAclRule(): Calendar.Schema.AclRule;
// Create a new instance of AclRuleScope
newAclRuleScope(): Calendar.Schema.AclRuleScope;
// Create a new instance of Calendar
newCalendar(): Calendar.Schema.Calendar;
// Create a new instance of CalendarListEntry
newCalendarListEntry(): Calendar.Schema.CalendarListEntry;
// Create a new instance of CalendarListEntryNotificationSettings
newCalendarListEntryNotificationSettings(): Calendar.Schema.CalendarListEntryNotificationSettings;
// Create a new instance of CalendarNotification
newCalendarNotification(): Calendar.Schema.CalendarNotification;
// Create a new instance of Channel
newChannel(): Calendar.Schema.Channel;
// Create a new instance of ConferenceData
newConferenceData(): Calendar.Schema.ConferenceData;
// Create a new instance of ConferenceParameters
newConferenceParameters(): Calendar.Schema.ConferenceParameters;
// Create a new instance of ConferenceParametersAddOnParameters
newConferenceParametersAddOnParameters(): Calendar.Schema.ConferenceParametersAddOnParameters;
// Create a new instance of ConferenceProperties
newConferenceProperties(): Calendar.Schema.ConferenceProperties;
// Create a new instance of ConferenceRequestStatus
newConferenceRequestStatus(): Calendar.Schema.ConferenceRequestStatus;
// Create a new instance of ConferenceSolution
newConferenceSolution(): Calendar.Schema.ConferenceSolution;
// Create a new instance of ConferenceSolutionKey
newConferenceSolutionKey(): Calendar.Schema.ConferenceSolutionKey;
// Create a new instance of CreateConferenceRequest
newCreateConferenceRequest(): Calendar.Schema.CreateConferenceRequest;
// Create a new instance of EntryPoint
newEntryPoint(): Calendar.Schema.EntryPoint;
// Create a new instance of Event
newEvent(): Calendar.Schema.Event;
// Create a new instance of EventAttachment
newEventAttachment(): Calendar.Schema.EventAttachment;
// Create a new instance of EventAttendee
newEventAttendee(): Calendar.Schema.EventAttendee;
// Create a new instance of EventCreator
newEventCreator(): Calendar.Schema.EventCreator;
// Create a new instance of EventDateTime
newEventDateTime(): Calendar.Schema.EventDateTime;
// Create a new instance of EventExtendedProperties
newEventExtendedProperties(): Calendar.Schema.EventExtendedProperties;
// Create a new instance of EventGadget
newEventGadget(): Calendar.Schema.EventGadget;
// Create a new instance of EventOrganizer
newEventOrganizer(): Calendar.Schema.EventOrganizer;
// Create a new instance of EventReminder
newEventReminder(): Calendar.Schema.EventReminder;
// Create a new instance of EventReminders
newEventReminders(): Calendar.Schema.EventReminders;
// Create a new instance of EventSource
newEventSource(): Calendar.Schema.EventSource;
// Create a new instance of FreeBusyRequest
newFreeBusyRequest(): Calendar.Schema.FreeBusyRequest;
// Create a new instance of FreeBusyRequestItem
newFreeBusyRequestItem(): Calendar.Schema.FreeBusyRequestItem;
// Create a new instance of EventWorkingLocationProperties
newEventWorkingLocationProperties(): Calendar.Schema.EventWorkingLocationProperties;
// Create a new instance of EventWorkingLocationPropertiesCustomLocation
newEventWorkingLocationPropertiesCustomLocation(): Calendar.Schema.EventWorkingLocationPropertiesCustomLocation;
// Create a new instance of EventWorkingLocationPropertiesOfficeLocation
newEventWorkingLocationPropertiesOfficeLocation(): Calendar.Schema.EventWorkingLocationPropertiesOfficeLocation;
}
}
declare var Calendar: GoogleAppsScript.Calendar;

View File

@ -0,0 +1,946 @@
declare namespace GoogleAppsScript {
namespace Classroom {
namespace Collection {
namespace Courses {
namespace CourseWork {
interface StudentSubmissionsCollection {
// Returns a student submission.
// *`PERMISSION_DENIED` if the requesting user is not permitted to access the requested course, course work, or student submission or for access errors.
// *`INVALID_ARGUMENT` if the request is malformed.
// *`NOT_FOUND` if the requested course, course work, or student submission does not exist.
get(courseId: string, courseWorkId: string, id: string): Classroom.Schema.StudentSubmission;
// Returns a list of student submissions that the requester is permitted to view, factoring in the OAuth scopes of the request. `-` may be specified as the `course_work_id` to include student submissions for multiple course work items. Course students may only view their own work. Course teachers and domain administrators may view all student submissions. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, or for access errors.
// *`INVALID_ARGUMENT` if the request is malformed.
// *`NOT_FOUND` if the requested course does not exist.
list(courseId: string, courseWorkId: string): Classroom.Schema.ListStudentSubmissionsResponse;
// Returns a list of student submissions that the requester is permitted to view, factoring in the OAuth scopes of the request. `-` may be specified as the `course_work_id` to include student submissions for multiple course work items. Course students may only view their own work. Course teachers and domain administrators may view all student submissions. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, or for access errors.
// *`INVALID_ARGUMENT` if the request is malformed.
// *`NOT_FOUND` if the requested course does not exist.
list(
courseId: string,
courseWorkId: string,
optionalArgs: object,
): Classroom.Schema.ListStudentSubmissionsResponse;
// Modifies attachments of student submission. Attachments may only be added to student submissions belonging to course work objects with a `workType` of `ASSIGNMENT`. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, if the user is not permitted to modify attachments on the requested student submission, or for access errors.
// *`INVALID_ARGUMENT` if the request is malformed.
// *`NOT_FOUND` if the requested course, course work, or student submission does not exist.
modifyAttachments(
resource: Schema.ModifyAttachmentsRequest,
courseId: string,
courseWorkId: string,
id: string,
): Classroom.Schema.StudentSubmission;
// Updates one or more fields of a student submission. See google.classroom.v1.StudentSubmission for details of which fields may be updated and who may change them. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting developer project did not create the corresponding course work, if the user is not permitted to make the requested modification to the student submission, or for access errors.
// *`INVALID_ARGUMENT` if the request is malformed.
// *`NOT_FOUND` if the requested course, course work, or student submission does not exist.
patch(
resource: Schema.StudentSubmission,
courseId: string,
courseWorkId: string,
id: string,
): Classroom.Schema.StudentSubmission;
// Updates one or more fields of a student submission. See google.classroom.v1.StudentSubmission for details of which fields may be updated and who may change them. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting developer project did not create the corresponding course work, if the user is not permitted to make the requested modification to the student submission, or for access errors.
// *`INVALID_ARGUMENT` if the request is malformed.
// *`NOT_FOUND` if the requested course, course work, or student submission does not exist.
patch(
resource: Schema.StudentSubmission,
courseId: string,
courseWorkId: string,
id: string,
optionalArgs: object,
): Classroom.Schema.StudentSubmission;
// Reclaims a student submission on behalf of the student that owns it. Reclaiming a student submission transfers ownership of attached Drive files to the student and updates the submission state. Only the student that owns the requested student submission may call this method, and only for a student submission that has been turned in. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, unsubmit the requested student submission, or for access errors.
// *`FAILED_PRECONDITION` if the student submission has not been turned in.
// *`INVALID_ARGUMENT` if the request is malformed.
// *`NOT_FOUND` if the requested course, course work, or student submission does not exist.
reclaim(courseId: string, courseWorkId: string, id: string): void;
// Returns a student submission. Returning a student submission transfers ownership of attached Drive files to the student and may also update the submission state. Unlike the Classroom application, returning a student submission does not set assignedGrade to the draftGrade value. Only a teacher of the course that contains the requested student submission may call this method. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, return the requested student submission, or for access errors.
// *`INVALID_ARGUMENT` if the request is malformed.
// *`NOT_FOUND` if the requested course, course work, or student submission does not exist.
return(rcourseId: string, courseWorkId: string, id: string): void;
// Turns in a student submission. Turning in a student submission transfers ownership of attached Drive files to the teacher and may also update the submission state. This may only be called by the student that owns the specified student submission. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, turn in the requested student submission, or for access errors.
// *`INVALID_ARGUMENT` if the request is malformed.
// *`NOT_FOUND` if the requested course, course work, or student submission does not exist.
turnIn(courseId: string, courseWorkId: string, id: string): void;
}
}
interface AliasesCollection {
// Creates an alias for a course. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to create the alias or for access errors.
// *`NOT_FOUND` if the course does not exist.
// *`ALREADY_EXISTS` if the alias already exists.
// *`FAILED_PRECONDITION` if the alias requested does not make sense for the requesting user or course (for example, if a user not in a domain attempts to access a domain-scoped alias).
create(resource: Schema.CourseAlias, courseId: string): Classroom.Schema.CourseAlias;
// Returns a list of aliases for a course. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to access the course or for access errors.
// *`NOT_FOUND` if the course does not exist.
list(courseId: string): Classroom.Schema.ListCourseAliasesResponse;
// Returns a list of aliases for a course. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to access the course or for access errors.
// *`NOT_FOUND` if the course does not exist.
list(courseId: string, optionalArgs: object): Classroom.Schema.ListCourseAliasesResponse;
// Deletes an alias of a course. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to remove the alias or for access errors.
// *`NOT_FOUND` if the alias does not exist.
// *`FAILED_PRECONDITION` if the alias requested does not make sense for the requesting user or course (for example, if a user not in a domain attempts to delete a domain-scoped alias).
remove(courseId: string, alias: string): void;
}
interface AnnouncementsCollection {
// Creates an announcement. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to access the requested course, create announcements in the requested course, share a Drive attachment, or for access errors.
// *`INVALID_ARGUMENT` if the request is malformed.
// *`NOT_FOUND` if the requested course does not exist.
// *`FAILED_PRECONDITION` for the following request error: * AttachmentNotVisible
create(resource: Schema.Announcement, courseId: string): Classroom.Schema.Announcement;
// Returns an announcement. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or announcement, or for access errors.
// *`INVALID_ARGUMENT` if the request is malformed.
// *`NOT_FOUND` if the requested course or announcement does not exist.
get(courseId: string, id: string): Classroom.Schema.Announcement;
// Returns a list of announcements that the requester is permitted to view. Course students may only view `PUBLISHED` announcements. Course teachers and domain administrators may view all announcements. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for access errors.
// *`INVALID_ARGUMENT` if the request is malformed.
// *`NOT_FOUND` if the requested course does not exist.
list(courseId: string): Classroom.Schema.ListAnnouncementsResponse;
// Returns a list of announcements that the requester is permitted to view. Course students may only view `PUBLISHED` announcements. Course teachers and domain administrators may view all announcements. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for access errors.
// *`INVALID_ARGUMENT` if the request is malformed.
// *`NOT_FOUND` if the requested course does not exist.
list(courseId: string, optionalArgs: object): Classroom.Schema.ListAnnouncementsResponse;
// Modifies assignee mode and options of an announcement. Only a teacher of the course that contains the announcement may call this method. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work or for access errors.
// *`INVALID_ARGUMENT` if the request is malformed.
// *`NOT_FOUND` if the requested course or course work does not exist.
modifyAssignees(
resource: Schema.ModifyAnnouncementAssigneesRequest,
courseId: string,
id: string,
): Classroom.Schema.Announcement;
// Updates one or more fields of an announcement. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting developer project did not create the corresponding announcement or for access errors.
// *`INVALID_ARGUMENT` if the request is malformed.
// *`FAILED_PRECONDITION` if the requested announcement has already been deleted.
// *`NOT_FOUND` if the requested course or announcement does not exist
patch(resource: Schema.Announcement, courseId: string, id: string): Classroom.Schema.Announcement;
// Updates one or more fields of an announcement. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting developer project did not create the corresponding announcement or for access errors.
// *`INVALID_ARGUMENT` if the request is malformed.
// *`FAILED_PRECONDITION` if the requested announcement has already been deleted.
// *`NOT_FOUND` if the requested course or announcement does not exist
patch(
resource: Schema.Announcement,
courseId: string,
id: string,
optionalArgs: object,
): Classroom.Schema.Announcement;
// Deletes an announcement. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding announcement item. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting developer project did not create the corresponding announcement, if the requesting user is not permitted to delete the requested course or for access errors.
// *`FAILED_PRECONDITION` if the requested announcement has already been deleted.
// *`NOT_FOUND` if no course exists with the requested ID.
remove(courseId: string, id: string): void;
}
interface CourseWorkCollection {
StudentSubmissions?:
| Classroom.Collection.Courses.CourseWork.StudentSubmissionsCollection
| undefined;
// Creates course work. The resulting course work (and corresponding student submissions) are associated with the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to make the request. Classroom API requests to modify course work and student submissions must be made with an OAuth client ID from the associated Developer Console project. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to access the requested course, create course work in the requested course, share a Drive attachment, or for access errors.
// *`INVALID_ARGUMENT` if the request is malformed.
// *`NOT_FOUND` if the requested course does not exist.
// *`FAILED_PRECONDITION` for the following request error: * AttachmentNotVisible
create(resource: Schema.CourseWork, courseId: string): Classroom.Schema.CourseWork;
// Returns course work. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, or for access errors.
// *`INVALID_ARGUMENT` if the request is malformed.
// *`NOT_FOUND` if the requested course or course work does not exist.
get(courseId: string, id: string): Classroom.Schema.CourseWork;
// Returns a list of course work that the requester is permitted to view. Course students may only view `PUBLISHED` course work. Course teachers and domain administrators may view all course work. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for access errors.
// *`INVALID_ARGUMENT` if the request is malformed.
// *`NOT_FOUND` if the requested course does not exist.
list(courseId: string): Classroom.Schema.ListCourseWorkResponse;
// Returns a list of course work that the requester is permitted to view. Course students may only view `PUBLISHED` course work. Course teachers and domain administrators may view all course work. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for access errors.
// *`INVALID_ARGUMENT` if the request is malformed.
// *`NOT_FOUND` if the requested course does not exist.
list(courseId: string, optionalArgs: object): Classroom.Schema.ListCourseWorkResponse;
// Modifies assignee mode and options of a coursework. Only a teacher of the course that contains the coursework may call this method. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work or for access errors.
// *`INVALID_ARGUMENT` if the request is malformed.
// *`NOT_FOUND` if the requested course or course work does not exist.
modifyAssignees(
resource: Schema.ModifyCourseWorkAssigneesRequest,
courseId: string,
id: string,
): Classroom.Schema.CourseWork;
// Updates one or more fields of a course work. See google.classroom.v1.CourseWork for details of which fields may be updated and who may change them. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting developer project did not create the corresponding course work, if the user is not permitted to make the requested modification to the student submission, or for access errors.
// *`INVALID_ARGUMENT` if the request is malformed.
// *`FAILED_PRECONDITION` if the requested course work has already been deleted.
// *`NOT_FOUND` if the requested course, course work, or student submission does not exist.
patch(resource: Schema.CourseWork, courseId: string, id: string): Classroom.Schema.CourseWork;
// Updates one or more fields of a course work. See google.classroom.v1.CourseWork for details of which fields may be updated and who may change them. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting developer project did not create the corresponding course work, if the user is not permitted to make the requested modification to the student submission, or for access errors.
// *`INVALID_ARGUMENT` if the request is malformed.
// *`FAILED_PRECONDITION` if the requested course work has already been deleted.
// *`NOT_FOUND` if the requested course, course work, or student submission does not exist.
patch(
resource: Schema.CourseWork,
courseId: string,
id: string,
optionalArgs: object,
): Classroom.Schema.CourseWork;
// Deletes a course work. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting developer project did not create the corresponding course work, if the requesting user is not permitted to delete the requested course or for access errors.
// *`FAILED_PRECONDITION` if the requested course work has already been deleted.
// *`NOT_FOUND` if no course exists with the requested ID.
remove(courseId: string, id: string): void;
}
interface CourseWorkMaterialsCollection {
// Creates a course work material. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to access the requested course, create course work material in the requested course, share a Drive attachment, or for access errors.
// *`INVALID_ARGUMENT` if the request is malformed or if more than 20 * materials are provided.
// *`NOT_FOUND` if the requested course does not exist.
// *`FAILED_PRECONDITION` for the following request error: * AttachmentNotVisible
create(resource: Schema.CourseWorkMaterial, courseId: string): Classroom.Schema.CourseWorkMaterial;
// Returns a course work material. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work material, or for access errors.
// *`INVALID_ARGUMENT` if the request is malformed.
// *`NOT_FOUND` if the requested course or course work material does not exist.
get(courseId: string, id: string): Classroom.Schema.CourseWorkMaterial;
// Returns a list of course work material that the requester is permitted to view. Course students may only view `PUBLISHED` course work material. Course teachers and domain administrators may view all course work material. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for access errors.
// *`INVALID_ARGUMENT` if the request is malformed.
// *`NOT_FOUND` if the requested course does not exist.
list(courseId: string): Classroom.Schema.ListCourseWorkMaterialResponse;
// Returns a list of course work material that the requester is permitted to view. Course students may only view `PUBLISHED` course work material. Course teachers and domain administrators may view all course work material. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for access errors.
// *`INVALID_ARGUMENT` if the request is malformed.
// *`NOT_FOUND` if the requested course does not exist.
list(courseId: string, optionalArgs: object): Classroom.Schema.ListCourseWorkMaterialResponse;
// Updates one or more fields of a course work material. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting developer project for access errors.
// *`INVALID_ARGUMENT` if the request is malformed.
// *`FAILED_PRECONDITION` if the requested course work material has already been deleted.
// *`NOT_FOUND` if the requested course or course work material does not exist
patch(
resource: Schema.CourseWorkMaterial,
courseId: string,
id: string,
): Classroom.Schema.CourseWorkMaterial;
// Updates one or more fields of a course work material. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting developer project for access errors.
// *`INVALID_ARGUMENT` if the request is malformed.
// *`FAILED_PRECONDITION` if the requested course work material has already been deleted.
// *`NOT_FOUND` if the requested course or course work material does not exist
patch(
resource: Schema.CourseWorkMaterial,
courseId: string,
id: string,
optionalArgs: object,
): Classroom.Schema.CourseWorkMaterial;
// Deletes a course work material. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work material item. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting developer project did not create the corresponding course work material, if the requesting user is not permitted to delete the requested course or for access errors.
// *`FAILED_PRECONDITION` if the requested course work material has already been deleted.
// *`NOT_FOUND` if no course exists with the requested ID.
remove(courseId: string, id: string): void;
}
interface StudentsCollection {
// Adds a user as a student of a course. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to create students in this course or for access errors.
// *`NOT_FOUND` if the requested course ID does not exist.
// *`FAILED_PRECONDITION` if the requested user's account is disabled, for the following request errors: * CourseMemberLimitReached * CourseNotModifiable * UserGroupsMembershipLimitReached
// *`ALREADY_EXISTS` if the user is already a student or teacher in the course.
create(resource: Schema.Student, courseId: string): Classroom.Schema.Student;
// Adds a user as a student of a course. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to create students in this course or for access errors.
// *`NOT_FOUND` if the requested course ID does not exist.
// *`FAILED_PRECONDITION` if the requested user's account is disabled, for the following request errors: * CourseMemberLimitReached * CourseNotModifiable * UserGroupsMembershipLimitReached
// *`ALREADY_EXISTS` if the user is already a student or teacher in the course.
create(resource: Schema.Student, courseId: string, optionalArgs: object): Classroom.Schema.Student;
// Returns a student of a course. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to view students of this course or for access errors.
// *`NOT_FOUND` if no student of this course has the requested ID or if the course does not exist.
get(courseId: string, userId: string): Classroom.Schema.Student;
// Returns a list of students of this course that the requester is permitted to view. This method returns the following error codes:
// *`NOT_FOUND` if the course does not exist.
// *`PERMISSION_DENIED` for access errors.
list(courseId: string): Classroom.Schema.ListStudentsResponse;
// Returns a list of students of this course that the requester is permitted to view. This method returns the following error codes:
// *`NOT_FOUND` if the course does not exist.
// *`PERMISSION_DENIED` for access errors.
list(courseId: string, optionalArgs: object): Classroom.Schema.ListStudentsResponse;
// Deletes a student of a course. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to delete students of this course or for access errors.
// *`NOT_FOUND` if no student of this course has the requested ID or if the course does not exist.
remove(courseId: string, userId: string): void;
}
interface TeachersCollection {
// Creates a teacher of a course. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to create teachers in this course or for access errors.
// *`NOT_FOUND` if the requested course ID does not exist.
// *`FAILED_PRECONDITION` if the requested user's account is disabled, for the following request errors: * CourseMemberLimitReached * CourseNotModifiable * CourseTeacherLimitReached * UserGroupsMembershipLimitReached
// *`ALREADY_EXISTS` if the user is already a teacher or student in the course.
create(resource: Schema.Teacher, courseId: string): Classroom.Schema.Teacher;
// Returns a teacher of a course. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to view teachers of this course or for access errors.
// *`NOT_FOUND` if no teacher of this course has the requested ID or if the course does not exist.
get(courseId: string, userId: string): Classroom.Schema.Teacher;
// Returns a list of teachers of this course that the requester is permitted to view. This method returns the following error codes:
// *`NOT_FOUND` if the course does not exist.
// *`PERMISSION_DENIED` for access errors.
list(courseId: string): Classroom.Schema.ListTeachersResponse;
// Returns a list of teachers of this course that the requester is permitted to view. This method returns the following error codes:
// *`NOT_FOUND` if the course does not exist.
// *`PERMISSION_DENIED` for access errors.
list(courseId: string, optionalArgs: object): Classroom.Schema.ListTeachersResponse;
// Deletes a teacher of a course. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to delete teachers of this course or for access errors.
// *`NOT_FOUND` if no teacher of this course has the requested ID or if the course does not exist.
// *`FAILED_PRECONDITION` if the requested ID belongs to the primary teacher of this course.
remove(courseId: string, userId: string): void;
}
interface TopicsCollection {
// Creates a topic. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to access the requested course, create a topic in the requested course, or for access errors.
// *`INVALID_ARGUMENT` if the request is malformed.
// *`NOT_FOUND` if the requested course does not exist.
create(resource: Schema.Topic, courseId: string): Classroom.Schema.Topic;
// Returns a topic. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or topic, or for access errors.
// *`INVALID_ARGUMENT` if the request is malformed.
// *`NOT_FOUND` if the requested course or topic does not exist.
get(courseId: string, id: string): Classroom.Schema.Topic;
// Returns the list of topics that the requester is permitted to view. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for access errors.
// *`INVALID_ARGUMENT` if the request is malformed.
// *`NOT_FOUND` if the requested course does not exist.
list(courseId: string): Classroom.Schema.ListTopicResponse;
// Returns the list of topics that the requester is permitted to view. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for access errors.
// *`INVALID_ARGUMENT` if the request is malformed.
// *`NOT_FOUND` if the requested course does not exist.
list(courseId: string, optionalArgs: object): Classroom.Schema.ListTopicResponse;
// Updates one or more fields of a topic. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting developer project did not create the corresponding topic or for access errors.
// *`INVALID_ARGUMENT` if the request is malformed.
// *`NOT_FOUND` if the requested course or topic does not exist
patch(resource: Schema.Topic, courseId: string, id: string): Classroom.Schema.Topic;
// Updates one or more fields of a topic. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting developer project did not create the corresponding topic or for access errors.
// *`INVALID_ARGUMENT` if the request is malformed.
// *`NOT_FOUND` if the requested course or topic does not exist
patch(
resource: Schema.Topic,
courseId: string,
id: string,
optionalArgs: object,
): Classroom.Schema.Topic;
// Deletes a topic. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not allowed to delete the requested topic or for access errors.
// *`FAILED_PRECONDITION` if the requested topic has already been deleted.
// *`NOT_FOUND` if no course or topic exists with the requested ID.
remove(courseId: string, id: string): void;
}
}
namespace UserProfiles {
interface GuardianInvitationsCollection {
// Creates a guardian invitation, and sends an email to the guardian asking them to confirm that they are the student's guardian. Once the guardian accepts the invitation, their `state` will change to `COMPLETED` and they will start receiving guardian notifications. A `Guardian` resource will also be created to represent the active guardian. The request object must have the `student_id` and `invited_email_address` fields set. Failing to set these fields, or setting any other fields in the request, will result in an error. This method returns the following error codes:
// *`PERMISSION_DENIED` if the current user does not have permission to manage guardians, if the guardian in question has already rejected too many requests for that student, if guardians are not enabled for the domain in question, or for other access errors.
// *`RESOURCE_EXHAUSTED` if the student or guardian has exceeded the guardian link limit.
// *`INVALID_ARGUMENT` if the guardian email address is not valid (for example, if it is too long), or if the format of the student ID provided cannot be recognized (it is not an email address, nor a `user_id` from this API). This error will also be returned if read-only fields are set, or if the `state` field is set to to a value other than `PENDING`.
// *`NOT_FOUND` if the student ID provided is a valid student ID, but Classroom has no record of that student.
// *`ALREADY_EXISTS` if there is already a pending guardian invitation for the student and `invited_email_address` provided, or if the provided `invited_email_address` matches the Google account of an existing `Guardian` for this user.
create(resource: Schema.GuardianInvitation, studentId: string): Classroom.Schema.GuardianInvitation;
// Returns a specific guardian invitation. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to view guardian invitations for the student identified by the `student_id`, if guardians are not enabled for the domain in question, or for other access errors.
// *`INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot be recognized (it is not an email address, nor a `student_id` from the API, nor the literal string `me`).
// *`NOT_FOUND` if Classroom cannot find any record of the given student or `invitation_id`. May also be returned if the student exists, but the requesting user does not have access to see that student.
get(studentId: string, invitationId: string): Classroom.Schema.GuardianInvitation;
// Returns a list of guardian invitations that the requesting user is permitted to view, filtered by the parameters provided. This method returns the following error codes:
// *`PERMISSION_DENIED` if a `student_id` is specified, and the requesting user is not permitted to view guardian invitations for that student, if `"-"` is specified as the `student_id` and the user is not a domain administrator, if guardians are not enabled for the domain in question, or for other access errors.
// *`INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot be recognized (it is not an email address, nor a `student_id` from the API, nor the literal string `me`). May also be returned if an invalid `page_token` or `state` is provided.
// *`NOT_FOUND` if a `student_id` is specified, and its format can be recognized, but Classroom has no record of that student.
list(studentId: string): Classroom.Schema.ListGuardianInvitationsResponse;
// Returns a list of guardian invitations that the requesting user is permitted to view, filtered by the parameters provided. This method returns the following error codes:
// *`PERMISSION_DENIED` if a `student_id` is specified, and the requesting user is not permitted to view guardian invitations for that student, if `"-"` is specified as the `student_id` and the user is not a domain administrator, if guardians are not enabled for the domain in question, or for other access errors.
// *`INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot be recognized (it is not an email address, nor a `student_id` from the API, nor the literal string `me`). May also be returned if an invalid `page_token` or `state` is provided.
// *`NOT_FOUND` if a `student_id` is specified, and its format can be recognized, but Classroom has no record of that student.
list(studentId: string, optionalArgs: object): Classroom.Schema.ListGuardianInvitationsResponse;
// Modifies a guardian invitation. Currently, the only valid modification is to change the `state` from `PENDING` to `COMPLETE`. This has the effect of withdrawing the invitation. This method returns the following error codes:
// *`PERMISSION_DENIED` if the current user does not have permission to manage guardians, if guardians are not enabled for the domain in question or for other access errors.
// *`FAILED_PRECONDITION` if the guardian link is not in the `PENDING` state.
// *`INVALID_ARGUMENT` if the format of the student ID provided cannot be recognized (it is not an email address, nor a `user_id` from this API), or if the passed `GuardianInvitation` has a `state` other than `COMPLETE`, or if it modifies fields other than `state`.
// *`NOT_FOUND` if the student ID provided is a valid student ID, but Classroom has no record of that student, or if the `id` field does not refer to a guardian invitation known to Classroom.
patch(
resource: Schema.GuardianInvitation,
studentId: string,
invitationId: string,
): Classroom.Schema.GuardianInvitation;
// Modifies a guardian invitation. Currently, the only valid modification is to change the `state` from `PENDING` to `COMPLETE`. This has the effect of withdrawing the invitation. This method returns the following error codes:
// *`PERMISSION_DENIED` if the current user does not have permission to manage guardians, if guardians are not enabled for the domain in question or for other access errors.
// *`FAILED_PRECONDITION` if the guardian link is not in the `PENDING` state.
// *`INVALID_ARGUMENT` if the format of the student ID provided cannot be recognized (it is not an email address, nor a `user_id` from this API), or if the passed `GuardianInvitation` has a `state` other than `COMPLETE`, or if it modifies fields other than `state`.
// *`NOT_FOUND` if the student ID provided is a valid student ID, but Classroom has no record of that student, or if the `id` field does not refer to a guardian invitation known to Classroom.
patch(
resource: Schema.GuardianInvitation,
studentId: string,
invitationId: string,
optionalArgs: object,
): Classroom.Schema.GuardianInvitation;
}
interface GuardiansCollection {
// Returns a specific guardian. This method returns the following error codes:
// *`PERMISSION_DENIED` if no user that matches the provided `student_id` is visible to the requesting user, if the requesting user is not permitted to view guardian information for the student identified by the `student_id`, if guardians are not enabled for the domain in question, or for other access errors.
// *`INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot be recognized (it is not an email address, nor a `student_id` from the API, nor the literal string `me`).
// *`NOT_FOUND` if the requesting user is permitted to view guardians for the requested `student_id`, but no `Guardian` record exists for that student that matches the provided `guardian_id`.
get(studentId: string, guardianId: string): Classroom.Schema.Guardian;
// Returns a list of guardians that the requesting user is permitted to view, restricted to those that match the request. To list guardians for any student that the requesting user may view guardians for, use the literal character `-` for the student ID. This method returns the following error codes:
// *`PERMISSION_DENIED` if a `student_id` is specified, and the requesting user is not permitted to view guardian information for that student, if `"-"` is specified as the `student_id` and the user is not a domain administrator, if guardians are not enabled for the domain in question, if the `invited_email_address` filter is set by a user who is not a domain administrator, or for other access errors.
// *`INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot be recognized (it is not an email address, nor a `student_id` from the API, nor the literal string `me`). May also be returned if an invalid `page_token` is provided.
// *`NOT_FOUND` if a `student_id` is specified, and its format can be recognized, but Classroom has no record of that student.
list(studentId: string): Classroom.Schema.ListGuardiansResponse;
// Returns a list of guardians that the requesting user is permitted to view, restricted to those that match the request. To list guardians for any student that the requesting user may view guardians for, use the literal character `-` for the student ID. This method returns the following error codes:
// *`PERMISSION_DENIED` if a `student_id` is specified, and the requesting user is not permitted to view guardian information for that student, if `"-"` is specified as the `student_id` and the user is not a domain administrator, if guardians are not enabled for the domain in question, if the `invited_email_address` filter is set by a user who is not a domain administrator, or for other access errors.
// *`INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot be recognized (it is not an email address, nor a `student_id` from the API, nor the literal string `me`). May also be returned if an invalid `page_token` is provided.
// *`NOT_FOUND` if a `student_id` is specified, and its format can be recognized, but Classroom has no record of that student.
list(studentId: string, optionalArgs: object): Classroom.Schema.ListGuardiansResponse;
// Deletes a guardian. The guardian will no longer receive guardian notifications and the guardian will no longer be accessible via the API. This method returns the following error codes:
// *`PERMISSION_DENIED` if no user that matches the provided `student_id` is visible to the requesting user, if the requesting user is not permitted to manage guardians for the student identified by the `student_id`, if guardians are not enabled for the domain in question, or for other access errors.
// *`INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot be recognized (it is not an email address, nor a `student_id` from the API).
// *`NOT_FOUND` if the requesting user is permitted to modify guardians for the requested `student_id`, but no `Guardian` record exists for that student with the provided `guardian_id`.
remove(studentId: string, guardianId: string): void;
}
}
interface CoursesCollection {
Aliases?: Classroom.Collection.Courses.AliasesCollection | undefined;
Announcements?: Classroom.Collection.Courses.AnnouncementsCollection | undefined;
CourseWork?: Classroom.Collection.Courses.CourseWorkCollection | undefined;
CourseWorkMaterials?: Classroom.Collection.Courses.CourseWorkMaterialsCollection | undefined;
Students?: Classroom.Collection.Courses.StudentsCollection | undefined;
Teachers?: Classroom.Collection.Courses.TeachersCollection | undefined;
Topics?: Classroom.Collection.Courses.TopicsCollection | undefined;
// Creates a course. The user specified in `ownerId` is the owner of the created course and added as a teacher. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to create courses or for access errors.
// *`NOT_FOUND` if the primary teacher is not a valid user.
// *`FAILED_PRECONDITION` if the course owner's account is disabled or for the following request errors: * UserGroupsMembershipLimitReached
// *`ALREADY_EXISTS` if an alias was specified in the `id` and already exists.
create(resource: Schema.Course): Classroom.Schema.Course;
// Returns a course. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for access errors.
// *`NOT_FOUND` if no course exists with the requested ID.
get(id: string): Classroom.Schema.Course;
// Returns a list of courses that the requesting user is permitted to view, restricted to those that match the request. Returned courses are ordered by creation time, with the most recently created coming first. This method returns the following error codes:
// *`PERMISSION_DENIED` for access errors.
// *`INVALID_ARGUMENT` if the query argument is malformed.
// *`NOT_FOUND` if any users specified in the query arguments do not exist.
list(): Classroom.Schema.ListCoursesResponse;
// Returns a list of courses that the requesting user is permitted to view, restricted to those that match the request. Returned courses are ordered by creation time, with the most recently created coming first. This method returns the following error codes:
// *`PERMISSION_DENIED` for access errors.
// *`INVALID_ARGUMENT` if the query argument is malformed.
// *`NOT_FOUND` if any users specified in the query arguments do not exist.
list(optionalArgs: object): Classroom.Schema.ListCoursesResponse;
// Updates one or more fields in a course. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to modify the requested course or for access errors.
// *`NOT_FOUND` if no course exists with the requested ID.
// *`INVALID_ARGUMENT` if invalid fields are specified in the update mask or if no update mask is supplied.
// *`FAILED_PRECONDITION` for the following request errors: * CourseNotModifiable
patch(resource: Schema.Course, id: string): Classroom.Schema.Course;
// Updates one or more fields in a course. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to modify the requested course or for access errors.
// *`NOT_FOUND` if no course exists with the requested ID.
// *`INVALID_ARGUMENT` if invalid fields are specified in the update mask or if no update mask is supplied.
// *`FAILED_PRECONDITION` for the following request errors: * CourseNotModifiable
patch(resource: Schema.Course, id: string, optionalArgs: object): Classroom.Schema.Course;
// Deletes a course. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to delete the requested course or for access errors.
// *`NOT_FOUND` if no course exists with the requested ID.
remove(id: string): void;
// Updates a course. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to modify the requested course or for access errors.
// *`NOT_FOUND` if no course exists with the requested ID.
// *`FAILED_PRECONDITION` for the following request errors: * CourseNotModifiable
update(resource: Schema.Course, id: string): Classroom.Schema.Course;
}
interface InvitationsCollection {
// Accepts an invitation, removing it and adding the invited user to the teachers or students (as appropriate) of the specified course. Only the invited user may accept an invitation. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to accept the requested invitation or for access errors.
// *`FAILED_PRECONDITION` for the following request errors: * CourseMemberLimitReached * CourseNotModifiable * CourseTeacherLimitReached * UserGroupsMembershipLimitReached
// *`NOT_FOUND` if no invitation exists with the requested ID.
accept(id: string): void;
// Creates an invitation. Only one invitation for a user and course may exist at a time. Delete and re-create an invitation to make changes. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to create invitations for this course or for access errors.
// *`NOT_FOUND` if the course or the user does not exist.
// *`FAILED_PRECONDITION` if the requested user's account is disabled or if the user already has this role or a role with greater permissions.
// *`ALREADY_EXISTS` if an invitation for the specified user and course already exists.
create(resource: Schema.Invitation): Classroom.Schema.Invitation;
// Returns an invitation. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to view the requested invitation or for access errors.
// *`NOT_FOUND` if no invitation exists with the requested ID.
get(id: string): Classroom.Schema.Invitation;
// Returns a list of invitations that the requesting user is permitted to view, restricted to those that match the list request. *Note:* At least one of `user_id` or `course_id` must be supplied. Both fields can be supplied. This method returns the following error codes:
// *`PERMISSION_DENIED` for access errors.
list(): Classroom.Schema.ListInvitationsResponse;
// Returns a list of invitations that the requesting user is permitted to view, restricted to those that match the list request. *Note:* At least one of `user_id` or `course_id` must be supplied. Both fields can be supplied. This method returns the following error codes:
// *`PERMISSION_DENIED` for access errors.
list(optionalArgs: object): Classroom.Schema.ListInvitationsResponse;
// Deletes an invitation. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to delete the requested invitation or for access errors.
// *`NOT_FOUND` if no invitation exists with the requested ID.
remove(id: string): void;
}
interface RegistrationsCollection {
// Creates a `Registration`, causing Classroom to start sending notifications from the provided `feed` to the destination provided in `cloudPubSubTopic`. Returns the created `Registration`. Currently, this will be the same as the argument, but with server-assigned fields such as `expiry_time` and `id` filled in. Note that any value specified for the `expiry_time` or `id` fields will be ignored. While Classroom may validate the `cloudPubSubTopic` and return errors on a best effort basis, it is the caller's responsibility to ensure that it exists and that Classroom has permission to publish to it. This method may return the following error codes:
// *`PERMISSION_DENIED` if: * the authenticated user does not have permission to receive notifications from the requested field; or * the current user has not granted access to the current Cloud project with the appropriate scope for the requested feed. Note that domain-wide delegation of authority is not currently supported for this purpose. If the request has the appropriate scope, but no grant exists, a Request Errors is returned. * another access error is encountered.
// *`INVALID_ARGUMENT` if: * no `cloudPubsubTopic` is specified, or the specified `cloudPubsubTopic` is not valid; or * no `feed` is specified, or the specified `feed` is not valid.
// *`NOT_FOUND` if: * the specified `feed` cannot be located, or the requesting user does not have permission to determine whether or not it exists; or * the specified `cloudPubsubTopic` cannot be located, or Classroom has not been granted permission to publish to it.
create(resource: Schema.Registration): Classroom.Schema.Registration;
// Deletes a `Registration`, causing Classroom to stop sending notifications for that `Registration`.
remove(registrationId: string): void;
}
interface UserProfilesCollection {
GuardianInvitations?: Classroom.Collection.UserProfiles.GuardianInvitationsCollection | undefined;
Guardians?: Classroom.Collection.UserProfiles.GuardiansCollection | undefined;
// Returns a user profile. This method returns the following error codes:
// *`PERMISSION_DENIED` if the requesting user is not permitted to access this user profile, if no profile exists with the requested ID, or for access errors.
get(userId: string): Classroom.Schema.UserProfile;
}
}
namespace Schema {
interface Announcement {
alternateLink?: string | undefined;
assigneeMode?: string | undefined;
courseId?: string | undefined;
creationTime?: string | undefined;
creatorUserId?: string | undefined;
id?: string | undefined;
individualStudentsOptions?: Classroom.Schema.IndividualStudentsOptions | undefined;
materials?: Classroom.Schema.Material[] | undefined;
scheduledTime?: string | undefined;
state?: string | undefined;
text?: string | undefined;
updateTime?: string | undefined;
}
interface Assignment {
studentWorkFolder?: Classroom.Schema.DriveFolder | undefined;
}
interface AssignmentSubmission {
attachments?: Classroom.Schema.Attachment[] | undefined;
}
interface Attachment {
driveFile?: Classroom.Schema.DriveFile | undefined;
form?: Classroom.Schema.Form | undefined;
link?: Classroom.Schema.Link | undefined;
youTubeVideo?: Classroom.Schema.YouTubeVideo | undefined;
}
interface CloudPubsubTopic {
topicName?: string | undefined;
}
interface Course {
alternateLink?: string | undefined;
calendarId?: string | undefined;
courseGroupEmail?: string | undefined;
courseMaterialSets?: Classroom.Schema.CourseMaterialSet[] | undefined;
courseState?: string | undefined;
creationTime?: string | undefined;
description?: string | undefined;
descriptionHeading?: string | undefined;
enrollmentCode?: string | undefined;
guardiansEnabled?: boolean | undefined;
id?: string | undefined;
name?: string | undefined;
ownerId?: string | undefined;
room?: string | undefined;
section?: string | undefined;
teacherFolder?: Classroom.Schema.DriveFolder | undefined;
teacherGroupEmail?: string | undefined;
updateTime?: string | undefined;
}
interface CourseAlias {
alias?: string | undefined;
}
interface CourseMaterial {
driveFile?: Classroom.Schema.DriveFile | undefined;
form?: Classroom.Schema.Form | undefined;
link?: Classroom.Schema.Link | undefined;
youTubeVideo?: Classroom.Schema.YouTubeVideo | undefined;
}
interface CourseMaterialSet {
materials?: Classroom.Schema.CourseMaterial[] | undefined;
title?: string | undefined;
}
interface CourseRosterChangesInfo {
courseId?: string | undefined;
}
interface CourseWork {
alternateLink?: string | undefined;
assigneeMode?: string | undefined;
assignment?: Classroom.Schema.Assignment | undefined;
associatedWithDeveloper?: boolean | undefined;
courseId?: string | undefined;
creationTime?: string | undefined;
creatorUserId?: string | undefined;
description?: string | undefined;
dueDate?: Classroom.Schema.Date | undefined;
dueTime?: Classroom.Schema.TimeOfDay | undefined;
id?: string | undefined;
individualStudentsOptions?: Classroom.Schema.IndividualStudentsOptions | undefined;
materials?: Classroom.Schema.Material[] | undefined;
maxPoints?: number | undefined;
multipleChoiceQuestion?: Classroom.Schema.MultipleChoiceQuestion | undefined;
scheduledTime?: string | undefined;
state?: string | undefined;
submissionModificationMode?: string | undefined;
title?: string | undefined;
topicId?: string | undefined;
updateTime?: string | undefined;
workType?: string | undefined;
}
interface CourseWorkChangesInfo {
courseId?: string | undefined;
}
interface CourseWorkMaterial {
alternateLink?: string | undefined;
assigneeMode?: string | undefined;
courseId?: string | undefined;
creationTime?: string | undefined;
creatorUserId?: string | undefined;
description?: string | undefined;
id?: string | undefined;
individualStudentsOptions?: Classroom.Schema.IndividualStudentsOptions | undefined;
materials?: Classroom.Schema.Material[] | undefined;
scheduledTime?: string | undefined;
state?: string | undefined;
title?: string | undefined;
topicId?: string | undefined;
updateTime?: string | undefined;
}
interface Date {
day?: number | undefined;
month?: number | undefined;
year?: number | undefined;
}
interface DriveFile {
alternateLink?: string | undefined;
id?: string | undefined;
thumbnailUrl?: string | undefined;
title?: string | undefined;
}
interface DriveFolder {
alternateLink?: string | undefined;
id?: string | undefined;
title?: string | undefined;
}
interface Feed {
courseRosterChangesInfo?: Classroom.Schema.CourseRosterChangesInfo | undefined;
courseWorkChangesInfo?: Classroom.Schema.CourseWorkChangesInfo | undefined;
feedType?: string | undefined;
}
interface Form {
formUrl?: string | undefined;
responseUrl?: string | undefined;
thumbnailUrl?: string | undefined;
title?: string | undefined;
}
interface GlobalPermission {
permission?: string | undefined;
}
interface GradeHistory {
actorUserId?: string | undefined;
gradeChangeType?: string | undefined;
gradeTimestamp?: string | undefined;
maxPoints?: number | undefined;
pointsEarned?: number | undefined;
}
interface Guardian {
guardianId?: string | undefined;
guardianProfile?: Classroom.Schema.UserProfile | undefined;
invitedEmailAddress?: string | undefined;
studentId?: string | undefined;
}
interface GuardianInvitation {
creationTime?: string | undefined;
invitationId?: string | undefined;
invitedEmailAddress?: string | undefined;
state?: string | undefined;
studentId?: string | undefined;
}
interface IndividualStudentsOptions {
studentIds?: string[] | undefined;
}
interface Invitation {
courseId?: string | undefined;
id?: string | undefined;
role?: string | undefined;
userId?: string | undefined;
}
interface Link {
thumbnailUrl?: string | undefined;
title?: string | undefined;
url?: string | undefined;
}
interface ListAnnouncementsResponse {
announcements?: Classroom.Schema.Announcement[] | undefined;
nextPageToken?: string | undefined;
}
interface ListCourseAliasesResponse {
aliases?: Classroom.Schema.CourseAlias[] | undefined;
nextPageToken?: string | undefined;
}
interface ListCourseWorkMaterialResponse {
courseWorkMaterial?: Classroom.Schema.CourseWorkMaterial[] | undefined;
nextPageToken?: string | undefined;
}
interface ListCourseWorkResponse {
courseWork?: Classroom.Schema.CourseWork[] | undefined;
nextPageToken?: string | undefined;
}
interface ListCoursesResponse {
courses?: Classroom.Schema.Course[] | undefined;
nextPageToken?: string | undefined;
}
interface ListGuardianInvitationsResponse {
guardianInvitations?: Classroom.Schema.GuardianInvitation[] | undefined;
nextPageToken?: string | undefined;
}
interface ListGuardiansResponse {
guardians?: Classroom.Schema.Guardian[] | undefined;
nextPageToken?: string | undefined;
}
interface ListInvitationsResponse {
invitations?: Classroom.Schema.Invitation[] | undefined;
nextPageToken?: string | undefined;
}
interface ListStudentSubmissionsResponse {
nextPageToken?: string | undefined;
studentSubmissions?: Classroom.Schema.StudentSubmission[] | undefined;
}
interface ListStudentsResponse {
nextPageToken?: string | undefined;
students?: Classroom.Schema.Student[] | undefined;
}
interface ListTeachersResponse {
nextPageToken?: string | undefined;
teachers?: Classroom.Schema.Teacher[] | undefined;
}
interface ListTopicResponse {
nextPageToken?: string | undefined;
topic?: Classroom.Schema.Topic[] | undefined;
}
interface Material {
driveFile?: Classroom.Schema.SharedDriveFile | undefined;
form?: Classroom.Schema.Form | undefined;
link?: Classroom.Schema.Link | undefined;
youtubeVideo?: Classroom.Schema.YouTubeVideo | undefined;
}
interface ModifyAnnouncementAssigneesRequest {
assigneeMode?: string | undefined;
modifyIndividualStudentsOptions?: Classroom.Schema.ModifyIndividualStudentsOptions | undefined;
}
interface ModifyAttachmentsRequest {
addAttachments?: Classroom.Schema.Attachment[] | undefined;
}
interface ModifyCourseWorkAssigneesRequest {
assigneeMode?: string | undefined;
modifyIndividualStudentsOptions?: Classroom.Schema.ModifyIndividualStudentsOptions | undefined;
}
interface ModifyIndividualStudentsOptions {
addStudentIds?: string[] | undefined;
removeStudentIds?: string[] | undefined;
}
interface MultipleChoiceQuestion {
choices?: string[] | undefined;
}
interface MultipleChoiceSubmission {
answer?: string | undefined;
}
interface Name {
familyName?: string | undefined;
fullName?: string | undefined;
givenName?: string | undefined;
}
interface Registration {
cloudPubsubTopic?: Classroom.Schema.CloudPubsubTopic | undefined;
expiryTime?: string | undefined;
feed?: Classroom.Schema.Feed | undefined;
registrationId?: string | undefined;
}
interface SharedDriveFile {
driveFile?: Classroom.Schema.DriveFile | undefined;
shareMode?: string | undefined;
}
interface ShortAnswerSubmission {
answer?: string | undefined;
}
interface StateHistory {
actorUserId?: string | undefined;
state?: string | undefined;
stateTimestamp?: string | undefined;
}
interface Student {
courseId?: string | undefined;
profile?: Classroom.Schema.UserProfile | undefined;
studentWorkFolder?: Classroom.Schema.DriveFolder | undefined;
userId?: string | undefined;
}
interface StudentSubmission {
alternateLink?: string | undefined;
assignedGrade?: number | undefined;
assignmentSubmission?: Classroom.Schema.AssignmentSubmission | undefined;
associatedWithDeveloper?: boolean | undefined;
courseId?: string | undefined;
courseWorkId?: string | undefined;
courseWorkType?: string | undefined;
creationTime?: string | undefined;
draftGrade?: number | undefined;
id?: string | undefined;
late?: boolean | undefined;
multipleChoiceSubmission?: Classroom.Schema.MultipleChoiceSubmission | undefined;
shortAnswerSubmission?: Classroom.Schema.ShortAnswerSubmission | undefined;
state?: string | undefined;
submissionHistory?: Classroom.Schema.SubmissionHistory[] | undefined;
updateTime?: string | undefined;
userId?: string | undefined;
}
interface SubmissionHistory {
gradeHistory?: Classroom.Schema.GradeHistory | undefined;
stateHistory?: Classroom.Schema.StateHistory | undefined;
}
interface Teacher {
courseId?: string | undefined;
profile?: Classroom.Schema.UserProfile | undefined;
userId?: string | undefined;
}
interface TimeOfDay {
hours?: number | undefined;
minutes?: number | undefined;
nanos?: number | undefined;
seconds?: number | undefined;
}
interface Topic {
courseId?: string | undefined;
name?: string | undefined;
topicId?: string | undefined;
updateTime?: string | undefined;
}
interface UserProfile {
emailAddress?: string | undefined;
id?: string | undefined;
name?: Classroom.Schema.Name | undefined;
permissions?: Classroom.Schema.GlobalPermission[] | undefined;
photoUrl?: string | undefined;
verifiedTeacher?: boolean | undefined;
}
interface YouTubeVideo {
alternateLink?: string | undefined;
id?: string | undefined;
thumbnailUrl?: string | undefined;
title?: string | undefined;
}
}
}
interface Classroom {
Courses?: Classroom.Collection.CoursesCollection | undefined;
Invitations?: Classroom.Collection.InvitationsCollection | undefined;
Registrations?: Classroom.Collection.RegistrationsCollection | undefined;
UserProfiles?: Classroom.Collection.UserProfilesCollection | undefined;
// Create a new instance of Announcement
newAnnouncement(): Classroom.Schema.Announcement;
// Create a new instance of Assignment
newAssignment(): Classroom.Schema.Assignment;
// Create a new instance of AssignmentSubmission
newAssignmentSubmission(): Classroom.Schema.AssignmentSubmission;
// Create a new instance of Attachment
newAttachment(): Classroom.Schema.Attachment;
// Create a new instance of CloudPubsubTopic
newCloudPubsubTopic(): Classroom.Schema.CloudPubsubTopic;
// Create a new instance of Course
newCourse(): Classroom.Schema.Course;
// Create a new instance of CourseAlias
newCourseAlias(): Classroom.Schema.CourseAlias;
// Create a new instance of CourseMaterial
newCourseMaterial(): Classroom.Schema.CourseMaterial;
// Create a new instance of CourseMaterialSet
newCourseMaterialSet(): Classroom.Schema.CourseMaterialSet;
// Create a new instance of CourseRosterChangesInfo
newCourseRosterChangesInfo(): Classroom.Schema.CourseRosterChangesInfo;
// Create a new instance of CourseWork
newCourseWork(): Classroom.Schema.CourseWork;
// Create a new instance of CourseWorkChangesInfo
newCourseWorkChangesInfo(): Classroom.Schema.CourseWorkChangesInfo;
// Create a new instance of CourseWorkMaterial
newCourseWorkMaterial(): Classroom.Schema.CourseWorkMaterial;
// Create a new instance of Date
newDate(): Classroom.Schema.Date;
// Create a new instance of DriveFile
newDriveFile(): Classroom.Schema.DriveFile;
// Create a new instance of DriveFolder
newDriveFolder(): Classroom.Schema.DriveFolder;
// Create a new instance of Feed
newFeed(): Classroom.Schema.Feed;
// Create a new instance of Form
newForm(): Classroom.Schema.Form;
// Create a new instance of GlobalPermission
newGlobalPermission(): Classroom.Schema.GlobalPermission;
// Create a new instance of GradeHistory
newGradeHistory(): Classroom.Schema.GradeHistory;
// Create a new instance of GuardianInvitation
newGuardianInvitation(): Classroom.Schema.GuardianInvitation;
// Create a new instance of IndividualStudentsOptions
newIndividualStudentsOptions(): Classroom.Schema.IndividualStudentsOptions;
// Create a new instance of Invitation
newInvitation(): Classroom.Schema.Invitation;
// Create a new instance of Link
newLink(): Classroom.Schema.Link;
// Create a new instance of Material
newMaterial(): Classroom.Schema.Material;
// Create a new instance of ModifyAnnouncementAssigneesRequest
newModifyAnnouncementAssigneesRequest(): Classroom.Schema.ModifyAnnouncementAssigneesRequest;
// Create a new instance of ModifyAttachmentsRequest
newModifyAttachmentsRequest(): Classroom.Schema.ModifyAttachmentsRequest;
// Create a new instance of ModifyCourseWorkAssigneesRequest
newModifyCourseWorkAssigneesRequest(): Classroom.Schema.ModifyCourseWorkAssigneesRequest;
// Create a new instance of ModifyIndividualStudentsOptions
newModifyIndividualStudentsOptions(): Classroom.Schema.ModifyIndividualStudentsOptions;
// Create a new instance of MultipleChoiceQuestion
newMultipleChoiceQuestion(): Classroom.Schema.MultipleChoiceQuestion;
// Create a new instance of MultipleChoiceSubmission
newMultipleChoiceSubmission(): Classroom.Schema.MultipleChoiceSubmission;
// Create a new instance of Name
newName(): Classroom.Schema.Name;
// Create a new instance of Registration
newRegistration(): Classroom.Schema.Registration;
// Create a new instance of SharedDriveFile
newSharedDriveFile(): Classroom.Schema.SharedDriveFile;
// Create a new instance of ShortAnswerSubmission
newShortAnswerSubmission(): Classroom.Schema.ShortAnswerSubmission;
// Create a new instance of StateHistory
newStateHistory(): Classroom.Schema.StateHistory;
// Create a new instance of Student
newStudent(): Classroom.Schema.Student;
// Create a new instance of StudentSubmission
newStudentSubmission(): Classroom.Schema.StudentSubmission;
// Create a new instance of SubmissionHistory
newSubmissionHistory(): Classroom.Schema.SubmissionHistory;
// Create a new instance of Teacher
newTeacher(): Classroom.Schema.Teacher;
// Create a new instance of TimeOfDay
newTimeOfDay(): Classroom.Schema.TimeOfDay;
// Create a new instance of Topic
newTopic(): Classroom.Schema.Topic;
// Create a new instance of UserProfile
newUserProfile(): Classroom.Schema.UserProfile;
// Create a new instance of YouTubeVideo
newYouTubeVideo(): Classroom.Schema.YouTubeVideo;
}
}
declare var Classroom: GoogleAppsScript.Classroom;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,909 @@
declare namespace GoogleAppsScript {
namespace Docs {
namespace Collection {
interface DocumentsCollection {
// Applies one or more updates to the document.
// Each request is validated before
// being applied. If any request is not valid, then the entire request will
// fail and nothing will be applied.
// Some requests have replies to
// give you some information about how they are applied. Other requests do
// not need to return information; these each return an empty reply.
// The order of replies matches that of the requests.
// For example, suppose you call batchUpdate with four updates, and only the
// third one returns information. The response would have two empty replies,
// the reply to the third request, and another empty reply, in that order.
// Because other users may be editing the document, the document
// might not exactly reflect your changes: your changes may
// be altered with respect to collaborator changes. If there are no
// collaborators, the document should reflect your changes. In any case,
// the updates in your request are guaranteed to be applied together
// atomically.
batchUpdate(
resource: Schema.BatchUpdateDocumentRequest,
documentId: string,
): Docs.Schema.BatchUpdateDocumentResponse;
// Creates a blank document using the title given in the request. Other fields
// in the request, including any provided content, are ignored.
// Returns the created document.
create(resource: Schema.Document): Docs.Schema.Document;
// Gets the latest version of the specified document.
get(documentId: string): Docs.Schema.Document;
// Gets the latest version of the specified document.
get(documentId: string, optionalArgs: object): Docs.Schema.Document;
}
}
namespace Schema {
interface AutoText {
suggestedDeletionIds?: string[] | undefined;
suggestedInsertionIds?: string[] | undefined;
suggestedTextStyleChanges?: object | undefined;
textStyle?: Docs.Schema.TextStyle | undefined;
type?: string | undefined;
}
interface Background {
color?: Docs.Schema.OptionalColor | undefined;
}
interface BackgroundSuggestionState {
backgroundColorSuggested?: boolean | undefined;
}
interface BatchUpdateDocumentRequest {
requests?: Docs.Schema.Request[] | undefined;
writeControl?: Docs.Schema.WriteControl | undefined;
}
interface BatchUpdateDocumentResponse {
documentId?: string | undefined;
replies?: Docs.Schema.Response[] | undefined;
writeControl?: Docs.Schema.WriteControl | undefined;
}
interface Body {
content?: Docs.Schema.StructuralElement[] | undefined;
}
interface Bullet {
listId?: string | undefined;
nestingLevel?: number | undefined;
textStyle?: Docs.Schema.TextStyle | undefined;
}
interface BulletSuggestionState {
listIdSuggested?: boolean | undefined;
nestingLevelSuggested?: boolean | undefined;
textStyleSuggestionState?: Docs.Schema.TextStyleSuggestionState | undefined;
}
interface Color {
rgbColor?: Docs.Schema.RgbColor | undefined;
}
interface ColumnBreak {
suggestedDeletionIds?: string[] | undefined;
suggestedInsertionIds?: string[] | undefined;
suggestedTextStyleChanges?: object | undefined;
textStyle?: Docs.Schema.TextStyle | undefined;
}
interface CreateNamedRangeRequest {
name?: string | undefined;
range?: Docs.Schema.Range | undefined;
}
interface CreateNamedRangeResponse {
namedRangeId?: string | undefined;
}
interface CreateParagraphBulletsRequest {
bulletPreset?: string | undefined;
range?: Docs.Schema.Range | undefined;
}
interface CropProperties {
angle?: number | undefined;
offsetBottom?: number | undefined;
offsetLeft?: number | undefined;
offsetRight?: number | undefined;
offsetTop?: number | undefined;
}
interface CropPropertiesSuggestionState {
angleSuggested?: boolean | undefined;
offsetBottomSuggested?: boolean | undefined;
offsetLeftSuggested?: boolean | undefined;
offsetRightSuggested?: boolean | undefined;
offsetTopSuggested?: boolean | undefined;
}
interface DeleteContentRangeRequest {
range?: Docs.Schema.Range | undefined;
}
interface DeleteNamedRangeRequest {
name?: string | undefined;
namedRangeId?: string | undefined;
}
interface DeleteParagraphBulletsRequest {
range?: Docs.Schema.Range | undefined;
}
interface DeletePositionedObjectRequest {
objectId?: string | undefined;
}
interface DeleteTableColumnRequest {
tableCellLocation?: Docs.Schema.TableCellLocation | undefined;
}
interface DeleteTableRowRequest {
tableCellLocation?: Docs.Schema.TableCellLocation | undefined;
}
interface Dimension {
magnitude?: number | undefined;
unit?: string | undefined;
}
interface Document {
body?: Docs.Schema.Body | undefined;
documentId?: string | undefined;
documentStyle?: Docs.Schema.DocumentStyle | undefined;
footers?: object | undefined;
footnotes?: object | undefined;
headers?: object | undefined;
inlineObjects?: object | undefined;
lists?: object | undefined;
namedRanges?: object | undefined;
namedStyles?: Docs.Schema.NamedStyles | undefined;
positionedObjects?: object | undefined;
revisionId?: string | undefined;
suggestedDocumentStyleChanges?: object | undefined;
suggestedNamedStylesChanges?: object | undefined;
suggestionsViewMode?: string | undefined;
title?: string | undefined;
}
interface DocumentStyle {
background?: Docs.Schema.Background | undefined;
defaultFooterId?: string | undefined;
defaultHeaderId?: string | undefined;
evenPageFooterId?: string | undefined;
evenPageHeaderId?: string | undefined;
firstPageFooterId?: string | undefined;
firstPageHeaderId?: string | undefined;
marginBottom?: Docs.Schema.Dimension | undefined;
marginLeft?: Docs.Schema.Dimension | undefined;
marginRight?: Docs.Schema.Dimension | undefined;
marginTop?: Docs.Schema.Dimension | undefined;
pageNumberStart?: number | undefined;
pageSize?: Docs.Schema.Size | undefined;
useEvenPageHeaderFooter?: boolean | undefined;
useFirstPageHeaderFooter?: boolean | undefined;
}
interface DocumentStyleSuggestionState {
backgroundSuggestionState?: Docs.Schema.BackgroundSuggestionState | undefined;
defaultFooterIdSuggested?: boolean | undefined;
defaultHeaderIdSuggested?: boolean | undefined;
evenPageFooterIdSuggested?: boolean | undefined;
evenPageHeaderIdSuggested?: boolean | undefined;
firstPageFooterIdSuggested?: boolean | undefined;
firstPageHeaderIdSuggested?: boolean | undefined;
marginBottomSuggested?: boolean | undefined;
marginLeftSuggested?: boolean | undefined;
marginRightSuggested?: boolean | undefined;
marginTopSuggested?: boolean | undefined;
pageNumberStartSuggested?: boolean | undefined;
pageSizeSuggestionState?: Docs.Schema.SizeSuggestionState | undefined;
useEvenPageHeaderFooterSuggested?: boolean | undefined;
useFirstPageHeaderFooterSuggested?: boolean | undefined;
}
interface EmbeddedObject {
description?: string | undefined;
embeddedDrawingProperties?: any;
embeddedObjectBorder?: Docs.Schema.EmbeddedObjectBorder | undefined;
imageProperties?: Docs.Schema.ImageProperties | undefined;
linkedContentReference?: Docs.Schema.LinkedContentReference | undefined;
marginBottom?: Docs.Schema.Dimension | undefined;
marginLeft?: Docs.Schema.Dimension | undefined;
marginRight?: Docs.Schema.Dimension | undefined;
marginTop?: Docs.Schema.Dimension | undefined;
size?: Docs.Schema.Size | undefined;
title?: string | undefined;
}
interface EmbeddedObjectBorder {
color?: Docs.Schema.OptionalColor | undefined;
dashStyle?: string | undefined;
propertyState?: string | undefined;
width?: Docs.Schema.Dimension | undefined;
}
interface EmbeddedObjectBorderSuggestionState {
colorSuggested?: boolean | undefined;
dashStyleSuggested?: boolean | undefined;
propertyStateSuggested?: boolean | undefined;
widthSuggested?: boolean | undefined;
}
interface EmbeddedObjectSuggestionState {
descriptionSuggested?: boolean | undefined;
embeddedDrawingPropertiesSuggestionState?: any;
embeddedObjectBorderSuggestionState?: Docs.Schema.EmbeddedObjectBorderSuggestionState | undefined;
imagePropertiesSuggestionState?: Docs.Schema.ImagePropertiesSuggestionState | undefined;
linkedContentReferenceSuggestionState?: Docs.Schema.LinkedContentReferenceSuggestionState | undefined;
marginBottomSuggested?: boolean | undefined;
marginLeftSuggested?: boolean | undefined;
marginRightSuggested?: boolean | undefined;
marginTopSuggested?: boolean | undefined;
sizeSuggestionState?: Docs.Schema.SizeSuggestionState | undefined;
titleSuggested?: boolean | undefined;
}
interface EndOfSegmentLocation {
segmentId?: string | undefined;
}
interface Equation {
suggestedDeletionIds?: string[] | undefined;
suggestedInsertionIds?: string[] | undefined;
}
interface Footer {
content?: Docs.Schema.StructuralElement[] | undefined;
footerId?: string | undefined;
}
interface Footnote {
content?: Docs.Schema.StructuralElement[] | undefined;
footnoteId?: string | undefined;
}
interface FootnoteReference {
footnoteId?: string | undefined;
footnoteNumber?: string | undefined;
suggestedDeletionIds?: string[] | undefined;
suggestedInsertionIds?: string[] | undefined;
suggestedTextStyleChanges?: object | undefined;
textStyle?: Docs.Schema.TextStyle | undefined;
}
interface Header {
content?: Docs.Schema.StructuralElement[] | undefined;
headerId?: string | undefined;
}
interface HorizontalRule {
suggestedDeletionIds?: string[] | undefined;
suggestedInsertionIds?: string[] | undefined;
suggestedTextStyleChanges?: object | undefined;
textStyle?: Docs.Schema.TextStyle | undefined;
}
interface ImageProperties {
angle?: number | undefined;
brightness?: number | undefined;
contentUri?: string | undefined;
contrast?: number | undefined;
cropProperties?: Docs.Schema.CropProperties | undefined;
sourceUri?: string | undefined;
transparency?: number | undefined;
}
interface ImagePropertiesSuggestionState {
angleSuggested?: boolean | undefined;
brightnessSuggested?: boolean | undefined;
contentUriSuggested?: boolean | undefined;
contrastSuggested?: boolean | undefined;
cropPropertiesSuggestionState?: Docs.Schema.CropPropertiesSuggestionState | undefined;
sourceUriSuggested?: boolean | undefined;
transparencySuggested?: boolean | undefined;
}
interface InlineObject {
inlineObjectProperties?: Docs.Schema.InlineObjectProperties | undefined;
objectId?: string | undefined;
suggestedDeletionIds?: string[] | undefined;
suggestedInlineObjectPropertiesChanges?: object | undefined;
suggestedInsertionId?: string | undefined;
}
interface InlineObjectElement {
inlineObjectId?: string | undefined;
suggestedDeletionIds?: string[] | undefined;
suggestedInsertionIds?: string[] | undefined;
suggestedTextStyleChanges?: object | undefined;
textStyle?: Docs.Schema.TextStyle | undefined;
}
interface InlineObjectProperties {
embeddedObject?: Docs.Schema.EmbeddedObject | undefined;
}
interface InlineObjectPropertiesSuggestionState {
embeddedObjectSuggestionState?: Docs.Schema.EmbeddedObjectSuggestionState | undefined;
}
interface InsertInlineImageRequest {
endOfSegmentLocation?: Docs.Schema.EndOfSegmentLocation | undefined;
location?: Docs.Schema.Location | undefined;
objectSize?: Docs.Schema.Size | undefined;
uri?: string | undefined;
}
interface InsertInlineImageResponse {
objectId?: string | undefined;
}
interface InsertInlineSheetsChartResponse {
objectId?: string | undefined;
}
interface InsertPageBreakRequest {
endOfSegmentLocation?: Docs.Schema.EndOfSegmentLocation | undefined;
location?: Docs.Schema.Location | undefined;
}
interface InsertTableRequest {
columns?: number | undefined;
endOfSegmentLocation?: Docs.Schema.EndOfSegmentLocation | undefined;
location?: Docs.Schema.Location | undefined;
rows?: number | undefined;
}
interface InsertTableRowRequest {
insertBelow?: boolean | undefined;
tableCellLocation?: Docs.Schema.TableCellLocation | undefined;
}
interface InsertTextRequest {
endOfSegmentLocation?: Docs.Schema.EndOfSegmentLocation | undefined;
location?: Docs.Schema.Location | undefined;
text?: string | undefined;
}
interface Link {
bookmarkId?: string | undefined;
headingId?: string | undefined;
url?: string | undefined;
}
interface LinkedContentReference {
sheetsChartReference?: Docs.Schema.SheetsChartReference | undefined;
}
interface LinkedContentReferenceSuggestionState {
sheetsChartReferenceSuggestionState?: Docs.Schema.SheetsChartReferenceSuggestionState | undefined;
}
interface List {
listProperties?: Docs.Schema.ListProperties | undefined;
suggestedDeletionIds?: string[] | undefined;
suggestedInsertionId?: string | undefined;
suggestedListPropertiesChanges?: object | undefined;
}
interface ListProperties {
nestingLevels?: Docs.Schema.NestingLevel[] | undefined;
}
interface ListPropertiesSuggestionState {
nestingLevelsSuggestionStates?: Docs.Schema.NestingLevelSuggestionState[] | undefined;
}
interface Location {
index?: number | undefined;
segmentId?: string | undefined;
}
interface NamedRange {
name?: string | undefined;
namedRangeId?: string | undefined;
ranges?: Docs.Schema.Range[] | undefined;
}
interface NamedRanges {
name?: string | undefined;
namedRanges?: Docs.Schema.NamedRange[] | undefined;
}
interface NamedStyle {
namedStyleType?: string | undefined;
paragraphStyle?: Docs.Schema.ParagraphStyle | undefined;
textStyle?: Docs.Schema.TextStyle | undefined;
}
interface NamedStyleSuggestionState {
namedStyleType?: string | undefined;
paragraphStyleSuggestionState?: Docs.Schema.ParagraphStyleSuggestionState | undefined;
textStyleSuggestionState?: Docs.Schema.TextStyleSuggestionState | undefined;
}
interface NamedStyles {
styles?: Docs.Schema.NamedStyle[] | undefined;
}
interface NamedStylesSuggestionState {
stylesSuggestionStates?: Docs.Schema.NamedStyleSuggestionState[] | undefined;
}
interface NestingLevel {
bulletAlignment?: string | undefined;
glyphFormat?: string | undefined;
glyphSymbol?: string | undefined;
glyphType?: string | undefined;
indentFirstLine?: Docs.Schema.Dimension | undefined;
indentStart?: Docs.Schema.Dimension | undefined;
startNumber?: number | undefined;
textStyle?: Docs.Schema.TextStyle | undefined;
}
interface NestingLevelSuggestionState {
bulletAlignmentSuggested?: boolean | undefined;
glyphFormatSuggested?: boolean | undefined;
glyphSymbolSuggested?: boolean | undefined;
glyphTypeSuggested?: boolean | undefined;
indentFirstLineSuggested?: boolean | undefined;
indentStartSuggested?: boolean | undefined;
startNumberSuggested?: boolean | undefined;
textStyleSuggestionState?: Docs.Schema.TextStyleSuggestionState | undefined;
}
interface ObjectReferences {
objectIds?: string[] | undefined;
}
interface OptionalColor {
color?: Docs.Schema.Color | undefined;
}
interface PageBreak {
suggestedDeletionIds?: string[] | undefined;
suggestedInsertionIds?: string[] | undefined;
suggestedTextStyleChanges?: object | undefined;
textStyle?: Docs.Schema.TextStyle | undefined;
}
interface Paragraph {
bullet?: Docs.Schema.Bullet | undefined;
elements?: Docs.Schema.ParagraphElement[] | undefined;
paragraphStyle?: Docs.Schema.ParagraphStyle | undefined;
positionedObjectIds?: string[] | undefined;
suggestedBulletChanges?: object | undefined;
suggestedParagraphStyleChanges?: object | undefined;
suggestedPositionedObjectIds?: object | undefined;
}
interface ParagraphBorder {
color?: Docs.Schema.OptionalColor | undefined;
dashStyle?: string | undefined;
padding?: Docs.Schema.Dimension | undefined;
width?: Docs.Schema.Dimension | undefined;
}
interface ParagraphElement {
autoText?: Docs.Schema.AutoText | undefined;
columnBreak?: Docs.Schema.ColumnBreak | undefined;
endIndex?: number | undefined;
equation?: Docs.Schema.Equation | undefined;
footnoteReference?: Docs.Schema.FootnoteReference | undefined;
horizontalRule?: Docs.Schema.HorizontalRule | undefined;
inlineObjectElement?: Docs.Schema.InlineObjectElement | undefined;
pageBreak?: Docs.Schema.PageBreak | undefined;
startIndex?: number | undefined;
textRun?: Docs.Schema.TextRun | undefined;
}
interface ParagraphStyle {
alignment?: string | undefined;
avoidWidowAndOrphan?: boolean | undefined;
borderBetween?: Docs.Schema.ParagraphBorder | undefined;
borderBottom?: Docs.Schema.ParagraphBorder | undefined;
borderLeft?: Docs.Schema.ParagraphBorder | undefined;
borderRight?: Docs.Schema.ParagraphBorder | undefined;
borderTop?: Docs.Schema.ParagraphBorder | undefined;
direction?: string | undefined;
headingId?: string | undefined;
indentEnd?: Docs.Schema.Dimension | undefined;
indentFirstLine?: Docs.Schema.Dimension | undefined;
indentStart?: Docs.Schema.Dimension | undefined;
keepLinesTogether?: boolean | undefined;
keepWithNext?: boolean | undefined;
lineSpacing?: number | undefined;
namedStyleType?: string | undefined;
shading?: Docs.Schema.Shading | undefined;
spaceAbove?: Docs.Schema.Dimension | undefined;
spaceBelow?: Docs.Schema.Dimension | undefined;
spacingMode?: string | undefined;
tabStops?: Docs.Schema.TabStop[] | undefined;
}
interface ParagraphStyleSuggestionState {
alignmentSuggested?: boolean | undefined;
avoidWidowAndOrphanSuggested?: boolean | undefined;
borderBetweenSuggested?: boolean | undefined;
borderBottomSuggested?: boolean | undefined;
borderLeftSuggested?: boolean | undefined;
borderRightSuggested?: boolean | undefined;
borderTopSuggested?: boolean | undefined;
directionSuggested?: boolean | undefined;
headingIdSuggested?: boolean | undefined;
indentEndSuggested?: boolean | undefined;
indentFirstLineSuggested?: boolean | undefined;
indentStartSuggested?: boolean | undefined;
keepLinesTogetherSuggested?: boolean | undefined;
keepWithNextSuggested?: boolean | undefined;
lineSpacingSuggested?: boolean | undefined;
namedStyleTypeSuggested?: boolean | undefined;
shadingSuggestionState?: Docs.Schema.ShadingSuggestionState | undefined;
spaceAboveSuggested?: boolean | undefined;
spaceBelowSuggested?: boolean | undefined;
spacingModeSuggested?: boolean | undefined;
}
interface PositionedObject {
objectId?: string | undefined;
positionedObjectProperties?: Docs.Schema.PositionedObjectProperties | undefined;
suggestedDeletionIds?: string[] | undefined;
suggestedInsertionId?: string | undefined;
suggestedPositionedObjectPropertiesChanges?: object | undefined;
}
interface PositionedObjectPositioning {
layout?: string | undefined;
leftOffset?: Docs.Schema.Dimension | undefined;
topOffset?: Docs.Schema.Dimension | undefined;
}
interface PositionedObjectPositioningSuggestionState {
layoutSuggested?: boolean | undefined;
leftOffsetSuggested?: boolean | undefined;
topOffsetSuggested?: boolean | undefined;
}
interface PositionedObjectProperties {
embeddedObject?: Docs.Schema.EmbeddedObject | undefined;
positioning?: Docs.Schema.PositionedObjectPositioning | undefined;
}
interface PositionedObjectPropertiesSuggestionState {
embeddedObjectSuggestionState?: Docs.Schema.EmbeddedObjectSuggestionState | undefined;
positioningSuggestionState?: Docs.Schema.PositionedObjectPositioningSuggestionState | undefined;
}
interface Range {
endIndex?: number | undefined;
segmentId?: string | undefined;
startIndex?: number | undefined;
}
interface ReplaceAllTextRequest {
containsText?: Docs.Schema.SubstringMatchCriteria | undefined;
replaceText?: string | undefined;
}
interface ReplaceAllTextResponse {
occurrencesChanged?: number | undefined;
}
interface Request {
createNamedRange?: Docs.Schema.CreateNamedRangeRequest | undefined;
createParagraphBullets?: Docs.Schema.CreateParagraphBulletsRequest | undefined;
deleteContentRange?: Docs.Schema.DeleteContentRangeRequest | undefined;
deleteNamedRange?: Docs.Schema.DeleteNamedRangeRequest | undefined;
deleteParagraphBullets?: Docs.Schema.DeleteParagraphBulletsRequest | undefined;
deletePositionedObject?: Docs.Schema.DeletePositionedObjectRequest | undefined;
deleteTableColumn?: Docs.Schema.DeleteTableColumnRequest | undefined;
deleteTableRow?: Docs.Schema.DeleteTableRowRequest | undefined;
insertInlineImage?: Docs.Schema.InsertInlineImageRequest | undefined;
insertPageBreak?: Docs.Schema.InsertPageBreakRequest | undefined;
insertTable?: Docs.Schema.InsertTableRequest | undefined;
insertTableRow?: Docs.Schema.InsertTableRowRequest | undefined;
insertText?: Docs.Schema.InsertTextRequest | undefined;
replaceAllText?: Docs.Schema.ReplaceAllTextRequest | undefined;
updateParagraphStyle?: Docs.Schema.UpdateParagraphStyleRequest | undefined;
updateTextStyle?: Docs.Schema.UpdateTextStyleRequest | undefined;
}
interface Response {
createNamedRange?: Docs.Schema.CreateNamedRangeResponse | undefined;
insertInlineImage?: Docs.Schema.InsertInlineImageResponse | undefined;
insertInlineSheetsChart?: Docs.Schema.InsertInlineSheetsChartResponse | undefined;
replaceAllText?: Docs.Schema.ReplaceAllTextResponse | undefined;
}
interface RgbColor {
blue?: number | undefined;
green?: number | undefined;
red?: number | undefined;
}
interface SectionBreak {
sectionStyle?: Docs.Schema.SectionStyle | undefined;
suggestedDeletionIds?: string[] | undefined;
suggestedInsertionIds?: string[] | undefined;
}
interface SectionColumnProperties {
paddingEnd?: Docs.Schema.Dimension | undefined;
width?: Docs.Schema.Dimension | undefined;
}
interface SectionStyle {
columnProperties?: Docs.Schema.SectionColumnProperties[] | undefined;
columnSeparatorStyle?: string | undefined;
contentDirection?: string | undefined;
}
interface Shading {
backgroundColor?: Docs.Schema.OptionalColor | undefined;
}
interface ShadingSuggestionState {
backgroundColorSuggested?: boolean | undefined;
}
interface SheetsChartReference {
chartId?: number | undefined;
spreadsheetId?: string | undefined;
}
interface SheetsChartReferenceSuggestionState {
chartIdSuggested?: boolean | undefined;
spreadsheetIdSuggested?: boolean | undefined;
}
interface Size {
height?: Docs.Schema.Dimension | undefined;
width?: Docs.Schema.Dimension | undefined;
}
interface SizeSuggestionState {
heightSuggested?: boolean | undefined;
widthSuggested?: boolean | undefined;
}
interface StructuralElement {
endIndex?: number | undefined;
paragraph?: Docs.Schema.Paragraph | undefined;
sectionBreak?: Docs.Schema.SectionBreak | undefined;
startIndex?: number | undefined;
table?: Docs.Schema.Table | undefined;
tableOfContents?: Docs.Schema.TableOfContents | undefined;
}
interface SubstringMatchCriteria {
matchCase?: boolean | undefined;
text?: string | undefined;
}
interface SuggestedBullet {
bullet?: Docs.Schema.Bullet | undefined;
bulletSuggestionState?: Docs.Schema.BulletSuggestionState | undefined;
}
interface SuggestedDocumentStyle {
documentStyle?: Docs.Schema.DocumentStyle | undefined;
documentStyleSuggestionState?: Docs.Schema.DocumentStyleSuggestionState | undefined;
}
interface SuggestedInlineObjectProperties {
inlineObjectProperties?: Docs.Schema.InlineObjectProperties | undefined;
inlineObjectPropertiesSuggestionState?: Docs.Schema.InlineObjectPropertiesSuggestionState | undefined;
}
interface SuggestedListProperties {
listProperties?: Docs.Schema.ListProperties | undefined;
listPropertiesSuggestionState?: Docs.Schema.ListPropertiesSuggestionState | undefined;
}
interface SuggestedNamedStyles {
namedStyles?: Docs.Schema.NamedStyles | undefined;
namedStylesSuggestionState?: Docs.Schema.NamedStylesSuggestionState | undefined;
}
interface SuggestedParagraphStyle {
paragraphStyle?: Docs.Schema.ParagraphStyle | undefined;
paragraphStyleSuggestionState?: Docs.Schema.ParagraphStyleSuggestionState | undefined;
}
interface SuggestedPositionedObjectProperties {
positionedObjectProperties?: Docs.Schema.PositionedObjectProperties | undefined;
positionedObjectPropertiesSuggestionState?:
| Docs.Schema.PositionedObjectPropertiesSuggestionState
| undefined;
}
interface SuggestedTableCellStyle {
tableCellStyle?: Docs.Schema.TableCellStyle | undefined;
tableCellStyleSuggestionState?: Docs.Schema.TableCellStyleSuggestionState | undefined;
}
interface SuggestedTableRowStyle {
tableRowStyle?: Docs.Schema.TableRowStyle | undefined;
tableRowStyleSuggestionState?: Docs.Schema.TableRowStyleSuggestionState | undefined;
}
interface SuggestedTextStyle {
textStyle?: Docs.Schema.TextStyle | undefined;
textStyleSuggestionState?: Docs.Schema.TextStyleSuggestionState | undefined;
}
interface TabStop {
alignment?: string | undefined;
offset?: Docs.Schema.Dimension | undefined;
}
interface Table {
columns?: number | undefined;
rows?: number | undefined;
suggestedDeletionIds?: string[] | undefined;
suggestedInsertionIds?: string[] | undefined;
tableRows?: Docs.Schema.TableRow[] | undefined;
tableStyle?: Docs.Schema.TableStyle | undefined;
}
interface TableCell {
content?: Docs.Schema.StructuralElement[] | undefined;
endIndex?: number | undefined;
startIndex?: number | undefined;
suggestedDeletionIds?: string[] | undefined;
suggestedInsertionIds?: string[] | undefined;
suggestedTableCellStyleChanges?: object | undefined;
tableCellStyle?: Docs.Schema.TableCellStyle | undefined;
}
interface TableCellBorder {
color?: Docs.Schema.OptionalColor | undefined;
dashStyle?: string | undefined;
width?: Docs.Schema.Dimension | undefined;
}
interface TableCellLocation {
columnIndex?: number | undefined;
rowIndex?: number | undefined;
tableStartLocation?: Docs.Schema.Location | undefined;
}
interface TableCellStyle {
backgroundColor?: Docs.Schema.OptionalColor | undefined;
borderBottom?: Docs.Schema.TableCellBorder | undefined;
borderLeft?: Docs.Schema.TableCellBorder | undefined;
borderRight?: Docs.Schema.TableCellBorder | undefined;
borderTop?: Docs.Schema.TableCellBorder | undefined;
columnSpan?: number | undefined;
contentAlignment?: string | undefined;
paddingBottom?: Docs.Schema.Dimension | undefined;
paddingLeft?: Docs.Schema.Dimension | undefined;
paddingRight?: Docs.Schema.Dimension | undefined;
paddingTop?: Docs.Schema.Dimension | undefined;
rowSpan?: number | undefined;
}
interface TableCellStyleSuggestionState {
backgroundColorSuggested?: boolean | undefined;
borderBottomSuggested?: boolean | undefined;
borderLeftSuggested?: boolean | undefined;
borderRightSuggested?: boolean | undefined;
borderTopSuggested?: boolean | undefined;
columnSpanSuggested?: boolean | undefined;
contentAlignmentSuggested?: boolean | undefined;
paddingBottomSuggested?: boolean | undefined;
paddingLeftSuggested?: boolean | undefined;
paddingRightSuggested?: boolean | undefined;
paddingTopSuggested?: boolean | undefined;
rowSpanSuggested?: boolean | undefined;
}
interface TableColumnProperties {
width?: Docs.Schema.Dimension | undefined;
widthType?: string | undefined;
}
interface TableOfContents {
content?: Docs.Schema.StructuralElement[] | undefined;
suggestedDeletionIds?: string[] | undefined;
suggestedInsertionIds?: string[] | undefined;
}
interface TableRow {
endIndex?: number | undefined;
startIndex?: number | undefined;
suggestedDeletionIds?: string[] | undefined;
suggestedInsertionIds?: string[] | undefined;
suggestedTableRowStyleChanges?: object | undefined;
tableCells?: Docs.Schema.TableCell[] | undefined;
tableRowStyle?: Docs.Schema.TableRowStyle | undefined;
}
interface TableRowStyle {
minRowHeight?: Docs.Schema.Dimension | undefined;
}
interface TableRowStyleSuggestionState {
minRowHeightSuggested?: boolean | undefined;
}
interface TableStyle {
tableColumnProperties?: Docs.Schema.TableColumnProperties[] | undefined;
}
interface TextRun {
content?: string | undefined;
suggestedDeletionIds?: string[] | undefined;
suggestedInsertionIds?: string[] | undefined;
suggestedTextStyleChanges?: object | undefined;
textStyle?: Docs.Schema.TextStyle | undefined;
}
interface TextStyle {
backgroundColor?: Docs.Schema.OptionalColor | undefined;
baselineOffset?: string | undefined;
bold?: boolean | undefined;
fontSize?: Docs.Schema.Dimension | undefined;
foregroundColor?: Docs.Schema.OptionalColor | undefined;
italic?: boolean | undefined;
link?: Docs.Schema.Link | undefined;
smallCaps?: boolean | undefined;
strikethrough?: boolean | undefined;
underline?: boolean | undefined;
weightedFontFamily?: Docs.Schema.WeightedFontFamily | undefined;
}
interface TextStyleSuggestionState {
backgroundColorSuggested?: boolean | undefined;
baselineOffsetSuggested?: boolean | undefined;
boldSuggested?: boolean | undefined;
fontSizeSuggested?: boolean | undefined;
foregroundColorSuggested?: boolean | undefined;
italicSuggested?: boolean | undefined;
linkSuggested?: boolean | undefined;
smallCapsSuggested?: boolean | undefined;
strikethroughSuggested?: boolean | undefined;
underlineSuggested?: boolean | undefined;
weightedFontFamilySuggested?: boolean | undefined;
}
interface UpdateParagraphStyleRequest {
fields?: string | undefined;
paragraphStyle?: Docs.Schema.ParagraphStyle | undefined;
range?: Docs.Schema.Range | undefined;
}
interface UpdateTextStyleRequest {
fields?: string | undefined;
range?: Docs.Schema.Range | undefined;
textStyle?: Docs.Schema.TextStyle | undefined;
}
interface WeightedFontFamily {
fontFamily?: string | undefined;
weight?: number | undefined;
}
interface WriteControl {
requiredRevisionId?: string | undefined;
targetRevisionId?: string | undefined;
}
}
}
interface Docs {
Documents?: Docs.Collection.DocumentsCollection | undefined;
// Create a new instance of AutoText
newAutoText(): Docs.Schema.AutoText;
// Create a new instance of Background
newBackground(): Docs.Schema.Background;
// Create a new instance of BatchUpdateDocumentRequest
newBatchUpdateDocumentRequest(): Docs.Schema.BatchUpdateDocumentRequest;
// Create a new instance of Body
newBody(): Docs.Schema.Body;
// Create a new instance of Bullet
newBullet(): Docs.Schema.Bullet;
// Create a new instance of Color
newColor(): Docs.Schema.Color;
// Create a new instance of ColumnBreak
newColumnBreak(): Docs.Schema.ColumnBreak;
// Create a new instance of CreateNamedRangeRequest
newCreateNamedRangeRequest(): Docs.Schema.CreateNamedRangeRequest;
// Create a new instance of CreateParagraphBulletsRequest
newCreateParagraphBulletsRequest(): Docs.Schema.CreateParagraphBulletsRequest;
// Create a new instance of DeleteContentRangeRequest
newDeleteContentRangeRequest(): Docs.Schema.DeleteContentRangeRequest;
// Create a new instance of DeleteNamedRangeRequest
newDeleteNamedRangeRequest(): Docs.Schema.DeleteNamedRangeRequest;
// Create a new instance of DeleteParagraphBulletsRequest
newDeleteParagraphBulletsRequest(): Docs.Schema.DeleteParagraphBulletsRequest;
// Create a new instance of DeletePositionedObjectRequest
newDeletePositionedObjectRequest(): Docs.Schema.DeletePositionedObjectRequest;
// Create a new instance of DeleteTableColumnRequest
newDeleteTableColumnRequest(): Docs.Schema.DeleteTableColumnRequest;
// Create a new instance of DeleteTableRowRequest
newDeleteTableRowRequest(): Docs.Schema.DeleteTableRowRequest;
// Create a new instance of Dimension
newDimension(): Docs.Schema.Dimension;
// Create a new instance of Document
newDocument(): Docs.Schema.Document;
// Create a new instance of DocumentStyle
newDocumentStyle(): Docs.Schema.DocumentStyle;
// Create a new instance of EndOfSegmentLocation
newEndOfSegmentLocation(): Docs.Schema.EndOfSegmentLocation;
// Create a new instance of Equation
newEquation(): Docs.Schema.Equation;
// Create a new instance of FootnoteReference
newFootnoteReference(): Docs.Schema.FootnoteReference;
// Create a new instance of HorizontalRule
newHorizontalRule(): Docs.Schema.HorizontalRule;
// Create a new instance of InlineObjectElement
newInlineObjectElement(): Docs.Schema.InlineObjectElement;
// Create a new instance of InsertInlineImageRequest
newInsertInlineImageRequest(): Docs.Schema.InsertInlineImageRequest;
// Create a new instance of InsertPageBreakRequest
newInsertPageBreakRequest(): Docs.Schema.InsertPageBreakRequest;
// Create a new instance of InsertTableRequest
newInsertTableRequest(): Docs.Schema.InsertTableRequest;
// Create a new instance of InsertTableRowRequest
newInsertTableRowRequest(): Docs.Schema.InsertTableRowRequest;
// Create a new instance of InsertTextRequest
newInsertTextRequest(): Docs.Schema.InsertTextRequest;
// Create a new instance of Link
newLink(): Docs.Schema.Link;
// Create a new instance of Location
newLocation(): Docs.Schema.Location;
// Create a new instance of NamedStyle
newNamedStyle(): Docs.Schema.NamedStyle;
// Create a new instance of NamedStyles
newNamedStyles(): Docs.Schema.NamedStyles;
// Create a new instance of OptionalColor
newOptionalColor(): Docs.Schema.OptionalColor;
// Create a new instance of PageBreak
newPageBreak(): Docs.Schema.PageBreak;
// Create a new instance of Paragraph
newParagraph(): Docs.Schema.Paragraph;
// Create a new instance of ParagraphBorder
newParagraphBorder(): Docs.Schema.ParagraphBorder;
// Create a new instance of ParagraphElement
newParagraphElement(): Docs.Schema.ParagraphElement;
// Create a new instance of ParagraphStyle
newParagraphStyle(): Docs.Schema.ParagraphStyle;
// Create a new instance of Range
newRange(): Docs.Schema.Range;
// Create a new instance of ReplaceAllTextRequest
newReplaceAllTextRequest(): Docs.Schema.ReplaceAllTextRequest;
// Create a new instance of Request
newRequest(): Docs.Schema.Request;
// Create a new instance of RgbColor
newRgbColor(): Docs.Schema.RgbColor;
// Create a new instance of SectionBreak
newSectionBreak(): Docs.Schema.SectionBreak;
// Create a new instance of SectionColumnProperties
newSectionColumnProperties(): Docs.Schema.SectionColumnProperties;
// Create a new instance of SectionStyle
newSectionStyle(): Docs.Schema.SectionStyle;
// Create a new instance of Shading
newShading(): Docs.Schema.Shading;
// Create a new instance of Size
newSize(): Docs.Schema.Size;
// Create a new instance of StructuralElement
newStructuralElement(): Docs.Schema.StructuralElement;
// Create a new instance of SubstringMatchCriteria
newSubstringMatchCriteria(): Docs.Schema.SubstringMatchCriteria;
// Create a new instance of TabStop
newTabStop(): Docs.Schema.TabStop;
// Create a new instance of Table
newTable(): Docs.Schema.Table;
// Create a new instance of TableCell
newTableCell(): Docs.Schema.TableCell;
// Create a new instance of TableCellBorder
newTableCellBorder(): Docs.Schema.TableCellBorder;
// Create a new instance of TableCellLocation
newTableCellLocation(): Docs.Schema.TableCellLocation;
// Create a new instance of TableCellStyle
newTableCellStyle(): Docs.Schema.TableCellStyle;
// Create a new instance of TableColumnProperties
newTableColumnProperties(): Docs.Schema.TableColumnProperties;
// Create a new instance of TableOfContents
newTableOfContents(): Docs.Schema.TableOfContents;
// Create a new instance of TableRow
newTableRow(): Docs.Schema.TableRow;
// Create a new instance of TableRowStyle
newTableRowStyle(): Docs.Schema.TableRowStyle;
// Create a new instance of TableStyle
newTableStyle(): Docs.Schema.TableStyle;
// Create a new instance of TextRun
newTextRun(): Docs.Schema.TextRun;
// Create a new instance of TextStyle
newTextStyle(): Docs.Schema.TextStyle;
// Create a new instance of UpdateParagraphStyleRequest
newUpdateParagraphStyleRequest(): Docs.Schema.UpdateParagraphStyleRequest;
// Create a new instance of UpdateTextStyleRequest
newUpdateTextStyleRequest(): Docs.Schema.UpdateTextStyleRequest;
// Create a new instance of WeightedFontFamily
newWeightedFontFamily(): Docs.Schema.WeightedFontFamily;
// Create a new instance of WriteControl
newWriteControl(): Docs.Schema.WriteControl;
}
}
declare var Docs: GoogleAppsScript.Docs;

View File

@ -0,0 +1,984 @@
declare namespace GoogleAppsScript {
namespace Drive {
namespace Collection {
interface AboutCollection {
// Gets the information about the current user along with Drive API settings
get(): Drive.Schema.About;
// Gets the information about the current user along with Drive API settings
get(optionalArgs: object): Drive.Schema.About;
}
interface AppsCollection {
// Gets a specific app.
get(appId: string): Drive.Schema.App;
// Lists a user's installed apps.
list(): Drive.Schema.AppList;
// Lists a user's installed apps.
list(optionalArgs: object): Drive.Schema.AppList;
}
interface ChangesCollection {
// Deprecated - Use changes.getStartPageToken and changes.list to retrieve recent changes.
get(changeId: string): Drive.Schema.Change;
// Deprecated - Use changes.getStartPageToken and changes.list to retrieve recent changes.
get(changeId: string, optionalArgs: object): Drive.Schema.Change;
// Gets the starting pageToken for listing future changes.
getStartPageToken(): Drive.Schema.StartPageToken;
// Gets the starting pageToken for listing future changes.
getStartPageToken(optionalArgs: object): Drive.Schema.StartPageToken;
// Lists the changes for a user or Team Drive.
list(): Drive.Schema.ChangeList;
// Lists the changes for a user or Team Drive.
list(optionalArgs: object): Drive.Schema.ChangeList;
// Subscribe to changes for a user.
watch(resource: Schema.Channel): Drive.Schema.Channel;
// Subscribe to changes for a user.
watch(resource: Schema.Channel, optionalArgs: object): Drive.Schema.Channel;
}
interface ChannelsCollection {
// Stop watching resources through this channel
stop(resource: Schema.Channel): void;
}
interface ChildrenCollection {
// Gets a specific child reference.
get(folderId: string, childId: string): Drive.Schema.ChildReference;
// Inserts a file into a folder.
insert(resource: Schema.ChildReference, folderId: string): Drive.Schema.ChildReference;
// Inserts a file into a folder.
insert(
resource: Schema.ChildReference,
folderId: string,
optionalArgs: object,
): Drive.Schema.ChildReference;
// Lists a folder's children.
list(folderId: string): Drive.Schema.ChildList;
// Lists a folder's children.
list(folderId: string, optionalArgs: object): Drive.Schema.ChildList;
// Removes a child from a folder.
remove(folderId: string, childId: string): void;
}
interface CommentsCollection {
// Gets a comment by ID.
get(fileId: string, commentId: string): Drive.Schema.Comment;
// Gets a comment by ID.
get(fileId: string, commentId: string, optionalArgs: object): Drive.Schema.Comment;
// Creates a new comment on the given file.
insert(resource: Schema.Comment, fileId: string): Drive.Schema.Comment;
// Lists a file's comments.
list(fileId: string): Drive.Schema.CommentList;
// Lists a file's comments.
list(fileId: string, optionalArgs: object): Drive.Schema.CommentList;
// Updates an existing comment. This method supports patch semantics.
patch(resource: Schema.Comment, fileId: string, commentId: string): Drive.Schema.Comment;
// Deletes a comment.
remove(fileId: string, commentId: string): void;
// Updates an existing comment.
update(resource: Schema.Comment, fileId: string, commentId: string): Drive.Schema.Comment;
}
interface DrivesCollection {
// Gets a shared drive's metadata by ID.
get(driveId: string): Drive.Schema.Drive;
// Gets a shared drive's metadata by ID.
get(driveId: string, optionalArgs: object): Drive.Schema.Drive;
// Hides a shared drive from the default view.
hide(driveId: string): Drive.Schema.Drive;
// Creates a new shared drive.
insert(resource: Schema.Drive, requestId: string): Drive.Schema.Drive;
// Lists the user's shared drives.
list(): Drive.Schema.DriveList;
// Lists the user's shared drives.
list(optionalArgs: object): Drive.Schema.DriveList;
// Permanently deletes a shared drive for which the user is an organizer. The shared drive cannot contain any untrashed items.
remove(driveId: string): void;
// Restores a shared drive to the default view.
unhide(driveId: string): Drive.Schema.Drive;
// Updates the metadata for a shared drive.
update(resource: Schema.Drive, driveId: string): Drive.Schema.Drive;
// Updates the metadata for a shared drive.
update(resource: Schema.Drive, driveId: string, optionalArgs: object): Drive.Schema.Drive;
}
interface FilesCollection {
// Creates a copy of the specified file.
copy(resource: Schema.File, fileId: string): Drive.Schema.File;
// Creates a copy of the specified file.
copy(resource: Schema.File, fileId: string, optionalArgs: object): Drive.Schema.File;
// Permanently deletes all of the user's trashed files.
emptyTrash(): void;
// Exports a Google Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB.
export(fileId: string, mimeType: string): void;
// Generates a set of file IDs which can be provided in insert requests.
generateIds(): Drive.Schema.GeneratedIds;
// Generates a set of file IDs which can be provided in insert requests.
generateIds(optionalArgs: object): Drive.Schema.GeneratedIds;
// Gets a file's metadata by ID.
get(fileId: string): Drive.Schema.File;
// Gets a file's metadata by ID.
get(fileId: string, optionalArgs: object): Drive.Schema.File;
// Insert a new file.
insert(resource: Schema.File): Drive.Schema.File;
// Insert a new file.
insert(resource: Schema.File, mediaData: any): Drive.Schema.File;
// Insert a new file.
insert(resource: Schema.File, mediaData: any, optionalArgs: object): Drive.Schema.File;
// Lists the user's files.
list(): Drive.Schema.FileList;
// Lists the user's files.
list(optionalArgs: object): Drive.Schema.FileList;
// Updates file metadata and/or content. This method supports patch semantics.
patch(resource: Schema.File, fileId: string): Drive.Schema.File;
// Updates file metadata and/or content. This method supports patch semantics.
patch(resource: Schema.File, fileId: string, optionalArgs: object): Drive.Schema.File;
// Permanently deletes a file by ID. Skips the trash. The currently authenticated user must own the file or be an organizer on the parent for Team Drive files.
remove(fileId: string): void;
// Permanently deletes a file by ID. Skips the trash. The currently authenticated user must own the file or be an organizer on the parent for Team Drive files.
remove(fileId: string, optionalArgs: object): void;
// Set the file's updated time to the current server time.
touch(fileId: string): Drive.Schema.File;
// Set the file's updated time to the current server time.
touch(fileId: string, optionalArgs: object): Drive.Schema.File;
// Moves a file to the trash. The currently authenticated user must own the file or be at least a fileOrganizer on the parent for Team Drive files.
trash(fileId: string): Drive.Schema.File;
// Moves a file to the trash. The currently authenticated user must own the file or be at least a fileOrganizer on the parent for Team Drive files.
trash(fileId: string, optionalArgs: object): Drive.Schema.File;
// Restores a file from the trash.
untrash(fileId: string): Drive.Schema.File;
// Restores a file from the trash.
untrash(fileId: string, optionalArgs: object): Drive.Schema.File;
// Updates file metadata and/or content.
update(resource: Schema.File, fileId: string): Drive.Schema.File;
// Updates file metadata and/or content.
update(resource: Schema.File, fileId: string, mediaData: any): Drive.Schema.File;
// Updates file metadata and/or content.
update(resource: Schema.File, fileId: string, mediaData: any, optionalArgs: object): Drive.Schema.File;
// Subscribe to changes on a file
watch(resource: Schema.Channel, fileId: string): Drive.Schema.Channel;
// Subscribe to changes on a file
watch(resource: Schema.Channel, fileId: string, optionalArgs: object): Drive.Schema.Channel;
}
interface ParentsCollection {
// Gets a specific parent reference.
get(fileId: string, parentId: string): Drive.Schema.ParentReference;
// Adds a parent folder for a file.
insert(resource: Schema.ParentReference, fileId: string): Drive.Schema.ParentReference;
// Adds a parent folder for a file.
insert(
resource: Schema.ParentReference,
fileId: string,
optionalArgs: object,
): Drive.Schema.ParentReference;
// Lists a file's parents.
list(fileId: string): Drive.Schema.ParentList;
// Removes a parent from a file.
remove(fileId: string, parentId: string): void;
}
interface PermissionsCollection {
// Gets a permission by ID.
get(fileId: string, permissionId: string): Drive.Schema.Permission;
// Gets a permission by ID.
get(fileId: string, permissionId: string, optionalArgs: object): Drive.Schema.Permission;
// Returns the permission ID for an email address.
getIdForEmail(email: string): Drive.Schema.PermissionId;
// Inserts a permission for a file or Team Drive.
insert(resource: Schema.Permission, fileId: string): Drive.Schema.Permission;
// Inserts a permission for a file or Team Drive.
insert(resource: Schema.Permission, fileId: string, optionalArgs: object): Drive.Schema.Permission;
// Lists a file's or Team Drive's permissions.
list(fileId: string): Drive.Schema.PermissionList;
// Lists a file's or Team Drive's permissions.
list(fileId: string, optionalArgs: object): Drive.Schema.PermissionList;
// Updates a permission using patch semantics.
patch(resource: Schema.Permission, fileId: string, permissionId: string): Drive.Schema.Permission;
// Updates a permission using patch semantics.
patch(
resource: Schema.Permission,
fileId: string,
permissionId: string,
optionalArgs: object,
): Drive.Schema.Permission;
// Deletes a permission from a file or Team Drive.
remove(fileId: string, permissionId: string): void;
// Deletes a permission from a file or Team Drive.
remove(fileId: string, permissionId: string, optionalArgs: object): void;
// Updates a permission.
update(resource: Schema.Permission, fileId: string, permissionId: string): Drive.Schema.Permission;
// Updates a permission.
update(
resource: Schema.Permission,
fileId: string,
permissionId: string,
optionalArgs: object,
): Drive.Schema.Permission;
}
interface PropertiesCollection {
// Gets a property by its key.
get(fileId: string, propertyKey: string): Drive.Schema.Property;
// Gets a property by its key.
get(fileId: string, propertyKey: string, optionalArgs: object): Drive.Schema.Property;
// Adds a property to a file, or updates it if it already exists.
insert(resource: Schema.Property, fileId: string): Drive.Schema.Property;
// Lists a file's properties.
list(fileId: string): Drive.Schema.PropertyList;
// Updates a property.
patch(resource: Schema.Property, fileId: string, propertyKey: string): Drive.Schema.Property;
// Updates a property.
patch(
resource: Schema.Property,
fileId: string,
propertyKey: string,
optionalArgs: object,
): Drive.Schema.Property;
// Deletes a property.
remove(fileId: string, propertyKey: string): void;
// Deletes a property.
remove(fileId: string, propertyKey: string, optionalArgs: object): void;
// Updates a property.
update(resource: Schema.Property, fileId: string, propertyKey: string): Drive.Schema.Property;
// Updates a property.
update(
resource: Schema.Property,
fileId: string,
propertyKey: string,
optionalArgs: object,
): Drive.Schema.Property;
}
interface RealtimeCollection {
// Exports the contents of the Realtime API data model associated with this file as JSON.
get(fileId: string): void;
// Exports the contents of the Realtime API data model associated with this file as JSON.
get(fileId: string, optionalArgs: object): void;
// Overwrites the Realtime API data model associated with this file with the provided JSON data model.
update(fileId: string): void;
// Overwrites the Realtime API data model associated with this file with the provided JSON data model.
update(fileId: string, mediaData: any): void;
// Overwrites the Realtime API data model associated with this file with the provided JSON data model.
update(fileId: string, mediaData: any, optionalArgs: object): void;
}
interface RepliesCollection {
// Gets a reply.
get(fileId: string, commentId: string, replyId: string): Drive.Schema.CommentReply;
// Gets a reply.
get(
fileId: string,
commentId: string,
replyId: string,
optionalArgs: object,
): Drive.Schema.CommentReply;
// Creates a new reply to the given comment.
insert(resource: Schema.CommentReply, fileId: string, commentId: string): Drive.Schema.CommentReply;
// Lists all of the replies to a comment.
list(fileId: string, commentId: string): Drive.Schema.CommentReplyList;
// Lists all of the replies to a comment.
list(fileId: string, commentId: string, optionalArgs: object): Drive.Schema.CommentReplyList;
// Updates an existing reply. This method supports patch semantics.
patch(
resource: Schema.CommentReply,
fileId: string,
commentId: string,
replyId: string,
): Drive.Schema.CommentReply;
// Deletes a reply.
remove(fileId: string, commentId: string, replyId: string): void;
// Updates an existing reply.
update(
resource: Schema.CommentReply,
fileId: string,
commentId: string,
replyId: string,
): Drive.Schema.CommentReply;
}
interface RevisionsCollection {
// Gets a specific revision.
get(fileId: string, revisionId: string): Drive.Schema.Revision;
// Lists a file's revisions.
list(fileId: string): Drive.Schema.RevisionList;
// Lists a file's revisions.
list(fileId: string, optionalArgs: object): Drive.Schema.RevisionList;
// Updates a revision. This method supports patch semantics.
patch(resource: Schema.Revision, fileId: string, revisionId: string): Drive.Schema.Revision;
// Permanently deletes a file version. You can only delete revisions for files with binary content, like images or videos. Revisions for other files, like Google Docs or Sheets, and the last remaining file version can't be deleted.
remove(fileId: string, revisionId: string): void;
// Updates a revision.
update(resource: Schema.Revision, fileId: string, revisionId: string): Drive.Schema.Revision;
}
interface TeamdrivesCollection {
// Gets a Team Drive's metadata by ID.
get(teamDriveId: string): Drive.Schema.TeamDrive;
// Gets a Team Drive's metadata by ID.
get(teamDriveId: string, optionalArgs: object): Drive.Schema.TeamDrive;
// Creates a new Team Drive.
insert(resource: Schema.TeamDrive, requestId: string): Drive.Schema.TeamDrive;
// Lists the user's Team Drives.
list(): Drive.Schema.TeamDriveList;
// Lists the user's Team Drives.
list(optionalArgs: object): Drive.Schema.TeamDriveList;
// Permanently deletes a Team Drive for which the user is an organizer. The Team Drive cannot contain any untrashed items.
remove(teamDriveId: string): void;
// Updates a Team Drive's metadata
update(resource: Schema.TeamDrive, teamDriveId: string): Drive.Schema.TeamDrive;
// Updates a Team Drive's metadata
update(resource: Schema.TeamDrive, teamDriveId: string, optionalArgs: object): Drive.Schema.TeamDrive;
}
}
namespace Schema {
interface About {
additionalRoleInfo?: Drive.Schema.AboutAdditionalRoleInfo[] | undefined;
canCreateDrives?: boolean | undefined;
canCreateTeamDrives?: boolean | undefined;
domainSharingPolicy?: string | undefined;
driveThemes?: Drive.Schema.AboutDriveThemes[] | undefined;
etag?: string | undefined;
exportFormats?: Drive.Schema.AboutExportFormats[] | undefined;
features?: Drive.Schema.AboutFeatures[] | undefined;
folderColorPalette?: string[] | undefined;
importFormats?: Drive.Schema.AboutImportFormats[] | undefined;
isCurrentAppInstalled?: boolean | undefined;
kind?: string | undefined;
languageCode?: string | undefined;
largestChangeId?: string | undefined;
maxUploadSizes?: Drive.Schema.AboutMaxUploadSizes[] | undefined;
name?: string | undefined;
permissionId?: string | undefined;
quotaBytesByService?: Drive.Schema.AboutQuotaBytesByService[] | undefined;
quotaBytesTotal?: string | undefined;
quotaBytesUsed?: string | undefined;
quotaBytesUsedAggregate?: string | undefined;
quotaBytesUsedInTrash?: string | undefined;
quotaType?: string | undefined;
remainingChangeIds?: string | undefined;
rootFolderId?: string | undefined;
selfLink?: string | undefined;
teamDriveThemes?: Drive.Schema.AboutTeamDriveThemes[] | undefined;
user?: Drive.Schema.User | undefined;
}
interface AboutAdditionalRoleInfo {
roleSets?: Drive.Schema.AboutAdditionalRoleInfoRoleSets[] | undefined;
type?: string | undefined;
}
interface AboutAdditionalRoleInfoRoleSets {
additionalRoles?: string[] | undefined;
primaryRole?: string | undefined;
}
interface AboutDriveThemes {
backgroundImageLink?: string | undefined;
colorRgb?: string | undefined;
id?: string | undefined;
}
interface AboutExportFormats {
source?: string | undefined;
targets?: string[] | undefined;
}
interface AboutFeatures {
featureName?: string | undefined;
featureRate?: number | undefined;
}
interface AboutImportFormats {
source?: string | undefined;
targets?: string[] | undefined;
}
interface AboutMaxUploadSizes {
size?: string | undefined;
type?: string | undefined;
}
interface AboutQuotaBytesByService {
bytesUsed?: string | undefined;
serviceName?: string | undefined;
}
interface AboutTeamDriveThemes {
backgroundImageLink?: string | undefined;
colorRgb?: string | undefined;
id?: string | undefined;
}
interface App {
authorized?: boolean | undefined;
createInFolderTemplate?: string | undefined;
createUrl?: string | undefined;
hasDriveWideScope?: boolean | undefined;
icons?: Drive.Schema.AppIcons[] | undefined;
id?: string | undefined;
installed?: boolean | undefined;
kind?: string | undefined;
longDescription?: string | undefined;
name?: string | undefined;
objectType?: string | undefined;
openUrlTemplate?: string | undefined;
primaryFileExtensions?: string[] | undefined;
primaryMimeTypes?: string[] | undefined;
productId?: string | undefined;
productUrl?: string | undefined;
secondaryFileExtensions?: string[] | undefined;
secondaryMimeTypes?: string[] | undefined;
shortDescription?: string | undefined;
supportsCreate?: boolean | undefined;
supportsImport?: boolean | undefined;
supportsMultiOpen?: boolean | undefined;
supportsOfflineCreate?: boolean | undefined;
useByDefault?: boolean | undefined;
}
interface AppIcons {
category?: string | undefined;
iconUrl?: string | undefined;
size?: number | undefined;
}
interface AppList {
defaultAppIds?: string[] | undefined;
etag?: string | undefined;
items?: Drive.Schema.App[] | undefined;
kind?: string | undefined;
selfLink?: string | undefined;
}
interface Change {
deleted?: boolean | undefined;
drive?: Drive.Schema.Drive | undefined;
driveId?: string | undefined;
file?: Drive.Schema.File | undefined;
fileId?: string | undefined;
id?: string | undefined;
kind?: string | undefined;
modificationDate?: string | undefined;
selfLink?: string | undefined;
teamDrive?: Drive.Schema.TeamDrive | undefined;
teamDriveId?: string | undefined;
type?: string | undefined;
}
interface ChangeList {
etag?: string | undefined;
items?: Drive.Schema.Change[] | undefined;
kind?: string | undefined;
largestChangeId?: string | undefined;
newStartPageToken?: string | undefined;
nextLink?: string | undefined;
nextPageToken?: string | undefined;
selfLink?: string | undefined;
}
interface Channel {
address?: string | undefined;
expiration?: string | undefined;
id?: string | undefined;
kind?: string | undefined;
params?: object | undefined;
payload?: boolean | undefined;
resourceId?: string | undefined;
resourceUri?: string | undefined;
token?: string | undefined;
type?: string | undefined;
}
interface ChildList {
etag?: string | undefined;
items?: Drive.Schema.ChildReference[] | undefined;
kind?: string | undefined;
nextLink?: string | undefined;
nextPageToken?: string | undefined;
selfLink?: string | undefined;
}
interface ChildReference {
childLink?: string | undefined;
id?: string | undefined;
kind?: string | undefined;
selfLink?: string | undefined;
}
interface Comment {
anchor?: string | undefined;
author?: Drive.Schema.User | undefined;
commentId?: string | undefined;
content?: string | undefined;
context?: Drive.Schema.CommentContext | undefined;
createdDate?: string | undefined;
deleted?: boolean | undefined;
fileId?: string | undefined;
fileTitle?: string | undefined;
htmlContent?: string | undefined;
kind?: string | undefined;
modifiedDate?: string | undefined;
replies?: Drive.Schema.CommentReply[] | undefined;
selfLink?: string | undefined;
status?: string | undefined;
}
interface CommentContext {
type?: string | undefined;
value?: string | undefined;
}
interface CommentList {
items?: Drive.Schema.Comment[] | undefined;
kind?: string | undefined;
nextLink?: string | undefined;
nextPageToken?: string | undefined;
selfLink?: string | undefined;
}
interface CommentReply {
author?: Drive.Schema.User | undefined;
content?: string | undefined;
createdDate?: string | undefined;
deleted?: boolean | undefined;
htmlContent?: string | undefined;
kind?: string | undefined;
modifiedDate?: string | undefined;
replyId?: string | undefined;
verb?: string | undefined;
}
interface CommentReplyList {
items?: Drive.Schema.CommentReply[] | undefined;
kind?: string | undefined;
nextLink?: string | undefined;
nextPageToken?: string | undefined;
selfLink?: string | undefined;
}
interface Drive {
backgroundImageFile?: Drive.Schema.DriveBackgroundImageFile | undefined;
backgroundImageLink?: string | undefined;
capabilities?: Drive.Schema.DriveCapabilities | undefined;
colorRgb?: string | undefined;
createdDate?: string | undefined;
hidden?: boolean | undefined;
id?: string | undefined;
kind?: string | undefined;
name?: string | undefined;
restrictions?: Drive.Schema.DriveRestrictions | undefined;
themeId?: string | undefined;
}
interface DriveBackgroundImageFile {
id?: string | undefined;
width?: number | undefined;
xCoordinate?: number | undefined;
yCoordinate?: number | undefined;
}
interface DriveCapabilities {
canAddChildren?: boolean | undefined;
canChangeCopyRequiresWriterPermissionRestriction?: boolean | undefined;
canChangeDomainUsersOnlyRestriction?: boolean | undefined;
canChangeDriveBackground?: boolean | undefined;
canChangeDriveMembersOnlyRestriction?: boolean | undefined;
canComment?: boolean | undefined;
canCopy?: boolean | undefined;
canDeleteChildren?: boolean | undefined;
canDeleteDrive?: boolean | undefined;
canDownload?: boolean | undefined;
canEdit?: boolean | undefined;
canListChildren?: boolean | undefined;
canManageMembers?: boolean | undefined;
canReadRevisions?: boolean | undefined;
canRename?: boolean | undefined;
canRenameDrive?: boolean | undefined;
canShare?: boolean | undefined;
canTrashChildren?: boolean | undefined;
}
interface DriveList {
items?: Drive.Schema.Drive[] | undefined;
kind?: string | undefined;
nextPageToken?: string | undefined;
}
interface DriveRestrictions {
adminManagedRestrictions?: boolean | undefined;
copyRequiresWriterPermission?: boolean | undefined;
domainUsersOnly?: boolean | undefined;
driveMembersOnly?: boolean | undefined;
}
interface File {
alternateLink?: string | undefined;
appDataContents?: boolean | undefined;
canComment?: boolean | undefined;
canReadRevisions?: boolean | undefined;
capabilities?: Drive.Schema.FileCapabilities | undefined;
copyRequiresWriterPermission?: boolean | undefined;
copyable?: boolean | undefined;
createdDate?: string | undefined;
defaultOpenWithLink?: string | undefined;
description?: string | undefined;
downloadUrl?: string | undefined;
driveId?: string | undefined;
editable?: boolean | undefined;
embedLink?: string | undefined;
etag?: string | undefined;
explicitlyTrashed?: boolean | undefined;
exportLinks?: object | undefined;
fileExtension?: string | undefined;
fileSize?: string | undefined;
folderColorRgb?: string | undefined;
fullFileExtension?: string | undefined;
hasAugmentedPermissions?: boolean | undefined;
hasThumbnail?: boolean | undefined;
headRevisionId?: string | undefined;
iconLink?: string | undefined;
id?: string | undefined;
imageMediaMetadata?: Drive.Schema.FileImageMediaMetadata | undefined;
indexableText?: Drive.Schema.FileIndexableText | undefined;
isAppAuthorized?: boolean | undefined;
kind?: string | undefined;
labels?: Drive.Schema.FileLabels | undefined;
lastModifyingUser?: Drive.Schema.User | undefined;
lastModifyingUserName?: string | undefined;
lastViewedByMeDate?: string | undefined;
markedViewedByMeDate?: string | undefined;
md5Checksum?: string | undefined;
mimeType?: string | undefined;
modifiedByMeDate?: string | undefined;
modifiedDate?: string | undefined;
openWithLinks?: object | undefined;
originalFilename?: string | undefined;
ownedByMe?: boolean | undefined;
ownerNames?: string[] | undefined;
owners?: Drive.Schema.User[] | undefined;
parents?: Drive.Schema.ParentReference[] | undefined;
permissionIds?: string[] | undefined;
permissions?: Drive.Schema.Permission[] | undefined;
properties?: Drive.Schema.Property[] | undefined;
quotaBytesUsed?: string | undefined;
selfLink?: string | undefined;
shareable?: boolean | undefined;
shared?: boolean | undefined;
sharedWithMeDate?: string | undefined;
sharingUser?: Drive.Schema.User | undefined;
shortcutDetails?: Drive.Schema.ShortcutDetails | undefined;
spaces?: string[] | undefined;
teamDriveId?: string | undefined;
thumbnail?: Drive.Schema.FileThumbnail | undefined;
thumbnailLink?: string | undefined;
thumbnailVersion?: string | undefined;
title?: string | undefined;
trashedDate?: string | undefined;
trashingUser?: Drive.Schema.User | undefined;
userPermission?: Drive.Schema.Permission | undefined;
version?: string | undefined;
videoMediaMetadata?: Drive.Schema.FileVideoMediaMetadata | undefined;
webContentLink?: string | undefined;
webViewLink?: string | undefined;
writersCanShare?: boolean | undefined;
}
interface FileCapabilities {
canAddChildren?: boolean | undefined;
canChangeCopyRequiresWriterPermission?: boolean | undefined;
canChangeRestrictedDownload?: boolean | undefined;
canComment?: boolean | undefined;
canCopy?: boolean | undefined;
canDelete?: boolean | undefined;
canDeleteChildren?: boolean | undefined;
canDownload?: boolean | undefined;
canEdit?: boolean | undefined;
canListChildren?: boolean | undefined;
canMoveChildrenOutOfDrive?: boolean | undefined;
canMoveChildrenOutOfTeamDrive?: boolean | undefined;
canMoveChildrenWithinDrive?: boolean | undefined;
canMoveChildrenWithinTeamDrive?: boolean | undefined;
canMoveItemIntoTeamDrive?: boolean | undefined;
canMoveItemOutOfDrive?: boolean | undefined;
canMoveItemOutOfTeamDrive?: boolean | undefined;
canMoveItemWithinDrive?: boolean | undefined;
canMoveItemWithinTeamDrive?: boolean | undefined;
canMoveTeamDriveItem?: boolean | undefined;
canReadRevisions?: boolean | undefined;
canReadDrive?: boolean | undefined;
canReadTeamDrive?: boolean | undefined;
canRemoveChildren?: boolean | undefined;
canRename?: boolean | undefined;
canShare?: boolean | undefined;
canTrash?: boolean | undefined;
canTrashChildren?: boolean | undefined;
canUntrash?: boolean | undefined;
}
interface FileImageMediaMetadata {
aperture?: number | undefined;
cameraMake?: string | undefined;
cameraModel?: string | undefined;
colorSpace?: string | undefined;
date?: string | undefined;
exposureBias?: number | undefined;
exposureMode?: string | undefined;
exposureTime?: number | undefined;
flashUsed?: boolean | undefined;
focalLength?: number | undefined;
height?: number | undefined;
isoSpeed?: number | undefined;
lens?: string | undefined;
location?: Drive.Schema.FileImageMediaMetadataLocation | undefined;
maxApertureValue?: number | undefined;
meteringMode?: string | undefined;
rotation?: number | undefined;
sensor?: string | undefined;
subjectDistance?: number | undefined;
whiteBalance?: string | undefined;
width?: number | undefined;
}
interface FileImageMediaMetadataLocation {
altitude?: number | undefined;
latitude?: number | undefined;
longitude?: number | undefined;
}
interface FileIndexableText {
text?: string | undefined;
}
interface FileLabels {
hidden?: boolean | undefined;
modified?: boolean | undefined;
restricted?: boolean | undefined;
starred?: boolean | undefined;
trashed?: boolean | undefined;
viewed?: boolean | undefined;
}
interface FileList {
etag?: string | undefined;
incompleteSearch?: boolean | undefined;
items?: Drive.Schema.File[] | undefined;
kind?: string | undefined;
nextLink?: string | undefined;
nextPageToken?: string | undefined;
selfLink?: string | undefined;
}
interface FileThumbnail {
image?: string | undefined;
mimeType?: string | undefined;
}
interface FileVideoMediaMetadata {
durationMillis?: string | undefined;
height?: number | undefined;
width?: number | undefined;
}
interface GeneratedIds {
ids?: string[] | undefined;
kind?: string | undefined;
space?: string | undefined;
}
interface ParentList {
etag?: string | undefined;
items?: Drive.Schema.ParentReference[] | undefined;
kind?: string | undefined;
selfLink?: string | undefined;
}
interface ParentReference {
id?: string | undefined;
isRoot?: boolean | undefined;
kind?: string | undefined;
parentLink?: string | undefined;
selfLink?: string | undefined;
}
interface Permission {
additionalRoles?: string[] | undefined;
authKey?: string | undefined;
deleted?: boolean | undefined;
domain?: string | undefined;
emailAddress?: string | undefined;
etag?: string | undefined;
expirationDate?: string | undefined;
id?: string | undefined;
kind?: string | undefined;
name?: string | undefined;
permissionDetails?: Drive.Schema.PermissionPermissionDetails[] | undefined;
photoLink?: string | undefined;
role?: "owner" | "organizer" | "fileOrganizer" | "writer" | "reader" | undefined;
selfLink?: string | undefined;
teamDrivePermissionDetails?: Drive.Schema.PermissionTeamDrivePermissionDetails[] | undefined;
type?: string | undefined;
value?: string | undefined;
withLink?: boolean | undefined;
}
interface PermissionId {
id?: string | undefined;
kind?: string | undefined;
}
interface PermissionList {
etag?: string | undefined;
items?: Drive.Schema.Permission[] | undefined;
kind?: string | undefined;
nextPageToken?: string | undefined;
selfLink?: string | undefined;
}
interface PermissionPermissionDetails {
additionalRoles?: string[] | undefined;
inherited?: boolean | undefined;
inheritedFrom?: string | undefined;
permissionType?: string | undefined;
role?: "organizer" | "fileOrganizer" | "writer" | "reader" | undefined;
}
interface PermissionTeamDrivePermissionDetails {
additionalRoles?: string[] | undefined;
inherited?: boolean | undefined;
inheritedFrom?: string | undefined;
role?: string | undefined;
teamDrivePermissionType?: string | undefined;
}
interface Property {
etag?: string | undefined;
key?: string | undefined;
kind?: string | undefined;
selfLink?: string | undefined;
value?: string | undefined;
visibility?: string | undefined;
}
interface PropertyList {
etag?: string | undefined;
items?: Drive.Schema.Property[] | undefined;
kind?: string | undefined;
selfLink?: string | undefined;
}
interface Revision {
downloadUrl?: string | undefined;
etag?: string | undefined;
exportLinks?: object | undefined;
fileSize?: string | undefined;
id?: string | undefined;
kind?: string | undefined;
lastModifyingUser?: Drive.Schema.User | undefined;
lastModifyingUserName?: string | undefined;
md5Checksum?: string | undefined;
mimeType?: string | undefined;
modifiedDate?: string | undefined;
originalFilename?: string | undefined;
pinned?: boolean | undefined;
publishAuto?: boolean | undefined;
published?: boolean | undefined;
publishedLink?: string | undefined;
publishedOutsideDomain?: boolean | undefined;
selfLink?: string | undefined;
}
interface RevisionList {
etag?: string | undefined;
items?: Drive.Schema.Revision[] | undefined;
kind?: string | undefined;
nextPageToken?: string | undefined;
selfLink?: string | undefined;
}
interface ShortcutDetails {
targetId?: string | undefined;
targetMimeType?: string | undefined;
}
interface StartPageToken {
kind?: string | undefined;
startPageToken?: string | undefined;
}
interface TeamDrive {
backgroundImageFile?: Drive.Schema.TeamDriveBackgroundImageFile | undefined;
backgroundImageLink?: string | undefined;
capabilities?: Drive.Schema.TeamDriveCapabilities | undefined;
colorRgb?: string | undefined;
createdDate?: string | undefined;
id?: string | undefined;
kind?: string | undefined;
name?: string | undefined;
restrictions?: Drive.Schema.TeamDriveRestrictions | undefined;
themeId?: string | undefined;
}
interface TeamDriveBackgroundImageFile {
id?: string | undefined;
width?: number | undefined;
xCoordinate?: number | undefined;
yCoordinate?: number | undefined;
}
interface TeamDriveCapabilities {
canAddChildren?: boolean | undefined;
canChangeCopyRequiresWriterPermissionRestriction?: boolean | undefined;
canChangeDomainUsersOnlyRestriction?: boolean | undefined;
canChangeTeamDriveBackground?: boolean | undefined;
canChangeTeamMembersOnlyRestriction?: boolean | undefined;
canComment?: boolean | undefined;
canCopy?: boolean | undefined;
canDeleteChildren?: boolean | undefined;
canDeleteTeamDrive?: boolean | undefined;
canDownload?: boolean | undefined;
canEdit?: boolean | undefined;
canListChildren?: boolean | undefined;
canManageMembers?: boolean | undefined;
canReadRevisions?: boolean | undefined;
canRemoveChildren?: boolean | undefined;
canRename?: boolean | undefined;
canRenameTeamDrive?: boolean | undefined;
canShare?: boolean | undefined;
canTrashChildren?: boolean | undefined;
}
interface TeamDriveList {
items?: Drive.Schema.TeamDrive[] | undefined;
kind?: string | undefined;
nextPageToken?: string | undefined;
}
interface TeamDriveRestrictions {
adminManagedRestrictions?: boolean | undefined;
copyRequiresWriterPermission?: boolean | undefined;
domainUsersOnly?: boolean | undefined;
teamMembersOnly?: boolean | undefined;
}
interface User {
displayName?: string | undefined;
emailAddress?: string | undefined;
isAuthenticatedUser?: boolean | undefined;
kind?: string | undefined;
permissionId?: string | undefined;
picture?: Drive.Schema.UserPicture | undefined;
}
interface UserPicture {
url?: string | undefined;
}
}
}
interface Drive {
About?: Drive.Collection.AboutCollection | undefined;
Apps?: Drive.Collection.AppsCollection | undefined;
Changes?: Drive.Collection.ChangesCollection | undefined;
Channels?: Drive.Collection.ChannelsCollection | undefined;
Children?: Drive.Collection.ChildrenCollection | undefined;
Comments?: Drive.Collection.CommentsCollection | undefined;
Drives?: Drive.Collection.DrivesCollection | undefined;
Files?: Drive.Collection.FilesCollection | undefined;
Parents?: Drive.Collection.ParentsCollection | undefined;
Permissions?: Drive.Collection.PermissionsCollection | undefined;
Properties?: Drive.Collection.PropertiesCollection | undefined;
Realtime?: Drive.Collection.RealtimeCollection | undefined;
Replies?: Drive.Collection.RepliesCollection | undefined;
Revisions?: Drive.Collection.RevisionsCollection | undefined;
Teamdrives?: Drive.Collection.TeamdrivesCollection | undefined;
// Create a new instance of Channel
newChannel(): Drive.Schema.Channel;
// Create a new instance of ChildReference
newChildReference(): Drive.Schema.ChildReference;
// Create a new instance of Comment
newComment(): Drive.Schema.Comment;
// Create a new instance of CommentContext
newCommentContext(): Drive.Schema.CommentContext;
// Create a new instance of CommentReply
newCommentReply(): Drive.Schema.CommentReply;
// Create a new instance of Drive
newDrive(): Drive.Schema.Drive;
// Create a new instance of DriveBackgroundImageFile
newDriveBackgroundImageFile(): Drive.Schema.DriveBackgroundImageFile;
// Create a new instance of DriveCapabilities
newDriveCapabilities(): Drive.Schema.DriveCapabilities;
// Create a new instance of DriveRestrictions
newDriveRestrictions(): Drive.Schema.DriveRestrictions;
// Create a new instance of File
newFile(): Drive.Schema.File;
// Create a new instance of FileCapabilities
newFileCapabilities(): Drive.Schema.FileCapabilities;
// Create a new instance of FileImageMediaMetadata
newFileImageMediaMetadata(): Drive.Schema.FileImageMediaMetadata;
// Create a new instance of FileImageMediaMetadataLocation
newFileImageMediaMetadataLocation(): Drive.Schema.FileImageMediaMetadataLocation;
// Create a new instance of FileIndexableText
newFileIndexableText(): Drive.Schema.FileIndexableText;
// Create a new instance of FileLabels
newFileLabels(): Drive.Schema.FileLabels;
// Create a new instance of FileThumbnail
newFileThumbnail(): Drive.Schema.FileThumbnail;
// Create a new instance of FileVideoMediaMetadata
newFileVideoMediaMetadata(): Drive.Schema.FileVideoMediaMetadata;
// Create a new instance of ParentReference
newParentReference(): Drive.Schema.ParentReference;
// Create a new instance of Permission
newPermission(): Drive.Schema.Permission;
// Create a new instance of PermissionPermissionDetails
newPermissionPermissionDetails(): Drive.Schema.PermissionPermissionDetails;
// Create a new instance of PermissionTeamDrivePermissionDetails
newPermissionTeamDrivePermissionDetails(): Drive.Schema.PermissionTeamDrivePermissionDetails;
// Create a new instance of Property
newProperty(): Drive.Schema.Property;
// Create a new instance of Revision
newRevision(): Drive.Schema.Revision;
// Create a new instance of TeamDrive
newTeamDrive(): Drive.Schema.TeamDrive;
// Create a new instance of TeamDriveBackgroundImageFile
newTeamDriveBackgroundImageFile(): Drive.Schema.TeamDriveBackgroundImageFile;
// Create a new instance of TeamDriveCapabilities
newTeamDriveCapabilities(): Drive.Schema.TeamDriveCapabilities;
// Create a new instance of TeamDriveRestrictions
newTeamDriveRestrictions(): Drive.Schema.TeamDriveRestrictions;
// Create a new instance of User
newUser(): Drive.Schema.User;
// Create a new instance of UserPicture
newUserPicture(): Drive.Schema.UserPicture;
}
}
declare var Drive: GoogleAppsScript.Drive;

View File

@ -0,0 +1,219 @@
declare namespace GoogleAppsScript {
namespace DriveActivity {
namespace Collection {
interface ActivityCollection {
// Query past activity in Google Drive.
query(resource: Schema.QueryDriveActivityRequest): DriveActivity.Schema.QueryDriveActivityResponse;
}
}
namespace Schema {
interface Action {
actor?: DriveActivity.Schema.Actor | undefined;
detail?: DriveActivity.Schema.ActionDetail | undefined;
target?: DriveActivity.Schema.Target | undefined;
timeRange?: DriveActivity.Schema.TimeRange | undefined;
timestamp?: string | undefined;
}
interface ActionDetail {
comment?: DriveActivity.Schema.Comment | undefined;
create?: DriveActivity.Schema.Create | undefined;
delete?: DriveActivity.Schema.Delete | undefined;
dlpChange?: DriveActivity.Schema.DataLeakPreventionChange | undefined;
edit?: any;
move?: DriveActivity.Schema.Move | undefined;
permissionChange?: DriveActivity.Schema.PermissionChange | undefined;
reference?: DriveActivity.Schema.ApplicationReference | undefined;
rename?: DriveActivity.Schema.Rename | undefined;
restore?: DriveActivity.Schema.Restore | undefined;
settingsChange?: DriveActivity.Schema.SettingsChange | undefined;
}
interface Actor {
administrator?: string | undefined;
anonymous?: string | undefined;
impersonation?: DriveActivity.Schema.Impersonation | undefined;
system?: DriveActivity.Schema.SystemEvent | undefined;
user?: DriveActivity.Schema.User | undefined;
}
interface ApplicationReference {
type?: string | undefined;
}
interface Assignment {
subtype?: string | undefined;
}
interface Comment {
assignment?: DriveActivity.Schema.Assignment | undefined;
mentionedUsers?: DriveActivity.Schema.User[] | undefined;
post?: DriveActivity.Schema.Post | undefined;
suggestion?: DriveActivity.Schema.Suggestion | undefined;
}
interface ConsolidationStrategy {
legacy?: any;
none?: any;
}
interface Copy {
originalObject?: DriveActivity.Schema.TargetReference | undefined;
}
interface Create {
copy?: DriveActivity.Schema.Copy | undefined;
new?: any;
upload?: any;
}
interface DataLeakPreventionChange {
type?: string | undefined;
}
interface Delete {
type?: string | undefined;
}
interface Domain {
legacyId?: string | undefined;
name?: string | undefined;
}
interface DriveActivity {
actions?: DriveActivity.Schema.Action[] | undefined;
actors?: DriveActivity.Schema.Actor[] | undefined;
primaryActionDetail?: DriveActivity.Schema.ActionDetail | undefined;
targets?: DriveActivity.Schema.Target[] | undefined;
timeRange?: DriveActivity.Schema.TimeRange | undefined;
timestamp?: string | undefined;
}
interface DriveItem {
/** @deprecated Use driveFile instead. */
file?: any;
/** @deprecated Use driveFolder instead. */
folder?: DriveActivity.Schema.Folder | undefined;
mimeType?: string | undefined;
name?: string | undefined;
owner?: DriveActivity.Schema.Owner | undefined;
title?: string | undefined;
driveFile?: any;
driveFolder?: DriveActivity.Schema.Folder;
}
interface DriveItemReference {
// file is deprecated; please use the driveFile instead.
file?: any;
// folder is deprecated; please use the driveFolder instead.
folder?: DriveActivity.Schema.Folder | undefined;
name?: string | undefined;
title?: string | undefined;
driveFile?: any;
driveFolder?: DriveActivity.Schema.Folder;
}
interface FileComment {
legacyCommentId?: string | undefined;
legacyDiscussionId?: string | undefined;
linkToDiscussion?: string | undefined;
parent?: DriveActivity.Schema.DriveItem | undefined;
}
interface Folder {
type?: string | undefined;
}
interface Group {
email?: string | undefined;
title?: string | undefined;
}
interface Impersonation {
impersonatedUser?: DriveActivity.Schema.User | undefined;
}
interface KnownUser {
isCurrentUser?: boolean | undefined;
personName?: string | undefined;
}
interface Move {
addedParents?: DriveActivity.Schema.TargetReference[] | undefined;
removedParents?: DriveActivity.Schema.TargetReference[] | undefined;
}
interface Owner {
domain?: DriveActivity.Schema.Domain | undefined;
teamDrive?: DriveActivity.Schema.TeamDriveReference | undefined;
user?: DriveActivity.Schema.User | undefined;
}
interface Permission {
allowDiscovery?: boolean | undefined;
anyone?: any;
domain?: DriveActivity.Schema.Domain | undefined;
group?: DriveActivity.Schema.Group | undefined;
role?: string | undefined;
user?: DriveActivity.Schema.User | undefined;
}
interface PermissionChange {
addedPermissions?: DriveActivity.Schema.Permission[] | undefined;
removedPermissions?: DriveActivity.Schema.Permission[] | undefined;
}
interface Post {
subtype?: string | undefined;
}
interface QueryDriveActivityRequest {
ancestorName?: string | undefined;
consolidationStrategy?: DriveActivity.Schema.ConsolidationStrategy | undefined;
filter?: string | undefined;
itemName?: string | undefined;
pageSize?: number | undefined;
pageToken?: string | undefined;
}
interface QueryDriveActivityResponse {
activities?: DriveActivity.Schema.DriveActivity[] | undefined;
nextPageToken?: string | undefined;
}
interface Rename {
newTitle?: string | undefined;
oldTitle?: string | undefined;
}
interface Restore {
type?: string | undefined;
}
interface RestrictionChange {
feature?: string | undefined;
newRestriction?: string | undefined;
}
interface SettingsChange {
restrictionChanges?: DriveActivity.Schema.RestrictionChange[] | undefined;
}
interface Suggestion {
subtype?: string | undefined;
}
interface SystemEvent {
type?: string | undefined;
}
interface Target {
driveItem?: DriveActivity.Schema.DriveItem | undefined;
fileComment?: any;
teamDrive?: DriveActivity.Schema.TeamDrive | undefined;
}
interface TargetReference {
driveItem?: DriveActivity.Schema.DriveItemReference | undefined;
teamDrive?: DriveActivity.Schema.TeamDriveReference | undefined;
}
interface TeamDrive {
name?: string | undefined;
root?: DriveActivity.Schema.DriveItem | undefined;
title?: string | undefined;
}
interface TeamDriveReference {
name?: string | undefined;
title?: string | undefined;
}
interface TimeRange {
endTime?: string | undefined;
startTime?: string | undefined;
}
interface User {
deletedUser?: any;
knownUser?: DriveActivity.Schema.KnownUser | undefined;
unknownUser?: any;
}
}
}
interface DriveActivity {
Activity?: DriveActivity.Collection.ActivityCollection | undefined;
// Create a new instance of ConsolidationStrategy
newConsolidationStrategy(): DriveActivity.Schema.ConsolidationStrategy;
// Create a new instance of Legacy
newLegacy(): any;
// Create a new instance of NoConsolidation
newNoConsolidation(): any;
// Create a new instance of QueryDriveActivityRequest
newQueryDriveActivityRequest(): DriveActivity.Schema.QueryDriveActivityRequest;
}
}
declare var DriveActivity: GoogleAppsScript.DriveActivity;

View File

@ -0,0 +1,526 @@
declare namespace GoogleAppsScript {
namespace Gmail {
namespace Collection {
namespace Users {
namespace Messages {
interface AttachmentsCollection {
// Gets the specified message attachment.
get(userId: string, messageId: string, id: string): Gmail.Schema.MessagePartBody;
}
}
namespace Settings {
namespace SendAs {
interface SmimeInfoCollection {
// Gets the specified S/MIME config for the specified send-as alias.
get(userId: string, sendAsEmail: string, id: string): Gmail.Schema.SmimeInfo;
// Insert (upload) the given S/MIME config for the specified send-as alias. Note that pkcs12 format is required for the key.
insert(
resource: Schema.SmimeInfo,
userId: string,
sendAsEmail: string,
): Gmail.Schema.SmimeInfo;
// Lists S/MIME configs for the specified send-as alias.
list(userId: string, sendAsEmail: string): Gmail.Schema.ListSmimeInfoResponse;
// Deletes the specified S/MIME config for the specified send-as alias.
remove(userId: string, sendAsEmail: string, id: string): void;
// Sets the default S/MIME config for the specified send-as alias.
setDefault(userId: string, sendAsEmail: string, id: string): void;
}
}
interface DelegatesCollection {
// Adds a delegate with its verification status set directly to accepted, without sending any verification email. The delegate user must be a member of the same G Suite organization as the delegator user.
// Gmail imposes limtations on the number of delegates and delegators each user in a G Suite organization can have. These limits depend on your organization, but in general each user can have up to 25 delegates and up to 10 delegators.
// Note that a delegate user must be referred to by their primary email address, and not an email alias.
// Also note that when a new delegate is created, there may be up to a one minute delay before the new delegate is available for use.
// This method is only available to service account clients that have been delegated domain-wide authority.
create(resource: Schema.Delegate, userId: string): Gmail.Schema.Delegate;
// Gets the specified delegate.
// Note that a delegate user must be referred to by their primary email address, and not an email alias.
// This method is only available to service account clients that have been delegated domain-wide authority.
get(userId: string, delegateEmail: string): Gmail.Schema.Delegate;
// Lists the delegates for the specified account.
// This method is only available to service account clients that have been delegated domain-wide authority.
list(userId: string): Gmail.Schema.ListDelegatesResponse;
// Removes the specified delegate (which can be of any verification status), and revokes any verification that may have been required for using it.
// Note that a delegate user must be referred to by their primary email address, and not an email alias.
// This method is only available to service account clients that have been delegated domain-wide authority.
remove(userId: string, delegateEmail: string): void;
}
interface FiltersCollection {
// Creates a filter.
create(resource: Schema.Filter, userId: string): Gmail.Schema.Filter;
// Gets a filter.
get(userId: string, id: string): Gmail.Schema.Filter;
// Lists the message filters of a Gmail user.
list(userId: string): Gmail.Schema.ListFiltersResponse;
// Deletes a filter.
remove(userId: string, id: string): void;
}
interface ForwardingAddressesCollection {
// Creates a forwarding address. If ownership verification is required, a message will be sent to the recipient and the resource's verification status will be set to pending; otherwise, the resource will be created with verification status set to accepted.
// This method is only available to service account clients that have been delegated domain-wide authority.
create(resource: Schema.ForwardingAddress, userId: string): Gmail.Schema.ForwardingAddress;
// Gets the specified forwarding address.
get(userId: string, forwardingEmail: string): Gmail.Schema.ForwardingAddress;
// Lists the forwarding addresses for the specified account.
list(userId: string): Gmail.Schema.ListForwardingAddressesResponse;
// Deletes the specified forwarding address and revokes any verification that may have been required.
// This method is only available to service account clients that have been delegated domain-wide authority.
remove(userId: string, forwardingEmail: string): void;
}
interface SendAsCollection {
SmimeInfo?: Gmail.Collection.Users.Settings.SendAs.SmimeInfoCollection | undefined;
// Creates a custom "from" send-as alias. If an SMTP MSA is specified, Gmail will attempt to connect to the SMTP service to validate the configuration before creating the alias. If ownership verification is required for the alias, a message will be sent to the email address and the resource's verification status will be set to pending; otherwise, the resource will be created with verification status set to accepted. If a signature is provided, Gmail will sanitize the HTML before saving it with the alias.
// This method is only available to service account clients that have been delegated domain-wide authority.
create(resource: Schema.SendAs, userId: string): Gmail.Schema.SendAs;
// Gets the specified send-as alias. Fails with an HTTP 404 error if the specified address is not a member of the collection.
get(userId: string, sendAsEmail: string): Gmail.Schema.SendAs;
// Lists the send-as aliases for the specified account. The result includes the primary send-as address associated with the account as well as any custom "from" aliases.
list(userId: string): Gmail.Schema.ListSendAsResponse;
// Updates a send-as alias. If a signature is provided, Gmail will sanitize the HTML before saving it with the alias.
// Addresses other than the primary address for the account can only be updated by service account clients that have been delegated domain-wide authority. This method supports patch semantics.
patch(resource: Schema.SendAs, userId: string, sendAsEmail: string): Gmail.Schema.SendAs;
// Deletes the specified send-as alias. Revokes any verification that may have been required for using it.
// This method is only available to service account clients that have been delegated domain-wide authority.
remove(userId: string, sendAsEmail: string): void;
// Updates a send-as alias. If a signature is provided, Gmail will sanitize the HTML before saving it with the alias.
// Addresses other than the primary address for the account can only be updated by service account clients that have been delegated domain-wide authority.
update(resource: Schema.SendAs, userId: string, sendAsEmail: string): Gmail.Schema.SendAs;
// Sends a verification email to the specified send-as alias address. The verification status must be pending.
// This method is only available to service account clients that have been delegated domain-wide authority.
verify(userId: string, sendAsEmail: string): void;
}
}
interface DraftsCollection {
// Creates a new draft with the DRAFT label.
create(resource: Schema.Draft, userId: string): Gmail.Schema.Draft;
// Creates a new draft with the DRAFT label.
create(resource: Schema.Draft, userId: string, mediaData: any): Gmail.Schema.Draft;
// Gets the specified draft.
get(userId: string, id: string): Gmail.Schema.Draft;
// Gets the specified draft.
get(userId: string, id: string, optionalArgs: object): Gmail.Schema.Draft;
// Lists the drafts in the user's mailbox.
list(userId: string): Gmail.Schema.ListDraftsResponse;
// Lists the drafts in the user's mailbox.
list(userId: string, optionalArgs: object): Gmail.Schema.ListDraftsResponse;
// Immediately and permanently deletes the specified draft. Does not simply trash it.
remove(userId: string, id: string): void;
// Sends the specified, existing draft to the recipients in the To, Cc, and Bcc headers.
send(resource: Schema.Draft, userId: string): Gmail.Schema.Message;
// Sends the specified, existing draft to the recipients in the To, Cc, and Bcc headers.
send(resource: Schema.Draft, userId: string, mediaData: any): Gmail.Schema.Message;
// Replaces a draft's content.
update(resource: Schema.Draft, userId: string, id: string): Gmail.Schema.Draft;
// Replaces a draft's content.
update(resource: Schema.Draft, userId: string, id: string, mediaData: any): Gmail.Schema.Draft;
}
interface HistoryCollection {
// Lists the history of all changes to the given mailbox. History results are returned in chronological order (increasing historyId).
list(userId: string): Gmail.Schema.ListHistoryResponse;
// Lists the history of all changes to the given mailbox. History results are returned in chronological order (increasing historyId).
list(userId: string, optionalArgs: object): Gmail.Schema.ListHistoryResponse;
}
interface LabelsCollection {
// Creates a new label.
create(resource: Schema.Label, userId: string): Gmail.Schema.Label;
// Gets the specified label.
get(userId: string, id: string): Gmail.Schema.Label;
// Lists all labels in the user's mailbox.
list(userId: string): Gmail.Schema.ListLabelsResponse;
// Updates the specified label. This method supports patch semantics.
patch(resource: Schema.Label, userId: string, id: string): Gmail.Schema.Label;
// Immediately and permanently deletes the specified label and removes it from any messages and threads that it is applied to.
remove(userId: string, id: string): void;
// Updates the specified label.
update(resource: Schema.Label, userId: string, id: string): Gmail.Schema.Label;
}
interface MessagesCollection {
Attachments?: Gmail.Collection.Users.Messages.AttachmentsCollection | undefined;
// Deletes many messages by message ID. Provides no guarantees that messages were not already deleted or even existed at all.
batchDelete(resource: Schema.BatchDeleteMessagesRequest, userId: string): void;
// Modifies the labels on the specified messages.
batchModify(resource: Schema.BatchModifyMessagesRequest, userId: string): void;
// Gets the specified message.
get(userId: string, id: string): Gmail.Schema.Message;
// Gets the specified message.
get(userId: string, id: string, optionalArgs: object): Gmail.Schema.Message;
// Imports a message into only this user's mailbox, with standard email delivery scanning and classification similar to receiving via SMTP. Does not send a message.
import(resource: Schema.Message, userId: string): Gmail.Schema.Message;
// Imports a message into only this user's mailbox, with standard email delivery scanning and classification similar to receiving via SMTP. Does not send a message.
import(resource: Schema.Message, userId: string, mediaData: any): Gmail.Schema.Message;
// Imports a message into only this user's mailbox, with standard email delivery scanning and classification similar to receiving via SMTP. Does not send a message.
import(
resource: Schema.Message,
userId: string,
mediaData: any,
optionalArgs: object,
): Gmail.Schema.Message;
// Directly inserts a message into only this user's mailbox similar to IMAP APPEND, bypassing most scanning and classification. Does not send a message.
insert(resource: Schema.Message, userId: string): Gmail.Schema.Message;
// Directly inserts a message into only this user's mailbox similar to IMAP APPEND, bypassing most scanning and classification. Does not send a message.
insert(resource: Schema.Message, userId: string, mediaData: any): Gmail.Schema.Message;
// Directly inserts a message into only this user's mailbox similar to IMAP APPEND, bypassing most scanning and classification. Does not send a message.
insert(
resource: Schema.Message,
userId: string,
mediaData: any,
optionalArgs: object,
): Gmail.Schema.Message;
// Lists the messages in the user's mailbox.
list(userId: string): Gmail.Schema.ListMessagesResponse;
// Lists the messages in the user's mailbox.
list(userId: string, optionalArgs: object): Gmail.Schema.ListMessagesResponse;
// Modifies the labels on the specified message.
modify(resource: Schema.ModifyMessageRequest, userId: string, id: string): Gmail.Schema.Message;
// Immediately and permanently deletes the specified message. This operation cannot be undone. Prefer messages.trash instead.
remove(userId: string, id: string): void;
// Sends the specified message to the recipients in the To, Cc, and Bcc headers.
send(resource: Schema.Message, userId: string): Gmail.Schema.Message;
// Sends the specified message to the recipients in the To, Cc, and Bcc headers.
send(resource: Schema.Message, userId: string, mediaData: any): Gmail.Schema.Message;
// Moves the specified message to the trash.
trash(userId: string, id: string): Gmail.Schema.Message;
// Removes the specified message from the trash.
untrash(userId: string, id: string): Gmail.Schema.Message;
}
interface SettingsCollection {
Delegates?: Gmail.Collection.Users.Settings.DelegatesCollection | undefined;
Filters?: Gmail.Collection.Users.Settings.FiltersCollection | undefined;
ForwardingAddresses?: Gmail.Collection.Users.Settings.ForwardingAddressesCollection | undefined;
SendAs?: Gmail.Collection.Users.Settings.SendAsCollection | undefined;
// Gets the auto-forwarding setting for the specified account.
getAutoForwarding(userId: string): Gmail.Schema.AutoForwarding;
// Gets IMAP settings.
getImap(userId: string): Gmail.Schema.ImapSettings;
// Gets POP settings.
getPop(userId: string): Gmail.Schema.PopSettings;
// Gets vacation responder settings.
getVacation(userId: string): Gmail.Schema.VacationSettings;
// Updates the auto-forwarding setting for the specified account. A verified forwarding address must be specified when auto-forwarding is enabled.
// This method is only available to service account clients that have been delegated domain-wide authority.
updateAutoForwarding(resource: Schema.AutoForwarding, userId: string): Gmail.Schema.AutoForwarding;
// Updates IMAP settings.
updateImap(resource: Schema.ImapSettings, userId: string): Gmail.Schema.ImapSettings;
// Updates POP settings.
updatePop(resource: Schema.PopSettings, userId: string): Gmail.Schema.PopSettings;
// Updates vacation responder settings.
updateVacation(resource: Schema.VacationSettings, userId: string): Gmail.Schema.VacationSettings;
}
interface ThreadsCollection {
// Gets the specified thread.
get(userId: string, id: string): Gmail.Schema.Thread;
// Gets the specified thread.
get(userId: string, id: string, optionalArgs: object): Gmail.Schema.Thread;
// Lists the threads in the user's mailbox.
list(userId: string): Gmail.Schema.ListThreadsResponse;
// Lists the threads in the user's mailbox.
list(userId: string, optionalArgs: object): Gmail.Schema.ListThreadsResponse;
// Modifies the labels applied to the thread. This applies to all messages in the thread.
modify(resource: Schema.ModifyThreadRequest, userId: string, id: string): Gmail.Schema.Thread;
// Immediately and permanently deletes the specified thread. This operation cannot be undone. Prefer threads.trash instead.
remove(userId: string, id: string): void;
// Moves the specified thread to the trash.
trash(userId: string, id: string): Gmail.Schema.Thread;
// Removes the specified thread from the trash.
untrash(userId: string, id: string): Gmail.Schema.Thread;
}
}
interface UsersCollection {
Drafts?: Gmail.Collection.Users.DraftsCollection | undefined;
History?: Gmail.Collection.Users.HistoryCollection | undefined;
Labels?: Gmail.Collection.Users.LabelsCollection | undefined;
Messages?: Gmail.Collection.Users.MessagesCollection | undefined;
Settings?: Gmail.Collection.Users.SettingsCollection | undefined;
Threads?: Gmail.Collection.Users.ThreadsCollection | undefined;
// Gets the current user's Gmail profile.
getProfile(userId: string): Gmail.Schema.Profile;
// Stop receiving push notifications for the given user mailbox.
stop(userId: string): void;
// Set up or update a push notification watch on the given user mailbox.
watch(resource: Schema.WatchRequest, userId: string): Gmail.Schema.WatchResponse;
}
}
namespace Schema {
interface AutoForwarding {
disposition?: string | undefined;
emailAddress?: string | undefined;
enabled?: boolean | undefined;
}
interface BatchDeleteMessagesRequest {
ids?: string[] | undefined;
}
interface BatchModifyMessagesRequest {
addLabelIds?: string[] | undefined;
ids?: string[] | undefined;
removeLabelIds?: string[] | undefined;
}
interface Delegate {
delegateEmail?: string | undefined;
verificationStatus?: string | undefined;
}
interface Draft {
id?: string | undefined;
message?: Gmail.Schema.Message | undefined;
}
interface Filter {
action?: Gmail.Schema.FilterAction | undefined;
criteria?: Gmail.Schema.FilterCriteria | undefined;
id?: string | undefined;
}
interface FilterAction {
addLabelIds?: string[] | undefined;
forward?: string | undefined;
removeLabelIds?: string[] | undefined;
}
interface FilterCriteria {
excludeChats?: boolean | undefined;
from?: string | undefined;
hasAttachment?: boolean | undefined;
negatedQuery?: string | undefined;
query?: string | undefined;
size?: number | undefined;
sizeComparison?: string | undefined;
subject?: string | undefined;
to?: string | undefined;
}
interface ForwardingAddress {
forwardingEmail?: string | undefined;
verificationStatus?: string | undefined;
}
interface History {
id?: string | undefined;
labelsAdded?: Gmail.Schema.HistoryLabelAdded[] | undefined;
labelsRemoved?: Gmail.Schema.HistoryLabelRemoved[] | undefined;
messages?: Gmail.Schema.Message[] | undefined;
messagesAdded?: Gmail.Schema.HistoryMessageAdded[] | undefined;
messagesDeleted?: Gmail.Schema.HistoryMessageDeleted[] | undefined;
}
interface HistoryLabelAdded {
labelIds?: string[] | undefined;
message?: Gmail.Schema.Message | undefined;
}
interface HistoryLabelRemoved {
labelIds?: string[] | undefined;
message?: Gmail.Schema.Message | undefined;
}
interface HistoryMessageAdded {
message?: Gmail.Schema.Message | undefined;
}
interface HistoryMessageDeleted {
message?: Gmail.Schema.Message | undefined;
}
interface ImapSettings {
autoExpunge?: boolean | undefined;
enabled?: boolean | undefined;
expungeBehavior?: string | undefined;
maxFolderSize?: number | undefined;
}
interface Label {
color?: Gmail.Schema.LabelColor | undefined;
id?: string | undefined;
labelListVisibility?: string | undefined;
messageListVisibility?: string | undefined;
messagesTotal?: number | undefined;
messagesUnread?: number | undefined;
name?: string | undefined;
threadsTotal?: number | undefined;
threadsUnread?: number | undefined;
type?: string | undefined;
}
interface LabelColor {
backgroundColor?: string | undefined;
textColor?: string | undefined;
}
interface ListDelegatesResponse {
delegates?: Gmail.Schema.Delegate[] | undefined;
}
interface ListDraftsResponse {
drafts?: Gmail.Schema.Draft[] | undefined;
nextPageToken?: string | undefined;
resultSizeEstimate?: number | undefined;
}
interface ListFiltersResponse {
filter?: Gmail.Schema.Filter[] | undefined;
}
interface ListForwardingAddressesResponse {
forwardingAddresses?: Gmail.Schema.ForwardingAddress[] | undefined;
}
interface ListHistoryResponse {
history?: Gmail.Schema.History[] | undefined;
historyId?: string | undefined;
nextPageToken?: string | undefined;
}
interface ListLabelsResponse {
labels?: Gmail.Schema.Label[] | undefined;
}
interface ListMessagesResponse {
messages?: Gmail.Schema.Message[] | undefined;
nextPageToken?: string | undefined;
resultSizeEstimate?: number | undefined;
}
interface ListSendAsResponse {
sendAs?: Gmail.Schema.SendAs[] | undefined;
}
interface ListSmimeInfoResponse {
smimeInfo?: Gmail.Schema.SmimeInfo[] | undefined;
}
interface ListThreadsResponse {
nextPageToken?: string | undefined;
resultSizeEstimate?: number | undefined;
threads?: Gmail.Schema.Thread[] | undefined;
}
interface Message {
historyId?: string | undefined;
id?: string | undefined;
internalDate?: string | undefined;
labelIds?: string[] | undefined;
payload?: Gmail.Schema.MessagePart | undefined;
raw?: string | undefined;
sizeEstimate?: number | undefined;
snippet?: string | undefined;
threadId?: string | undefined;
}
interface MessagePart {
body?: Gmail.Schema.MessagePartBody | undefined;
filename?: string | undefined;
headers?: Gmail.Schema.MessagePartHeader[] | undefined;
mimeType?: string | undefined;
partId?: string | undefined;
parts?: Gmail.Schema.MessagePart[] | undefined;
}
interface MessagePartBody {
attachmentId?: string | undefined;
data?: string | undefined;
size?: number | undefined;
}
interface MessagePartHeader {
name?: string | undefined;
value?: string | undefined;
}
interface ModifyMessageRequest {
addLabelIds?: string[] | undefined;
removeLabelIds?: string[] | undefined;
}
interface ModifyThreadRequest {
addLabelIds?: string[] | undefined;
removeLabelIds?: string[] | undefined;
}
interface PopSettings {
accessWindow?: string | undefined;
disposition?: string | undefined;
}
interface Profile {
emailAddress?: string | undefined;
historyId?: string | undefined;
messagesTotal?: number | undefined;
threadsTotal?: number | undefined;
}
interface SendAs {
displayName?: string | undefined;
isDefault?: boolean | undefined;
isPrimary?: boolean | undefined;
replyToAddress?: string | undefined;
sendAsEmail?: string | undefined;
signature?: string | undefined;
smtpMsa?: Gmail.Schema.SmtpMsa | undefined;
treatAsAlias?: boolean | undefined;
verificationStatus?: string | undefined;
}
interface SmimeInfo {
encryptedKeyPassword?: string | undefined;
expiration?: string | undefined;
id?: string | undefined;
isDefault?: boolean | undefined;
issuerCn?: string | undefined;
pem?: string | undefined;
pkcs12?: string | undefined;
}
interface SmtpMsa {
host?: string | undefined;
password?: string | undefined;
port?: number | undefined;
securityMode?: string | undefined;
username?: string | undefined;
}
interface Thread {
historyId?: string | undefined;
id?: string | undefined;
messages?: Gmail.Schema.Message[] | undefined;
snippet?: string | undefined;
}
interface VacationSettings {
enableAutoReply?: boolean | undefined;
endTime?: string | undefined;
responseBodyHtml?: string | undefined;
responseBodyPlainText?: string | undefined;
responseSubject?: string | undefined;
restrictToContacts?: boolean | undefined;
restrictToDomain?: boolean | undefined;
startTime?: string | undefined;
}
interface WatchRequest {
labelFilterAction?: string | undefined;
labelIds?: string[] | undefined;
topicName?: string | undefined;
}
interface WatchResponse {
expiration?: string | undefined;
historyId?: string | undefined;
}
}
}
interface Gmail {
Users?: Gmail.Collection.UsersCollection | undefined;
// Create a new instance of AutoForwarding
newAutoForwarding(): Gmail.Schema.AutoForwarding;
// Create a new instance of BatchDeleteMessagesRequest
newBatchDeleteMessagesRequest(): Gmail.Schema.BatchDeleteMessagesRequest;
// Create a new instance of BatchModifyMessagesRequest
newBatchModifyMessagesRequest(): Gmail.Schema.BatchModifyMessagesRequest;
// Create a new instance of Delegate
newDelegate(): Gmail.Schema.Delegate;
// Create a new instance of Draft
newDraft(): Gmail.Schema.Draft;
// Create a new instance of Filter
newFilter(): Gmail.Schema.Filter;
// Create a new instance of FilterAction
newFilterAction(): Gmail.Schema.FilterAction;
// Create a new instance of FilterCriteria
newFilterCriteria(): Gmail.Schema.FilterCriteria;
// Create a new instance of ForwardingAddress
newForwardingAddress(): Gmail.Schema.ForwardingAddress;
// Create a new instance of ImapSettings
newImapSettings(): Gmail.Schema.ImapSettings;
// Create a new instance of Label
newLabel(): Gmail.Schema.Label;
// Create a new instance of LabelColor
newLabelColor(): Gmail.Schema.LabelColor;
// Create a new instance of Message
newMessage(): Gmail.Schema.Message;
// Create a new instance of MessagePart
newMessagePart(): Gmail.Schema.MessagePart;
// Create a new instance of MessagePartBody
newMessagePartBody(): Gmail.Schema.MessagePartBody;
// Create a new instance of MessagePartHeader
newMessagePartHeader(): Gmail.Schema.MessagePartHeader;
// Create a new instance of ModifyMessageRequest
newModifyMessageRequest(): Gmail.Schema.ModifyMessageRequest;
// Create a new instance of ModifyThreadRequest
newModifyThreadRequest(): Gmail.Schema.ModifyThreadRequest;
// Create a new instance of PopSettings
newPopSettings(): Gmail.Schema.PopSettings;
// Create a new instance of SendAs
newSendAs(): Gmail.Schema.SendAs;
// Create a new instance of SmimeInfo
newSmimeInfo(): Gmail.Schema.SmimeInfo;
// Create a new instance of SmtpMsa
newSmtpMsa(): Gmail.Schema.SmtpMsa;
// Create a new instance of VacationSettings
newVacationSettings(): Gmail.Schema.VacationSettings;
// Create a new instance of WatchRequest
newWatchRequest(): Gmail.Schema.WatchRequest;
}
}
declare var Gmail: GoogleAppsScript.Gmail;

View File

@ -0,0 +1,23 @@
declare namespace GoogleAppsScript {
namespace AdminGroupsMigration {
namespace Collection {
interface ArchiveCollection {
// Inserts a new mail into the archive of the Google group.
insert(groupId: string): AdminGroupsMigration.Schema.Groups;
// Inserts a new mail into the archive of the Google group.
insert(groupId: string, mediaData: any): AdminGroupsMigration.Schema.Groups;
}
}
namespace Schema {
interface Groups {
kind?: string | undefined;
responseCode?: string | undefined;
}
}
}
interface AdminGroupsMigration {
Archive?: AdminGroupsMigration.Collection.ArchiveCollection | undefined;
}
}
declare var AdminGroupsMigration: GoogleAppsScript.AdminGroupsMigration;

View File

@ -0,0 +1,86 @@
declare namespace GoogleAppsScript {
namespace AdminGroupsSettings {
namespace Collection {
interface GroupsCollection {
// Gets one resource by id.
get(groupUniqueId: string): AdminGroupsSettings.Schema.Groups;
// Updates an existing resource. This method supports patch semantics.
patch(resource: Schema.Groups, groupUniqueId: string): AdminGroupsSettings.Schema.Groups;
// Updates an existing resource.
update(resource: Schema.Groups, groupUniqueId: string): AdminGroupsSettings.Schema.Groups;
}
}
namespace Schema {
interface Groups {
allowExternalMembers?: string | undefined;
allowGoogleCommunication?: string | undefined;
allowWebPosting?: string | undefined;
archiveOnly?: string | undefined;
customFooterText?: string | undefined;
customReplyTo?: string | undefined;
customRolesEnabledForSettingsToBeMerged?: string | undefined;
defaultMessageDenyNotificationText?: string | undefined;
description?: string | undefined;
email?: string | undefined;
enableCollaborativeInbox?: string | undefined;
favoriteRepliesOnTop?: string | undefined;
includeCustomFooter?: string | undefined;
includeInGlobalAddressList?: string | undefined;
isArchived?: string | undefined;
kind?: string | undefined;
maxMessageBytes?: number | undefined;
membersCanPostAsTheGroup?: string | undefined;
messageDisplayFont?: string | undefined;
messageModerationLevel?: string | undefined;
name?: string | undefined;
primaryLanguage?: string | undefined;
replyTo?: string | undefined;
sendMessageDenyNotification?: string | undefined;
showInGroupDirectory?: string | undefined;
spamModerationLevel?: string | undefined;
whoCanAdd?: string | undefined;
whoCanAddReferences?: string | undefined;
whoCanApproveMembers?: string | undefined;
whoCanApproveMessages?: string | undefined;
whoCanAssignTopics?: string | undefined;
whoCanAssistContent?: string | undefined;
whoCanBanUsers?: string | undefined;
whoCanContactOwner?: string | undefined;
whoCanDeleteAnyPost?: string | undefined;
whoCanDeleteTopics?: string | undefined;
whoCanDiscoverGroup?: string | undefined;
whoCanEnterFreeFormTags?: string | undefined;
whoCanHideAbuse?: string | undefined;
whoCanInvite?: string | undefined;
whoCanJoin?: string | undefined;
whoCanLeaveGroup?: string | undefined;
whoCanLockTopics?: string | undefined;
whoCanMakeTopicsSticky?: string | undefined;
whoCanMarkDuplicate?: string | undefined;
whoCanMarkFavoriteReplyOnAnyTopic?: string | undefined;
whoCanMarkFavoriteReplyOnOwnTopic?: string | undefined;
whoCanMarkNoResponseNeeded?: string | undefined;
whoCanModerateContent?: string | undefined;
whoCanModerateMembers?: string | undefined;
whoCanModifyMembers?: string | undefined;
whoCanModifyTagsAndCategories?: string | undefined;
whoCanMoveTopicsIn?: string | undefined;
whoCanMoveTopicsOut?: string | undefined;
whoCanPostAnnouncements?: string | undefined;
whoCanPostMessage?: string | undefined;
whoCanTakeTopics?: string | undefined;
whoCanUnassignTopic?: string | undefined;
whoCanUnmarkFavoriteReplyOnAnyTopic?: string | undefined;
whoCanViewGroup?: string | undefined;
whoCanViewMembership?: string | undefined;
}
}
}
interface AdminGroupsSettings {
Groups?: AdminGroupsSettings.Collection.GroupsCollection | undefined;
// Create a new instance of Groups
newGroups(): AdminGroupsSettings.Schema.Groups;
}
}
declare var AdminGroupsSettings: GoogleAppsScript.AdminGroupsSettings;

View File

@ -0,0 +1,83 @@
declare namespace GoogleAppsScript {
namespace AdminLicenseManager {
namespace Collection {
interface LicenseAssignmentsCollection {
// Get license assignment of a particular product and sku for a user
get(productId: string, skuId: string, userId: string): AdminLicenseManager.Schema.LicenseAssignment;
// Assign License.
insert(
resource: Schema.LicenseAssignmentInsert,
productId: string,
skuId: string,
): AdminLicenseManager.Schema.LicenseAssignment;
// List license assignments for given product of the customer.
listForProduct(productId: string, customerId: string): AdminLicenseManager.Schema.LicenseAssignmentList;
// List license assignments for given product of the customer.
listForProduct(
productId: string,
customerId: string,
optionalArgs: object,
): AdminLicenseManager.Schema.LicenseAssignmentList;
// List license assignments for given product and sku of the customer.
listForProductAndSku(
productId: string,
skuId: string,
customerId: string,
): AdminLicenseManager.Schema.LicenseAssignmentList;
// List license assignments for given product and sku of the customer.
listForProductAndSku(
productId: string,
skuId: string,
customerId: string,
optionalArgs: object,
): AdminLicenseManager.Schema.LicenseAssignmentList;
// Assign License. This method supports patch semantics.
patch(
resource: Schema.LicenseAssignment,
productId: string,
skuId: string,
userId: string,
): AdminLicenseManager.Schema.LicenseAssignment;
// Revoke License.
remove(productId: string, skuId: string, userId: string): void;
// Assign License.
update(
resource: Schema.LicenseAssignment,
productId: string,
skuId: string,
userId: string,
): AdminLicenseManager.Schema.LicenseAssignment;
}
}
namespace Schema {
interface LicenseAssignment {
etags?: string | undefined;
kind?: string | undefined;
productId?: string | undefined;
productName?: string | undefined;
selfLink?: string | undefined;
skuId?: string | undefined;
skuName?: string | undefined;
userId?: string | undefined;
}
interface LicenseAssignmentInsert {
userId?: string | undefined;
}
interface LicenseAssignmentList {
etag?: string | undefined;
items?: AdminLicenseManager.Schema.LicenseAssignment[] | undefined;
kind?: string | undefined;
nextPageToken?: string | undefined;
}
}
}
interface AdminLicenseManager {
LicenseAssignments?: AdminLicenseManager.Collection.LicenseAssignmentsCollection | undefined;
// Create a new instance of LicenseAssignment
newLicenseAssignment(): AdminLicenseManager.Schema.LicenseAssignment;
// Create a new instance of LicenseAssignmentInsert
newLicenseAssignmentInsert(): AdminLicenseManager.Schema.LicenseAssignmentInsert;
}
}
declare var AdminLicenseManager: GoogleAppsScript.AdminLicenseManager;

View File

@ -0,0 +1,265 @@
declare namespace GoogleAppsScript {
namespace Mirror {
namespace Collection {
namespace Timeline {
interface AttachmentsCollection {
// Retrieves an attachment on a timeline item by item ID and attachment ID.
get(itemId: string, attachmentId: string): Mirror.Schema.Attachment;
// Adds a new attachment to a timeline item.
insert(itemId: string): Mirror.Schema.Attachment;
// Adds a new attachment to a timeline item.
insert(itemId: string, mediaData: any): Mirror.Schema.Attachment;
// Returns a list of attachments for a timeline item.
list(itemId: string): Mirror.Schema.AttachmentsListResponse;
// Deletes an attachment from a timeline item.
remove(itemId: string, attachmentId: string): void;
}
}
interface AccountsCollection {
// Inserts a new account for a user
insert(
resource: Schema.Account,
userToken: string,
accountType: string,
accountName: string,
): Mirror.Schema.Account;
}
interface ContactsCollection {
// Gets a single contact by ID.
get(id: string): Mirror.Schema.Contact;
// Inserts a new contact.
insert(resource: Schema.Contact): Mirror.Schema.Contact;
// Retrieves a list of contacts for the authenticated user.
list(): Mirror.Schema.ContactsListResponse;
// Updates a contact in place. This method supports patch semantics.
patch(resource: Schema.Contact, id: string): Mirror.Schema.Contact;
// Deletes a contact.
remove(id: string): void;
// Updates a contact in place.
update(resource: Schema.Contact, id: string): Mirror.Schema.Contact;
}
interface LocationsCollection {
// Gets a single location by ID.
get(id: string): Mirror.Schema.Location;
// Retrieves a list of locations for the user.
list(): Mirror.Schema.LocationsListResponse;
}
interface SettingsCollection {
// Gets a single setting by ID.
get(id: string): Mirror.Schema.Setting;
}
interface SubscriptionsCollection {
// Creates a new subscription.
insert(resource: Schema.Subscription): Mirror.Schema.Subscription;
// Retrieves a list of subscriptions for the authenticated user and service.
list(): Mirror.Schema.SubscriptionsListResponse;
// Deletes a subscription.
remove(id: string): void;
// Updates an existing subscription in place.
update(resource: Schema.Subscription, id: string): Mirror.Schema.Subscription;
}
interface TimelineCollection {
Attachments?: Mirror.Collection.Timeline.AttachmentsCollection | undefined;
// Gets a single timeline item by ID.
get(id: string): Mirror.Schema.TimelineItem;
// Inserts a new item into the timeline.
insert(resource: Schema.TimelineItem): Mirror.Schema.TimelineItem;
// Inserts a new item into the timeline.
insert(resource: Schema.TimelineItem, mediaData: any): Mirror.Schema.TimelineItem;
// Retrieves a list of timeline items for the authenticated user.
list(): Mirror.Schema.TimelineListResponse;
// Retrieves a list of timeline items for the authenticated user.
list(optionalArgs: object): Mirror.Schema.TimelineListResponse;
// Updates a timeline item in place. This method supports patch semantics.
patch(resource: Schema.TimelineItem, id: string): Mirror.Schema.TimelineItem;
// Deletes a timeline item.
remove(id: string): void;
// Updates a timeline item in place.
update(resource: Schema.TimelineItem, id: string): Mirror.Schema.TimelineItem;
// Updates a timeline item in place.
update(resource: Schema.TimelineItem, id: string, mediaData: any): Mirror.Schema.TimelineItem;
}
}
namespace Schema {
interface Account {
authTokens?: Mirror.Schema.AuthToken[] | undefined;
features?: string[] | undefined;
password?: string | undefined;
userData?: Mirror.Schema.UserData[] | undefined;
}
interface Attachment {
contentType?: string | undefined;
contentUrl?: string | undefined;
id?: string | undefined;
isProcessingContent?: boolean | undefined;
}
interface AttachmentsListResponse {
items?: Mirror.Schema.Attachment[] | undefined;
kind?: string | undefined;
}
interface AuthToken {
authToken?: string | undefined;
type?: string | undefined;
}
interface Command {
type?: string | undefined;
}
interface Contact {
acceptCommands?: Mirror.Schema.Command[] | undefined;
acceptTypes?: string[] | undefined;
displayName?: string | undefined;
id?: string | undefined;
imageUrls?: string[] | undefined;
kind?: string | undefined;
phoneNumber?: string | undefined;
priority?: number | undefined;
sharingFeatures?: string[] | undefined;
source?: string | undefined;
speakableName?: string | undefined;
type?: string | undefined;
}
interface ContactsListResponse {
items?: Mirror.Schema.Contact[] | undefined;
kind?: string | undefined;
}
interface Location {
accuracy?: number | undefined;
address?: string | undefined;
displayName?: string | undefined;
id?: string | undefined;
kind?: string | undefined;
latitude?: number | undefined;
longitude?: number | undefined;
timestamp?: string | undefined;
}
interface LocationsListResponse {
items?: Mirror.Schema.Location[] | undefined;
kind?: string | undefined;
}
interface MenuItem {
action?: string | undefined;
contextual_command?: string | undefined;
id?: string | undefined;
payload?: string | undefined;
removeWhenSelected?: boolean | undefined;
values?: Mirror.Schema.MenuValue[] | undefined;
}
interface MenuValue {
displayName?: string | undefined;
iconUrl?: string | undefined;
state?: string | undefined;
}
interface Notification {
collection?: string | undefined;
itemId?: string | undefined;
operation?: string | undefined;
userActions?: Mirror.Schema.UserAction[] | undefined;
userToken?: string | undefined;
verifyToken?: string | undefined;
}
interface NotificationConfig {
deliveryTime?: string | undefined;
level?: string | undefined;
}
interface Setting {
id?: string | undefined;
kind?: string | undefined;
value?: string | undefined;
}
interface Subscription {
callbackUrl?: string | undefined;
collection?: string | undefined;
id?: string | undefined;
kind?: string | undefined;
notification?: Mirror.Schema.Notification | undefined;
operation?: string[] | undefined;
updated?: string | undefined;
userToken?: string | undefined;
verifyToken?: string | undefined;
}
interface SubscriptionsListResponse {
items?: Mirror.Schema.Subscription[] | undefined;
kind?: string | undefined;
}
interface TimelineItem {
attachments?: Mirror.Schema.Attachment[] | undefined;
bundleId?: string | undefined;
canonicalUrl?: string | undefined;
created?: string | undefined;
creator?: Mirror.Schema.Contact | undefined;
displayTime?: string | undefined;
etag?: string | undefined;
html?: string | undefined;
id?: string | undefined;
inReplyTo?: string | undefined;
isBundleCover?: boolean | undefined;
isDeleted?: boolean | undefined;
isPinned?: boolean | undefined;
kind?: string | undefined;
location?: Mirror.Schema.Location | undefined;
menuItems?: Mirror.Schema.MenuItem[] | undefined;
notification?: Mirror.Schema.NotificationConfig | undefined;
pinScore?: number | undefined;
recipients?: Mirror.Schema.Contact[] | undefined;
selfLink?: string | undefined;
sourceItemId?: string | undefined;
speakableText?: string | undefined;
speakableType?: string | undefined;
text?: string | undefined;
title?: string | undefined;
updated?: string | undefined;
}
interface TimelineListResponse {
items?: Mirror.Schema.TimelineItem[] | undefined;
kind?: string | undefined;
nextPageToken?: string | undefined;
}
interface UserAction {
payload?: string | undefined;
type?: string | undefined;
}
interface UserData {
key?: string | undefined;
value?: string | undefined;
}
}
}
interface Mirror {
Accounts?: Mirror.Collection.AccountsCollection | undefined;
Contacts?: Mirror.Collection.ContactsCollection | undefined;
Locations?: Mirror.Collection.LocationsCollection | undefined;
Settings?: Mirror.Collection.SettingsCollection | undefined;
Subscriptions?: Mirror.Collection.SubscriptionsCollection | undefined;
Timeline?: Mirror.Collection.TimelineCollection | undefined;
// Create a new instance of Account
newAccount(): Mirror.Schema.Account;
// Create a new instance of Attachment
newAttachment(): Mirror.Schema.Attachment;
// Create a new instance of AuthToken
newAuthToken(): Mirror.Schema.AuthToken;
// Create a new instance of Command
newCommand(): Mirror.Schema.Command;
// Create a new instance of Contact
newContact(): Mirror.Schema.Contact;
// Create a new instance of Location
newLocation(): Mirror.Schema.Location;
// Create a new instance of MenuItem
newMenuItem(): Mirror.Schema.MenuItem;
// Create a new instance of MenuValue
newMenuValue(): Mirror.Schema.MenuValue;
// Create a new instance of Notification
newNotification(): Mirror.Schema.Notification;
// Create a new instance of NotificationConfig
newNotificationConfig(): Mirror.Schema.NotificationConfig;
// Create a new instance of Subscription
newSubscription(): Mirror.Schema.Subscription;
// Create a new instance of TimelineItem
newTimelineItem(): Mirror.Schema.TimelineItem;
// Create a new instance of UserAction
newUserAction(): Mirror.Schema.UserAction;
// Create a new instance of UserData
newUserData(): Mirror.Schema.UserData;
}
}
declare var Mirror: GoogleAppsScript.Mirror;

View File

@ -0,0 +1,706 @@
declare namespace GoogleAppsScript {
namespace People {
namespace Collection {
namespace ContactGroups {
interface MembersCollection {
// Modify the members of a contact group owned by the authenticated user.
// <br>
// The only system contact groups that can have members added are
// `contactGroups/myContacts` and `contactGroups/starred`. Other system
// contact groups are deprecated and can only have contacts removed.
modify(
resource: Schema.ModifyContactGroupMembersRequest,
resourceName: string,
): Schema.ModifyContactGroupMembersResponse;
}
}
namespace People {
interface ConnectionsCollection {
// Provides a list of the authenticated user's contacts merged with any
// connected profiles.
// <br>
// The request throws a 400 error if 'personFields' is not specified.
list(resourceName: string): Schema.ListConnectionsResponse;
// Provides a list of the authenticated user's contacts merged with any
// connected profiles.
// <br>
// The request throws a 400 error if 'personFields' is not specified.
list(resourceName: string, optionalArgs: object): Schema.ListConnectionsResponse;
}
}
interface ContactGroupsCollection {
Members?: Collection.ContactGroups.MembersCollection | undefined;
// Get a list of contact groups owned by the authenticated user by specifying
// a list of contact group resource names.
batchGet(): Schema.BatchGetContactGroupsResponse;
// Get a list of contact groups owned by the authenticated user by specifying
// a list of contact group resource names.
batchGet(optionalArgs: object): Schema.BatchGetContactGroupsResponse;
// Create a new contact group owned by the authenticated user.
create(resource: Schema.CreateContactGroupRequest): Schema.ContactGroup;
// Get a specific contact group owned by the authenticated user by specifying
// a contact group resource name.
get(resourceName: string): Schema.ContactGroup;
// Get a specific contact group owned by the authenticated user by specifying
// a contact group resource name.
get(resourceName: string, optionalArgs: object): Schema.ContactGroup;
// List all contact groups owned by the authenticated user. Members of the
// contact groups are not populated.
list(): Schema.ListContactGroupsResponse;
// List all contact groups owned by the authenticated user. Members of the
// contact groups are not populated.
list(optionalArgs: object): Schema.ListContactGroupsResponse;
// Delete an existing contact group owned by the authenticated user by
// specifying a contact group resource name.
remove(resourceName: string): void;
// Delete an existing contact group owned by the authenticated user by
// specifying a contact group resource name.
remove(resourceName: string, optionalArgs: object): void;
// Update the name of an existing contact group owned by the authenticated
// user.
update(resource: Schema.UpdateContactGroupRequest, resourceName: string): Schema.ContactGroup;
}
interface OtherContactsCollection {
// Copies an "Other contact" to a new contact in the user's "myContacts"
// group Mutate requests for the same user should be sent sequentially
// to avoid increased latency and failures.
copyOtherContactToMyContactsGroup(
resource: Schema.CopyOtherContactToMyContactsGroupRequest,
resourceName: string,
): Schema.Person;
// List all "Other contacts", that is contacts that are not in a contact group.
list(): Schema.ListOtherContactsResponse;
// List all "Other contacts", that is contacts that are not in a contact group.
list(optionalArgs: object): Schema.ListOtherContactsResponse;
// Provides a list of contacts in the authenticated user's other contacts
// that matches the search query.
search(): Schema.SearchDirectoryPeopleResponse;
// Provides a list of contacts in the authenticated user's other contacts
// that matches the search query.
search(optionalArgs: object): Schema.SearchDirectoryPeopleResponse;
}
interface PeopleCollection {
Connections?: Collection.People.ConnectionsCollection | undefined;
// Create a batch of new contacts and return the PersonResponses for the
// newly Mutate requests for the same user should be sent sequentially
// to avoid increased latency and failures.
batchCreateContacts(resource: Schema.BatchCreateContactsRequest): Schema.BatchCreateContactsResponse;
// Delete a batch of contacts. Any non-contact data will not be deleted.
// Mutate requests for the same user should be sent sequentially to avoid
// increased latency and failures.
batchDeleteContacts(resource: Schema.BatchDeleteContactsRequest): Schema.Empty;
// Update a batch of contacts and return a map of resource names to
// PersonResponses for the updated contacts.
batchUpdateContacts(resource: Schema.BatchUpdateContactsRequest): Schema.BatchUpdateContactsResponse;
// Create a new contact and return the person resource for that contact.
createContact(resource: Schema.Person): Schema.Person;
// Create a new contact and return the person resource for that contact.
createContact(resource: Schema.Person, optionalArgs: object): Schema.Person;
// Delete a contact person. Any non-contact data will not be deleted.
deleteContact(resourceName: string): void;
// Delete a contact's photo. Mutate requests for the same user should
// be done sequentially to avoid // lock contention.
deleteContactPhoto(resourceName: string): Schema.DeleteContactPhotoResponse;
// Delete a contact's photo. Mutate requests for the same user should
// be done sequentially to avoid // lock contention.
deleteContactPhoto(resourceName: string, optionalArgs: object): Schema.DeleteContactPhotoResponse;
// Provides information about a person by specifying a resource name. Use
// `people/me` to indicate the authenticated user.
// <br>
// The request throws a 400 error if 'personFields' is not specified.
get(resourceName: string): Schema.Person;
// Provides information about a person by specifying a resource name. Use
// `people/me` to indicate the authenticated user.
// <br>
// The request throws a 400 error if 'personFields' is not specified.
get(resourceName: string, optionalArgs: object): Schema.Person;
// Provides information about a list of specific people by specifying a list
// of requested resource names. Use `people/me` to indicate the authenticated
// user.
// <br>
// The request throws a 400 error if 'personFields' is not specified.
getBatchGet(): Schema.GetPeopleResponse;
// Provides information about a list of specific people by specifying a list
// of requested resource names. Use `people/me` to indicate the authenticated
// user.
// <br>
// The request throws a 400 error if 'personFields' is not specified.
getBatchGet(optionalArgs: object): Schema.GetPeopleResponse;
// Provides a list of domain profiles and domain contacts in the authenticated
// user's domain directory.
listDirectoryPeople(): Schema.ListDirectoryPeopleResponse;
// Provides a list of domain profiles and domain contacts in the authenticated
// user's domain directory.
listDirectoryPeople(optionalArgs: object): Schema.ListDirectoryPeopleResponse;
// Provides a list of contacts in the authenticated user's grouped contacts
// that matches the search query.
searchContacts(): Schema.SearchResponse;
// Provides a list of contacts in the authenticated user's grouped contacts
// that matches the search query.
searchContacts(optionalArgs: object): Schema.SearchResponse;
// Provides a list of domain profiles and domain contacts in the
// authenticated user's domain directory that match the search query.
searchDirectoryPeople(): Schema.SearchDirectoryPeopleResponse;
// Provides a list of domain profiles and domain contacts in the
// authenticated user's domain directory that match the search query.
searchDirectoryPeople(optionalArgs: object): Schema.SearchDirectoryPeopleResponse;
// Update contact data for an existing contact person. Any non-contact data
// will not be modified.
// The request throws a 400 error if `updatePersonFields` is not specified.
// <br>
// The request throws a 400 error if `person.metadata.sources` is not
// specified for the contact to be updated.
// <br>
// The request throws a 412 error if `person.metadata.sources.etag` is
// different than the contact's etag, which indicates the contact has changed
// since its data was read. Clients should get the latest person and re-apply
// their updates to the latest person.
updateContact(resource: Schema.Person, resourceName: string): Schema.Person;
// Update contact data for an existing contact person. Any non-contact data
// will not be modified.
// The request throws a 400 error if `updatePersonFields` is not specified.
// <br>
// The request throws a 400 error if `person.metadata.sources` is not
// specified for the contact to be updated.
// <br>
// The request throws a 412 error if `person.metadata.sources.etag` is
// different than the contact's etag, which indicates the contact has changed
// since its data was read. Clients should get the latest person and re-apply
// their updates to the latest person.
updateContact(resource: Schema.Person, resourceName: string, optionalArgs: object): Schema.Person;
// Update a contact's photo. Mutate requests for the same user should be sent
// sequentially to avoid increased latency and failures.
updateContactPhoto(
resource: Schema.UpdateContactPhotoRequest,
resourceName: string,
): Schema.UpdateContactPhotoResponse;
}
}
namespace Schema {
interface Address {
city?: string | undefined;
country?: string | undefined;
countryCode?: string | undefined;
extendedAddress?: string | undefined;
formattedType?: string | undefined;
formattedValue?: string | undefined;
metadata?: People.Schema.FieldMetadata | undefined;
poBox?: string | undefined;
postalCode?: string | undefined;
region?: string | undefined;
streetAddress?: string | undefined;
type?: string | undefined;
}
interface AgeRangeType {
ageRange?: string | undefined;
metadata?: People.Schema.FieldMetadata | undefined;
}
interface BatchCreateContactsRequest {
contacts?: People.Schema.ContactToCreate[] | undefined;
readMask?: string | undefined;
sources?: string[] | undefined;
}
interface BatchCreateContactsResponse {
createdPeople?: People.Schema.PersonResponse[] | undefined;
}
interface BatchDeleteContactsRequest {
resourceNames?: string[] | undefined;
}
interface BatchGetContactGroupsResponse {
responses?: People.Schema.ContactGroupResponse[] | undefined;
}
interface BatchUpdateContactsRequest {
contacts?: { [key: string]: People.Schema.Person } | undefined;
readMask?: string | undefined;
sources?: string[] | undefined;
updateMask?: string | undefined;
}
interface BatchUpdateContactsResponse {
updateResult?: { [key: string]: People.Schema.PersonResponse } | undefined;
}
interface Biography {
contentType?: string | undefined;
metadata?: People.Schema.FieldMetadata | undefined;
value?: string | undefined;
}
interface Birthday {
date?: People.Schema.Date | undefined;
metadata?: People.Schema.FieldMetadata | undefined;
text?: string | undefined;
}
interface BraggingRights {
metadata?: People.Schema.FieldMetadata | undefined;
value?: string | undefined;
}
interface CalendarUrl {
formattedType?: string | undefined;
metadata?: People.Schema.FieldMetadata | undefined;
type?: string | undefined;
url?: string | undefined;
}
interface ClientData {
key?: string | undefined;
metadata?: People.Schema.FieldMetadata | undefined;
value?: string | undefined;
}
interface ContactGroup {
etag?: string | undefined;
formattedName?: string | undefined;
groupType?: string | undefined;
memberCount?: number | undefined;
memberResourceNames?: string[] | undefined;
metadata?: People.Schema.ContactGroupMetadata | undefined;
name?: string | undefined;
resourceName?: string | undefined;
}
interface ContactGroupMembership {
contactGroupId?: string | undefined;
}
interface ContactGroupMetadata {
deleted?: boolean | undefined;
updateTime?: string | undefined;
}
interface ContactGroupResponse {
contactGroup?: People.Schema.ContactGroup | undefined;
requestedResourceName?: string | undefined;
status?: People.Schema.Status | undefined;
}
interface ContactToCreate {
contactPerson?: People.Schema.Person | undefined;
}
interface CopyOtherContactToMyContactsGroupRequest {
copyMask?: string | undefined;
readMask?: string | undefined;
sources?: string[] | undefined;
}
interface CoverPhoto {
default?: boolean | undefined;
metadata?: People.Schema.FieldMetadata | undefined;
url?: string | undefined;
}
interface CreateContactGroupRequest {
contactGroup?: People.Schema.ContactGroup | undefined;
}
interface Date {
day?: number | undefined;
month?: number | undefined;
year?: number | undefined;
}
interface DeleteContactPhotoResponse {
person?: People.Schema.Person | undefined;
}
interface DomainMembership {
inViewerDomain?: boolean | undefined;
}
interface EmailAddress {
displayName?: string | undefined;
formattedType?: string | undefined;
metadata?: People.Schema.FieldMetadata | undefined;
type?: string | undefined;
value?: string | undefined;
}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface Empty {}
interface Event {
date?: People.Schema.Date | undefined;
formattedType?: string | undefined;
metadata?: People.Schema.FieldMetadata | undefined;
type?: string | undefined;
}
interface ExternalId {
formattedType?: string | undefined;
metadata?: People.Schema.FieldMetadata | undefined;
type?: string | undefined;
value?: string | undefined;
}
interface FieldMetadata {
primary?: boolean | undefined;
source?: People.Schema.Source | undefined;
verified?: boolean | undefined;
}
interface FileAs {
metadata?: People.Schema.FieldMetadata | undefined;
value?: string | undefined;
}
interface Gender {
formattedValue?: string | undefined;
metadata?: People.Schema.FieldMetadata | undefined;
value?: string | undefined;
}
interface GetPeopleResponse {
responses?: People.Schema.PersonResponse[] | undefined;
}
interface GroupClientData {
key?: string | undefined;
value?: string | undefined;
}
interface ImClient {
formattedProtocol?: string | undefined;
formattedType?: string | undefined;
metadata?: People.Schema.FieldMetadata | undefined;
protocol?: string | undefined;
type?: string | undefined;
username?: string | undefined;
}
interface Interest {
metadata?: People.Schema.FieldMetadata | undefined;
value?: string | undefined;
}
interface ListConnectionsResponse {
connections?: People.Schema.Person[] | undefined;
nextPageToken?: string | undefined;
nextSyncToken?: string | undefined;
totalItems?: number | undefined;
totalPeople?: number | undefined;
}
interface ListContactGroupsResponse {
contactGroups?: People.Schema.ContactGroup[] | undefined;
nextPageToken?: string | undefined;
nextSyncToken?: string | undefined;
totalItems?: number | undefined;
}
interface ListDirectoryPeopleResponse {
nextPageToken?: string | undefined;
nextSyncToken?: string | undefined;
people?: People.Schema.Person[] | undefined;
}
interface ListOtherContactsResponse {
nextPageToken?: string | undefined;
nextSyncToken?: string | undefined;
otherContacts?: People.Schema.Person[] | undefined;
totalSize?: number | undefined;
}
interface Locale {
metadata?: People.Schema.FieldMetadata | undefined;
value?: string | undefined;
}
interface Location {
buildingId?: string | undefined;
current?: boolean | undefined;
deskCode?: string | undefined;
floor?: string | undefined;
floorSection?: string | undefined;
metadata?: People.Schema.FieldMetadata | undefined;
type?: string | undefined;
value?: string | undefined;
}
interface Membership {
contactGroupMembership?: People.Schema.ContactGroupMembership | undefined;
domainMembership?: People.Schema.DomainMembership | undefined;
metadata?: People.Schema.FieldMetadata | undefined;
}
interface MiscKeyword {
formattedType?: string | undefined;
metadata?: People.Schema.FieldMetadata | undefined;
type?: string | undefined;
value?: string | undefined;
}
interface ModifyContactGroupMembersRequest {
resourceNamesToAdd?: string[] | undefined;
resourceNamesToRemove?: string[] | undefined;
}
interface ModifyContactGroupMembersResponse {
notFoundResourceNames?: string[] | undefined;
}
interface Name {
displayName?: string | undefined;
displayNameLastFirst?: string | undefined;
familyName?: string | undefined;
givenName?: string | undefined;
honorificPrefix?: string | undefined;
honorificSuffix?: string | undefined;
metadata?: People.Schema.FieldMetadata | undefined;
middleName?: string | undefined;
phoneticFamilyName?: string | undefined;
phoneticFullName?: string | undefined;
phoneticGivenName?: string | undefined;
phoneticHonorificPrefix?: string | undefined;
phoneticHonorificSuffix?: string | undefined;
phoneticMiddleName?: string | undefined;
}
interface Nickname {
metadata?: People.Schema.FieldMetadata | undefined;
type?: string | undefined;
value?: string | undefined;
}
interface Occupation {
metadata?: People.Schema.FieldMetadata | undefined;
value?: string | undefined;
}
interface Organization {
current?: boolean | undefined;
department?: string | undefined;
domain?: string | undefined;
endDate?: People.Schema.Date | undefined;
formattedType?: string | undefined;
jobDescription?: string | undefined;
location?: string | undefined;
metadata?: People.Schema.FieldMetadata | undefined;
name?: string | undefined;
phoneticName?: string | undefined;
startDate?: People.Schema.Date | undefined;
symbol?: string | undefined;
title?: string | undefined;
type?: string | undefined;
}
interface Person {
addresses?: People.Schema.Address[] | undefined;
ageRange?: string | undefined;
ageRanges?: People.Schema.AgeRangeType[] | undefined;
biographies?: People.Schema.Biography[] | undefined;
birthdays?: People.Schema.Birthday[] | undefined;
braggingRights?: People.Schema.BraggingRights[] | undefined;
coverPhotos?: People.Schema.CoverPhoto[] | undefined;
emailAddresses?: People.Schema.EmailAddress[] | undefined;
etag?: string | undefined;
events?: People.Schema.Event[] | undefined;
genders?: People.Schema.Gender[] | undefined;
imClients?: People.Schema.ImClient[] | undefined;
interests?: People.Schema.Interest[] | undefined;
locales?: People.Schema.Locale[] | undefined;
memberships?: People.Schema.Membership[] | undefined;
metadata?: People.Schema.PersonMetadata | undefined;
names?: People.Schema.Name[] | undefined;
nicknames?: People.Schema.Nickname[] | undefined;
occupations?: People.Schema.Occupation[] | undefined;
organizations?: People.Schema.Organization[] | undefined;
phoneNumbers?: People.Schema.PhoneNumber[] | undefined;
photos?: People.Schema.Photo[] | undefined;
relations?: People.Schema.Relation[] | undefined;
relationshipInterests?: People.Schema.RelationshipInterest[] | undefined;
relationshipStatuses?: People.Schema.RelationshipStatus[] | undefined;
residences?: People.Schema.Residence[] | undefined;
resourceName?: string | undefined;
sipAddresses?: People.Schema.SipAddress[] | undefined;
skills?: People.Schema.Skill[] | undefined;
taglines?: People.Schema.Tagline[] | undefined;
urls?: People.Schema.Url[] | undefined;
userDefined?: People.Schema.UserDefined[] | undefined;
}
interface PersonMetadata {
deleted?: boolean | undefined;
linkedPeopleResourceNames?: string[] | undefined;
objectType?: string | undefined;
previousResourceNames?: string[] | undefined;
sources?: People.Schema.Source[] | undefined;
}
interface PersonResponse {
httpStatusCode?: number | undefined;
person?: People.Schema.Person | undefined;
requestedResourceName?: string | undefined;
status?: People.Schema.Status | undefined;
}
interface PhoneNumber {
canonicalForm?: string | undefined;
formattedType?: string | undefined;
metadata?: People.Schema.FieldMetadata | undefined;
type?: string | undefined;
value?: string | undefined;
}
interface Photo {
default?: boolean | undefined;
metadata?: People.Schema.FieldMetadata | undefined;
url?: string | undefined;
}
interface ProfileMetadata {
objectType?: string | undefined;
userTypes?: string[] | undefined;
}
interface Relation {
formattedType?: string | undefined;
metadata?: People.Schema.FieldMetadata | undefined;
person?: string | undefined;
type?: string | undefined;
}
interface RelationshipInterest {
formattedValue?: string | undefined;
metadata?: People.Schema.FieldMetadata | undefined;
value?: string | undefined;
}
interface RelationshipStatus {
formattedValue?: string | undefined;
metadata?: People.Schema.FieldMetadata | undefined;
value?: string | undefined;
}
interface Residence {
current?: boolean | undefined;
metadata?: People.Schema.FieldMetadata | undefined;
value?: string | undefined;
}
interface SearchDirectoryPeopleResponse {
nextPageToken?: string | undefined;
people?: People.Schema.Person[] | undefined;
totalSize?: number | undefined;
}
interface SearchResponse {
results?: People.Schema.SearchResult[] | undefined;
}
interface SearchResult {
person?: People.Schema.Person | undefined;
}
interface SipAddress {
formattedType?: string | undefined;
metadata?: People.Schema.FieldMetadata | undefined;
type?: string | undefined;
value?: string | undefined;
}
interface Skill {
metadata?: People.Schema.FieldMetadata | undefined;
value?: string | undefined;
}
interface Source {
etag?: string | undefined;
id?: string | undefined;
profileMetadata?: People.Schema.ProfileMetadata | undefined;
type?: string | undefined;
updateTime?: string | undefined;
}
interface Status {
code?: number | undefined;
details?: object[] | undefined;
message?: string | undefined;
}
interface Tagline {
metadata?: People.Schema.FieldMetadata | undefined;
value?: string | undefined;
}
interface UpdateContactGroupRequest {
contactGroup?: People.Schema.ContactGroup | undefined;
}
interface UpdateContactPhotoRequest {
personFields?: string | undefined;
photoBytes?: string | undefined;
sources?: string[] | undefined;
}
interface UpdateContactPhotoResponse {
person?: People.Schema.Person | undefined;
}
interface Url {
formattedType?: string | undefined;
metadata?: People.Schema.FieldMetadata | undefined;
type?: string | undefined;
value?: string | undefined;
}
interface UserDefined {
key?: string | undefined;
metadata?: People.Schema.FieldMetadata | undefined;
value?: string | undefined;
}
}
}
interface People {
ContactGroups?: People.Collection.ContactGroupsCollection | undefined;
OtherContacts?: People.Collection.OtherContactsCollection | undefined;
People?: People.Collection.PeopleCollection | undefined;
// Create a new instance of Address
newAddress(): People.Schema.Address;
// Create a new instance of AgeRangeType
newAgeRangeType(): People.Schema.AgeRangeType;
// Create a new instance of BatchCreateContactsRequest
newBatchCreateContactsRequest(): People.Schema.BatchCreateContactsRequest;
// Create a new instance of BatchDeleteContactsRequest
newBatchDeleteContactsRequest(): People.Schema.BatchDeleteContactsRequest;
// Create a new instance of BatchUpdateContactsRequest
newBatchUpdateContactsRequest(): People.Schema.BatchUpdateContactsRequest;
// Create a new instance of Biography
newBiography(): People.Schema.Biography;
// Create a new instance of Birthday
newBirthday(): People.Schema.Birthday;
// Create a new instance of BraggingRights
newBraggingRights(): People.Schema.BraggingRights;
// Create a new instance of CalendarUrl
newCalendarUrl(): People.Schema.CalendarUrl;
// Create a new instance of ClientData
newClientData(): People.Schema.ClientData;
// Create a new instance of ContactGroup
newContactGroup(): People.Schema.ContactGroup;
// Create a new instance of ContactGroupMembership
newContactGroupMembership(): People.Schema.ContactGroupMembership;
// Create a new instance of ContactGroupMetadata
newContactGroupMetadata(): People.Schema.ContactGroupMetadata;
// Create a new instance of ContactToCreate
newContactToCreate(): People.Schema.ContactToCreate;
// Create a new instance of CopyOtherContactToMyContactsGroupRequest
newCopyOtherContactToMyContactsGroupRequest(): People.Schema.CopyOtherContactToMyContactsGroupRequest;
// Create a new instance of CoverPhoto
newCoverPhoto(): People.Schema.CoverPhoto;
// Create a new instance of CreateContactGroupRequest
newCreateContactGroupRequest(): People.Schema.CreateContactGroupRequest;
// Create a new instance of Date
newDate(): People.Schema.Date;
// Create a new instance of DomainMembership
newDomainMembership(): People.Schema.DomainMembership;
// Create a new instance of EmailAddress
newEmailAddress(): People.Schema.EmailAddress;
// Create a new instance of Event
newEvent(): People.Schema.Event;
// Create a new instance of ExternalId
newExternalId(): People.Schema.ExternalId;
// Create a new instance of FieldMetadata
newFieldMetadata(): People.Schema.FieldMetadata;
// Create a new instance of newFileAs
newFileAs(): People.Schema.FileAs;
// Create a new instance of Gender
newGender(): People.Schema.Gender;
// Create a new instance of GroupClientData
newGroupClientData(): People.Schema.GroupClientData;
// Create a new instance of ImClient
newImClient(): People.Schema.ImClient;
// Create a new instance of Interest
newInterest(): People.Schema.Interest;
// Create a new instance of Locale
newLocale(): People.Schema.Locale;
// Create a new instance of Location
newLocation(): People.Schema.Location;
// Create a new instance of Membership
newMembership(): People.Schema.Membership;
// Create a new instance of MiscKeyword
newMiscKeyword(): People.Schema.MiscKeyword;
// Create a new instance of ModifyContactGroupMembersRequest
newModifyContactGroupMembersRequest(): People.Schema.ModifyContactGroupMembersRequest;
// Create a new instance of Name
newName(): People.Schema.Name;
// Create a new instance of Nickname
newNickname(): People.Schema.Nickname;
// Create a new instance of Occupation
newOccupation(): People.Schema.Occupation;
// Create a new instance of Organization
newOrganization(): People.Schema.Organization;
// Create a new instance of Person
newPerson(): People.Schema.Person;
// Create a new instance of PersonMetadata
newPersonMetadata(): People.Schema.PersonMetadata;
// Create a new instance of PhoneNumber
newPhoneNumber(): People.Schema.PhoneNumber;
// Create a new instance of Photo
newPhoto(): People.Schema.Photo;
// Create a new instance of ProfileMetadata
newProfileMetadata(): People.Schema.ProfileMetadata;
// Create a new instance of Relation
newRelation(): People.Schema.Relation;
// Create a new instance of RelationshipInterest
newRelationshipInterest(): People.Schema.RelationshipInterest;
// Create a new instance of RelationshipStatus
newRelationshipStatus(): People.Schema.RelationshipStatus;
// Create a new instance of Residence
newResidence(): People.Schema.Residence;
// Create a new instance of SipAddress
newSipAddress(): People.Schema.SipAddress;
// Create a new instance of Skill
newSkill(): People.Schema.Skill;
// Create a new instance of Source
newSource(): People.Schema.Source;
// Create a new instance of Tagline
newTagline(): People.Schema.Tagline;
// Create a new instance of UpdateContactGroupRequest
newUpdateContactGroupRequest(): People.Schema.UpdateContactGroupRequest;
// Create a new instance of UpdateContactPhotoRequest
newUpdateContactPhotoRequest(): People.Schema.UpdateContactPhotoRequest;
// Create a new instance of Url
newUrl(): People.Schema.Url;
// Create a new instance of UserDefined
newUserDefined(): People.Schema.UserDefined;
}
}
declare var People: GoogleAppsScript.People;

View File

@ -0,0 +1,151 @@
declare namespace GoogleAppsScript {
namespace AdminReports {
namespace Collection {
interface ActivitiesCollection {
// Retrieves a list of activities for a specific customer and application.
list(userKey: string, applicationName: string): AdminReports.Schema.Activities;
// Retrieves a list of activities for a specific customer and application.
list(userKey: string, applicationName: string, optionalArgs: object): AdminReports.Schema.Activities;
// Push changes to activities
watch(resource: Schema.Channel, userKey: string, applicationName: string): AdminReports.Schema.Channel;
// Push changes to activities
watch(
resource: Schema.Channel,
userKey: string,
applicationName: string,
optionalArgs: object,
): AdminReports.Schema.Channel;
}
interface ChannelsCollection {
// Stop watching resources through this channel
stop(resource: Schema.Channel): void;
}
interface CustomerUsageReportsCollection {
// Retrieves a report which is a collection of properties / statistics for a specific customer.
get(date: string): AdminReports.Schema.UsageReports;
// Retrieves a report which is a collection of properties / statistics for a specific customer.
get(date: string, optionalArgs: object): AdminReports.Schema.UsageReports;
}
interface EntityUsageReportsCollection {
// Retrieves a report which is a collection of properties / statistics for a set of objects.
get(entityType: string, entityKey: string, date: string): AdminReports.Schema.UsageReports;
// Retrieves a report which is a collection of properties / statistics for a set of objects.
get(
entityType: string,
entityKey: string,
date: string,
optionalArgs: object,
): AdminReports.Schema.UsageReports;
}
interface UserUsageReportCollection {
// Retrieves a report which is a collection of properties / statistics for a set of users.
get(userKey: string, date: string): AdminReports.Schema.UsageReports;
// Retrieves a report which is a collection of properties / statistics for a set of users.
get(userKey: string, date: string, optionalArgs: object): AdminReports.Schema.UsageReports;
}
}
namespace Schema {
interface Activities {
etag?: string | undefined;
items?: AdminReports.Schema.Activity[] | undefined;
kind?: string | undefined;
nextPageToken?: string | undefined;
}
interface Activity {
actor?: AdminReports.Schema.ActivityActor | undefined;
etag?: string | undefined;
events?: AdminReports.Schema.ActivityEvents[] | undefined;
id?: AdminReports.Schema.ActivityId | undefined;
ipAddress?: string | undefined;
kind?: string | undefined;
ownerDomain?: string | undefined;
}
interface ActivityActor {
callerType?: string | undefined;
email?: string | undefined;
key?: string | undefined;
profileId?: string | undefined;
}
interface ActivityEvents {
name?: string | undefined;
parameters?: AdminReports.Schema.ActivityEventsParameters[] | undefined;
type?: string | undefined;
}
interface ActivityEventsParameters {
boolValue?: boolean | undefined;
intValue?: string | undefined;
multiIntValue?: string[] | undefined;
multiValue?: string[] | undefined;
name?: string | undefined;
value?: string | undefined;
}
interface ActivityId {
applicationName?: string | undefined;
customerId?: string | undefined;
time?: string | undefined;
uniqueQualifier?: string | undefined;
}
interface Channel {
address?: string | undefined;
expiration?: string | undefined;
id?: string | undefined;
kind?: string | undefined;
params?: object | undefined;
payload?: boolean | undefined;
resourceId?: string | undefined;
resourceUri?: string | undefined;
token?: string | undefined;
type?: string | undefined;
}
interface UsageReport {
date?: string | undefined;
entity?: AdminReports.Schema.UsageReportEntity | undefined;
etag?: string | undefined;
kind?: string | undefined;
parameters?: AdminReports.Schema.UsageReportParameters[] | undefined;
}
interface UsageReportEntity {
customerId?: string | undefined;
entityId?: string | undefined;
profileId?: string | undefined;
type?: string | undefined;
userEmail?: string | undefined;
}
interface UsageReportParameters {
boolValue?: boolean | undefined;
datetimeValue?: string | undefined;
intValue?: string | undefined;
msgValue?: object[] | undefined;
name?: string | undefined;
stringValue?: string | undefined;
}
interface UsageReports {
etag?: string | undefined;
kind?: string | undefined;
nextPageToken?: string | undefined;
usageReports?: AdminReports.Schema.UsageReport[] | undefined;
warnings?: AdminReports.Schema.UsageReportsWarnings[] | undefined;
}
interface UsageReportsWarnings {
code?: string | undefined;
data?: AdminReports.Schema.UsageReportsWarningsData[] | undefined;
message?: string | undefined;
}
interface UsageReportsWarningsData {
key?: string | undefined;
value?: string | undefined;
}
}
}
interface AdminReports {
Activities?: AdminReports.Collection.ActivitiesCollection | undefined;
Channels?: AdminReports.Collection.ChannelsCollection | undefined;
CustomerUsageReports?: AdminReports.Collection.CustomerUsageReportsCollection | undefined;
EntityUsageReports?: AdminReports.Collection.EntityUsageReportsCollection | undefined;
UserUsageReport?: AdminReports.Collection.UserUsageReportCollection | undefined;
// Create a new instance of Channel
newChannel(): AdminReports.Schema.Channel;
}
}
declare var AdminReports: GoogleAppsScript.AdminReports;

View File

@ -0,0 +1,189 @@
declare namespace GoogleAppsScript {
namespace AdminReseller {
namespace Collection {
interface CustomersCollection {
// Get a customer account.
get(customerId: string): AdminReseller.Schema.Customer;
// Order a new customer's account.
insert(resource: Schema.Customer): AdminReseller.Schema.Customer;
// Order a new customer's account.
insert(resource: Schema.Customer, optionalArgs: object): AdminReseller.Schema.Customer;
// Update a customer account's settings. This method supports patch semantics.
patch(resource: Schema.Customer, customerId: string): AdminReseller.Schema.Customer;
// Update a customer account's settings.
update(resource: Schema.Customer, customerId: string): AdminReseller.Schema.Customer;
}
interface ResellernotifyCollection {
// Returns all the details of the watch corresponding to the reseller.
getwatchdetails(): AdminReseller.Schema.ResellernotifyGetwatchdetailsResponse;
// Registers a Reseller for receiving notifications.
register(): AdminReseller.Schema.ResellernotifyResource;
// Registers a Reseller for receiving notifications.
register(optionalArgs: object): AdminReseller.Schema.ResellernotifyResource;
// Unregisters a Reseller for receiving notifications.
unregister(): AdminReseller.Schema.ResellernotifyResource;
// Unregisters a Reseller for receiving notifications.
unregister(optionalArgs: object): AdminReseller.Schema.ResellernotifyResource;
}
interface SubscriptionsCollection {
// Activates a subscription previously suspended by the reseller
activate(customerId: string, subscriptionId: string): AdminReseller.Schema.Subscription;
// Update a subscription plan. Use this method to update a plan for a 30-day trial or a flexible plan subscription to an annual commitment plan with monthly or yearly payments.
changePlan(
resource: Schema.ChangePlanRequest,
customerId: string,
subscriptionId: string,
): AdminReseller.Schema.Subscription;
// Update a user license's renewal settings. This is applicable for accounts with annual commitment plans only.
changeRenewalSettings(
resource: Schema.RenewalSettings,
customerId: string,
subscriptionId: string,
): AdminReseller.Schema.Subscription;
// Update a subscription's user license settings.
changeSeats(
resource: Schema.Seats,
customerId: string,
subscriptionId: string,
): AdminReseller.Schema.Subscription;
// Get a specific subscription.
get(customerId: string, subscriptionId: string): AdminReseller.Schema.Subscription;
// Create or transfer a subscription.
insert(resource: Schema.Subscription, customerId: string): AdminReseller.Schema.Subscription;
// Create or transfer a subscription.
insert(
resource: Schema.Subscription,
customerId: string,
optionalArgs: object,
): AdminReseller.Schema.Subscription;
// List of subscriptions managed by the reseller. The list can be all subscriptions, all of a customer's subscriptions, or all of a customer's transferable subscriptions.
list(): AdminReseller.Schema.Subscriptions;
// List of subscriptions managed by the reseller. The list can be all subscriptions, all of a customer's subscriptions, or all of a customer's transferable subscriptions.
list(optionalArgs: object): AdminReseller.Schema.Subscriptions;
// Cancel or transfer a subscription to direct.
remove(customerId: string, subscriptionId: string, deletionType: string): void;
// Immediately move a 30-day free trial subscription to a paid service subscription.
startPaidService(customerId: string, subscriptionId: string): AdminReseller.Schema.Subscription;
// Suspends an active subscription.
suspend(customerId: string, subscriptionId: string): AdminReseller.Schema.Subscription;
}
}
namespace Schema {
interface Address {
addressLine1?: string | undefined;
addressLine2?: string | undefined;
addressLine3?: string | undefined;
contactName?: string | undefined;
countryCode?: string | undefined;
kind?: string | undefined;
locality?: string | undefined;
organizationName?: string | undefined;
postalCode?: string | undefined;
region?: string | undefined;
}
interface ChangePlanRequest {
dealCode?: string | undefined;
kind?: string | undefined;
planName?: string | undefined;
purchaseOrderId?: string | undefined;
seats?: AdminReseller.Schema.Seats | undefined;
}
interface Customer {
alternateEmail?: string | undefined;
customerDomain?: string | undefined;
customerDomainVerified?: boolean | undefined;
customerId?: string | undefined;
kind?: string | undefined;
phoneNumber?: string | undefined;
postalAddress?: AdminReseller.Schema.Address | undefined;
resourceUiUrl?: string | undefined;
}
interface RenewalSettings {
kind?: string | undefined;
renewalType?: string | undefined;
}
interface ResellernotifyGetwatchdetailsResponse {
serviceAccountEmailAddresses?: string[] | undefined;
topicName?: string | undefined;
}
interface ResellernotifyResource {
topicName?: string | undefined;
}
interface Seats {
kind?: string | undefined;
licensedNumberOfSeats?: number | undefined;
maximumNumberOfSeats?: number | undefined;
numberOfSeats?: number | undefined;
}
interface Subscription {
billingMethod?: string | undefined;
creationTime?: string | undefined;
customerDomain?: string | undefined;
customerId?: string | undefined;
dealCode?: string | undefined;
kind?: string | undefined;
plan?: AdminReseller.Schema.SubscriptionPlan | undefined;
purchaseOrderId?: string | undefined;
renewalSettings?: AdminReseller.Schema.RenewalSettings | undefined;
resourceUiUrl?: string | undefined;
seats?: AdminReseller.Schema.Seats | undefined;
skuId?: string | undefined;
skuName?: string | undefined;
status?: string | undefined;
subscriptionId?: string | undefined;
suspensionReasons?: string[] | undefined;
transferInfo?: AdminReseller.Schema.SubscriptionTransferInfo | undefined;
trialSettings?: AdminReseller.Schema.SubscriptionTrialSettings | undefined;
}
interface SubscriptionPlan {
commitmentInterval?: AdminReseller.Schema.SubscriptionPlanCommitmentInterval | undefined;
isCommitmentPlan?: boolean | undefined;
planName?: string | undefined;
}
interface SubscriptionPlanCommitmentInterval {
endTime?: string | undefined;
startTime?: string | undefined;
}
interface SubscriptionTransferInfo {
minimumTransferableSeats?: number | undefined;
transferabilityExpirationTime?: string | undefined;
}
interface SubscriptionTrialSettings {
isInTrial?: boolean | undefined;
trialEndTime?: string | undefined;
}
interface Subscriptions {
kind?: string | undefined;
nextPageToken?: string | undefined;
subscriptions?: AdminReseller.Schema.Subscription[] | undefined;
}
}
}
interface AdminReseller {
Customers?: AdminReseller.Collection.CustomersCollection | undefined;
Resellernotify?: AdminReseller.Collection.ResellernotifyCollection | undefined;
Subscriptions?: AdminReseller.Collection.SubscriptionsCollection | undefined;
// Create a new instance of Address
newAddress(): AdminReseller.Schema.Address;
// Create a new instance of ChangePlanRequest
newChangePlanRequest(): AdminReseller.Schema.ChangePlanRequest;
// Create a new instance of Customer
newCustomer(): AdminReseller.Schema.Customer;
// Create a new instance of RenewalSettings
newRenewalSettings(): AdminReseller.Schema.RenewalSettings;
// Create a new instance of Seats
newSeats(): AdminReseller.Schema.Seats;
// Create a new instance of Subscription
newSubscription(): AdminReseller.Schema.Subscription;
// Create a new instance of SubscriptionPlan
newSubscriptionPlan(): AdminReseller.Schema.SubscriptionPlan;
// Create a new instance of SubscriptionPlanCommitmentInterval
newSubscriptionPlanCommitmentInterval(): AdminReseller.Schema.SubscriptionPlanCommitmentInterval;
// Create a new instance of SubscriptionTransferInfo
newSubscriptionTransferInfo(): AdminReseller.Schema.SubscriptionTransferInfo;
// Create a new instance of SubscriptionTrialSettings
newSubscriptionTrialSettings(): AdminReseller.Schema.SubscriptionTrialSettings;
}
}
declare var AdminReseller: GoogleAppsScript.AdminReseller;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,741 @@
declare namespace GoogleAppsScript {
namespace TagManager {
namespace Collection {
namespace Accounts {
namespace Containers {
namespace Workspaces {
interface Built_in_variablesCollection {
// Creates one or more GTM Built-In Variables.
create(parent: string): TagManager.Schema.CreateBuiltInVariableResponse;
// Creates one or more GTM Built-In Variables.
create(
parent: string,
optionalArgs: object,
): TagManager.Schema.CreateBuiltInVariableResponse;
// Lists all the enabled Built-In Variables of a GTM Container.
list(parent: string): TagManager.Schema.ListEnabledBuiltInVariablesResponse;
// Lists all the enabled Built-In Variables of a GTM Container.
list(
parent: string,
optionalArgs: object,
): TagManager.Schema.ListEnabledBuiltInVariablesResponse;
// Deletes one or more GTM Built-In Variables.
remove(path: string): void;
// Deletes one or more GTM Built-In Variables.
remove(path: string, optionalArgs: object): void;
// Reverts changes to a GTM Built-In Variables in a GTM Workspace.
revert(path: string): TagManager.Schema.RevertBuiltInVariableResponse;
// Reverts changes to a GTM Built-In Variables in a GTM Workspace.
revert(path: string, optionalArgs: object): TagManager.Schema.RevertBuiltInVariableResponse;
}
interface FoldersCollection {
// Creates a GTM Folder.
create(resource: Schema.Folder, parent: string): TagManager.Schema.Folder;
// List all entities in a GTM Folder.
entities(path: string): TagManager.Schema.FolderEntities;
// List all entities in a GTM Folder.
entities(path: string, optionalArgs: object): TagManager.Schema.FolderEntities;
// Gets a GTM Folder.
get(path: string): TagManager.Schema.Folder;
// Lists all GTM Folders of a Container.
list(parent: string): TagManager.Schema.ListFoldersResponse;
// Lists all GTM Folders of a Container.
list(parent: string, optionalArgs: object): TagManager.Schema.ListFoldersResponse;
// Moves entities to a GTM Folder.
move_entities_to_folder(resource: Schema.Folder, path: string): void;
// Moves entities to a GTM Folder.
move_entities_to_folder(resource: Schema.Folder, path: string, optionalArgs: object): void;
// Deletes a GTM Folder.
remove(path: string): void;
// Reverts changes to a GTM Folder in a GTM Workspace.
revert(path: string): TagManager.Schema.RevertFolderResponse;
// Reverts changes to a GTM Folder in a GTM Workspace.
revert(path: string, optionalArgs: object): TagManager.Schema.RevertFolderResponse;
// Updates a GTM Folder.
update(resource: Schema.Folder, path: string): TagManager.Schema.Folder;
// Updates a GTM Folder.
update(
resource: Schema.Folder,
path: string,
optionalArgs: object,
): TagManager.Schema.Folder;
}
interface TagsCollection {
// Creates a GTM Tag.
create(resource: Schema.Tag, parent: string): TagManager.Schema.Tag;
// Gets a GTM Tag.
get(path: string): TagManager.Schema.Tag;
// Lists all GTM Tags of a Container.
list(parent: string): TagManager.Schema.ListTagsResponse;
// Lists all GTM Tags of a Container.
list(parent: string, optionalArgs: object): TagManager.Schema.ListTagsResponse;
// Deletes a GTM Tag.
remove(path: string): void;
// Reverts changes to a GTM Tag in a GTM Workspace.
revert(path: string): TagManager.Schema.RevertTagResponse;
// Reverts changes to a GTM Tag in a GTM Workspace.
revert(path: string, optionalArgs: object): TagManager.Schema.RevertTagResponse;
// Updates a GTM Tag.
update(resource: Schema.Tag, path: string): TagManager.Schema.Tag;
// Updates a GTM Tag.
update(resource: Schema.Tag, path: string, optionalArgs: object): TagManager.Schema.Tag;
}
interface TriggersCollection {
// Creates a GTM Trigger.
create(resource: Schema.Trigger, parent: string): TagManager.Schema.Trigger;
// Gets a GTM Trigger.
get(path: string): TagManager.Schema.Trigger;
// Lists all GTM Triggers of a Container.
list(parent: string): TagManager.Schema.ListTriggersResponse;
// Lists all GTM Triggers of a Container.
list(parent: string, optionalArgs: object): TagManager.Schema.ListTriggersResponse;
// Deletes a GTM Trigger.
remove(path: string): void;
// Reverts changes to a GTM Trigger in a GTM Workspace.
revert(path: string): TagManager.Schema.RevertTriggerResponse;
// Reverts changes to a GTM Trigger in a GTM Workspace.
revert(path: string, optionalArgs: object): TagManager.Schema.RevertTriggerResponse;
// Updates a GTM Trigger.
update(resource: Schema.Trigger, path: string): TagManager.Schema.Trigger;
// Updates a GTM Trigger.
update(
resource: Schema.Trigger,
path: string,
optionalArgs: object,
): TagManager.Schema.Trigger;
}
interface VariablesCollection {
// Creates a GTM Variable.
create(resource: Schema.Variable, parent: string): TagManager.Schema.Variable;
// Gets a GTM Variable.
get(path: string): TagManager.Schema.Variable;
// Lists all GTM Variables of a Container.
list(parent: string): TagManager.Schema.ListVariablesResponse;
// Lists all GTM Variables of a Container.
list(parent: string, optionalArgs: object): TagManager.Schema.ListVariablesResponse;
// Deletes a GTM Variable.
remove(path: string): void;
// Reverts changes to a GTM Variable in a GTM Workspace.
revert(path: string): TagManager.Schema.RevertVariableResponse;
// Reverts changes to a GTM Variable in a GTM Workspace.
revert(path: string, optionalArgs: object): TagManager.Schema.RevertVariableResponse;
// Updates a GTM Variable.
update(resource: Schema.Variable, path: string): TagManager.Schema.Variable;
// Updates a GTM Variable.
update(
resource: Schema.Variable,
path: string,
optionalArgs: object,
): TagManager.Schema.Variable;
}
interface ZonesCollection {
// Creates a GTM Zone.
create(resource: Schema.Zone, parent: string): TagManager.Schema.Zone;
// Gets a GTM Zone.
get(path: string): TagManager.Schema.Zone;
// Lists all GTM Zones of a GTM container workspace.
list(parent: string): TagManager.Schema.ListZonesResponse;
// Lists all GTM Zones of a GTM container workspace.
list(parent: string, optionalArgs: object): TagManager.Schema.ListZonesResponse;
// Deletes a GTM Zone.
remove(path: string): void;
// Reverts changes to a GTM Zone in a GTM Workspace.
revert(path: string): TagManager.Schema.RevertZoneResponse;
// Reverts changes to a GTM Zone in a GTM Workspace.
revert(path: string, optionalArgs: object): TagManager.Schema.RevertZoneResponse;
// Updates a GTM Zone.
update(resource: Schema.Zone, path: string): TagManager.Schema.Zone;
// Updates a GTM Zone.
update(resource: Schema.Zone, path: string, optionalArgs: object): TagManager.Schema.Zone;
}
}
interface EnvironmentsCollection {
// Creates a GTM Environment.
create(resource: Schema.Environment, parent: string): TagManager.Schema.Environment;
// Gets a GTM Environment.
get(path: string): TagManager.Schema.Environment;
// Lists all GTM Environments of a GTM Container.
list(parent: string): TagManager.Schema.ListEnvironmentsResponse;
// Lists all GTM Environments of a GTM Container.
list(parent: string, optionalArgs: object): TagManager.Schema.ListEnvironmentsResponse;
// Re-generates the authorization code for a GTM Environment.
reauthorize(resource: Schema.Environment, path: string): TagManager.Schema.Environment;
// Deletes a GTM Environment.
remove(path: string): void;
// Updates a GTM Environment.
update(resource: Schema.Environment, path: string): TagManager.Schema.Environment;
// Updates a GTM Environment.
update(
resource: Schema.Environment,
path: string,
optionalArgs: object,
): TagManager.Schema.Environment;
}
interface Version_headersCollection {
// Gets the latest container version header
latest(parent: string): TagManager.Schema.ContainerVersionHeader;
// Lists all Container Versions of a GTM Container.
list(parent: string): TagManager.Schema.ListContainerVersionsResponse;
// Lists all Container Versions of a GTM Container.
list(parent: string, optionalArgs: object): TagManager.Schema.ListContainerVersionsResponse;
}
interface VersionsCollection {
// Gets a Container Version.
get(path: string): TagManager.Schema.ContainerVersion;
// Gets a Container Version.
get(path: string, optionalArgs: object): TagManager.Schema.ContainerVersion;
// Gets the live (i.e. published) container version
live(parent: string): TagManager.Schema.ContainerVersion;
// Publishes a Container Version.
publish(path: string): TagManager.Schema.PublishContainerVersionResponse;
// Publishes a Container Version.
publish(path: string, optionalArgs: object): TagManager.Schema.PublishContainerVersionResponse;
// Deletes a Container Version.
remove(path: string): void;
// Sets the latest version used for synchronization of workspaces when detecting conflicts and errors.
set_latest(path: string): TagManager.Schema.ContainerVersion;
// Undeletes a Container Version.
undelete(path: string): TagManager.Schema.ContainerVersion;
// Updates a Container Version.
update(resource: Schema.ContainerVersion, path: string): TagManager.Schema.ContainerVersion;
// Updates a Container Version.
update(
resource: Schema.ContainerVersion,
path: string,
optionalArgs: object,
): TagManager.Schema.ContainerVersion;
}
interface WorkspacesCollection {
Built_in_variables?:
| TagManager.Collection.Accounts.Containers.Workspaces.Built_in_variablesCollection
| undefined;
Folders?: TagManager.Collection.Accounts.Containers.Workspaces.FoldersCollection | undefined;
Tags?: TagManager.Collection.Accounts.Containers.Workspaces.TagsCollection | undefined;
Triggers?: TagManager.Collection.Accounts.Containers.Workspaces.TriggersCollection | undefined;
Variables?:
| TagManager.Collection.Accounts.Containers.Workspaces.VariablesCollection
| undefined;
Zones?: TagManager.Collection.Accounts.Containers.Workspaces.ZonesCollection | undefined;
// Creates a Workspace.
create(resource: Schema.Workspace, parent: string): TagManager.Schema.Workspace;
// Creates a Container Version from the entities present in the workspace, deletes the workspace, and sets the base container version to the newly created version.
create_version(
resource: Schema.CreateContainerVersionRequestVersionOptions,
path: string,
): TagManager.Schema.CreateContainerVersionResponse;
// Gets a Workspace.
get(path: string): TagManager.Schema.Workspace;
// Finds conflicting and modified entities in the workspace.
getStatus(path: string): TagManager.Schema.GetWorkspaceStatusResponse;
// Lists all Workspaces that belong to a GTM Container.
list(parent: string): TagManager.Schema.ListWorkspacesResponse;
// Lists all Workspaces that belong to a GTM Container.
list(parent: string, optionalArgs: object): TagManager.Schema.ListWorkspacesResponse;
// Quick previews a workspace by creating a fake container version from all entities in the provided workspace.
quick_preview(path: string): TagManager.Schema.QuickPreviewResponse;
// Deletes a Workspace.
remove(path: string): void;
// Resolves a merge conflict for a workspace entity by updating it to the resolved entity passed in the request.
resolve_conflict(resource: Schema.Entity, path: string): void;
// Resolves a merge conflict for a workspace entity by updating it to the resolved entity passed in the request.
resolve_conflict(resource: Schema.Entity, path: string, optionalArgs: object): void;
// Syncs a workspace to the latest container version by updating all unmodified workspace entities and displaying conflicts for modified entities.
sync(path: string): TagManager.Schema.SyncWorkspaceResponse;
// Updates a Workspace.
update(resource: Schema.Workspace, path: string): TagManager.Schema.Workspace;
// Updates a Workspace.
update(
resource: Schema.Workspace,
path: string,
optionalArgs: object,
): TagManager.Schema.Workspace;
}
}
interface ContainersCollection {
Environments?: TagManager.Collection.Accounts.Containers.EnvironmentsCollection | undefined;
Version_headers?: TagManager.Collection.Accounts.Containers.Version_headersCollection | undefined;
Versions?: TagManager.Collection.Accounts.Containers.VersionsCollection | undefined;
Workspaces?: TagManager.Collection.Accounts.Containers.WorkspacesCollection | undefined;
// Creates a Container.
create(resource: Schema.Container, parent: string): TagManager.Schema.Container;
// Gets a Container.
get(path: string): TagManager.Schema.Container;
// Lists all Containers that belongs to a GTM Account.
list(parent: string): TagManager.Schema.ListContainersResponse;
// Lists all Containers that belongs to a GTM Account.
list(parent: string, optionalArgs: object): TagManager.Schema.ListContainersResponse;
// Deletes a Container.
remove(path: string): void;
// Updates a Container.
update(resource: Schema.Container, path: string): TagManager.Schema.Container;
// Updates a Container.
update(resource: Schema.Container, path: string, optionalArgs: object): TagManager.Schema.Container;
}
interface User_permissionsCollection {
// Creates a user's Account & Container access.
create(resource: Schema.UserPermission, parent: string): TagManager.Schema.UserPermission;
// Gets a user's Account & Container access.
get(path: string): TagManager.Schema.UserPermission;
// List all users that have access to the account along with Account and Container user access granted to each of them.
list(parent: string): TagManager.Schema.ListUserPermissionsResponse;
// List all users that have access to the account along with Account and Container user access granted to each of them.
list(parent: string, optionalArgs: object): TagManager.Schema.ListUserPermissionsResponse;
// Removes a user from the account, revoking access to it and all of its containers.
remove(path: string): void;
// Updates a user's Account & Container access.
update(resource: Schema.UserPermission, path: string): TagManager.Schema.UserPermission;
}
}
interface AccountsCollection {
Containers?: TagManager.Collection.Accounts.ContainersCollection | undefined;
User_permissions?: TagManager.Collection.Accounts.User_permissionsCollection | undefined;
// Gets a GTM Account.
get(path: string): TagManager.Schema.Account;
// Lists all GTM Accounts that a user has access to.
list(): TagManager.Schema.ListAccountsResponse;
// Lists all GTM Accounts that a user has access to.
list(optionalArgs: object): TagManager.Schema.ListAccountsResponse;
// Updates a GTM Account.
update(resource: Schema.Account, path: string): TagManager.Schema.Account;
// Updates a GTM Account.
update(resource: Schema.Account, path: string, optionalArgs: object): TagManager.Schema.Account;
}
}
namespace Schema {
interface Account {
accountId?: string | undefined;
fingerprint?: string | undefined;
name?: string | undefined;
path?: string | undefined;
shareData?: boolean | undefined;
tagManagerUrl?: string | undefined;
}
interface AccountAccess {
permission?: string | undefined;
}
interface BuiltInVariable {
accountId?: string | undefined;
containerId?: string | undefined;
name?: string | undefined;
path?: string | undefined;
type?: string | undefined;
workspaceId?: string | undefined;
}
interface Condition {
parameter?: TagManager.Schema.Parameter[] | undefined;
type?: string | undefined;
}
interface Container {
accountId?: string | undefined;
containerId?: string | undefined;
domainName?: string[] | undefined;
fingerprint?: string | undefined;
name?: string | undefined;
notes?: string | undefined;
path?: string | undefined;
publicId?: string | undefined;
tagManagerUrl?: string | undefined;
usageContext?: string[] | undefined;
}
interface ContainerAccess {
containerId?: string | undefined;
permission?: string | undefined;
}
interface ContainerVersion {
accountId?: string | undefined;
builtInVariable?: TagManager.Schema.BuiltInVariable[] | undefined;
container?: TagManager.Schema.Container | undefined;
containerId?: string | undefined;
containerVersionId?: string | undefined;
customTemplate?: TagManager.Schema.CustomTemplate[] | undefined;
deleted?: boolean | undefined;
description?: string | undefined;
fingerprint?: string | undefined;
folder?: TagManager.Schema.Folder[] | undefined;
name?: string | undefined;
path?: string | undefined;
tag?: TagManager.Schema.Tag[] | undefined;
tagManagerUrl?: string | undefined;
trigger?: TagManager.Schema.Trigger[] | undefined;
variable?: TagManager.Schema.Variable[] | undefined;
zone?: TagManager.Schema.Zone[] | undefined;
}
interface ContainerVersionHeader {
accountId?: string | undefined;
containerId?: string | undefined;
containerVersionId?: string | undefined;
deleted?: boolean | undefined;
name?: string | undefined;
numCustomTemplates?: string | undefined;
numMacros?: string | undefined;
numRules?: string | undefined;
numTags?: string | undefined;
numTriggers?: string | undefined;
numVariables?: string | undefined;
numZones?: string | undefined;
path?: string | undefined;
}
interface CreateBuiltInVariableResponse {
builtInVariable?: TagManager.Schema.BuiltInVariable[] | undefined;
}
interface CreateContainerVersionRequestVersionOptions {
name?: string | undefined;
notes?: string | undefined;
}
interface CreateContainerVersionResponse {
compilerError?: boolean | undefined;
containerVersion?: TagManager.Schema.ContainerVersion | undefined;
newWorkspacePath?: string | undefined;
syncStatus?: TagManager.Schema.SyncStatus | undefined;
}
interface CustomTemplate {
accountId?: string | undefined;
containerId?: string | undefined;
fingerprint?: string | undefined;
name?: string | undefined;
path?: string | undefined;
tagManagerUrl?: string | undefined;
templateData?: string | undefined;
templateId?: string | undefined;
workspaceId?: string | undefined;
}
interface Entity {
changeStatus?: string | undefined;
folder?: TagManager.Schema.Folder | undefined;
tag?: TagManager.Schema.Tag | undefined;
trigger?: TagManager.Schema.Trigger | undefined;
variable?: TagManager.Schema.Variable | undefined;
}
interface Environment {
accountId?: string | undefined;
authorizationCode?: string | undefined;
authorizationTimestamp?: TagManager.Schema.Timestamp | undefined;
containerId?: string | undefined;
containerVersionId?: string | undefined;
description?: string | undefined;
enableDebug?: boolean | undefined;
environmentId?: string | undefined;
fingerprint?: string | undefined;
name?: string | undefined;
path?: string | undefined;
tagManagerUrl?: string | undefined;
type?: string | undefined;
url?: string | undefined;
workspaceId?: string | undefined;
}
interface Folder {
accountId?: string | undefined;
containerId?: string | undefined;
fingerprint?: string | undefined;
folderId?: string | undefined;
name?: string | undefined;
notes?: string | undefined;
path?: string | undefined;
tagManagerUrl?: string | undefined;
workspaceId?: string | undefined;
}
interface FolderEntities {
nextPageToken?: string | undefined;
tag?: TagManager.Schema.Tag[] | undefined;
trigger?: TagManager.Schema.Trigger[] | undefined;
variable?: TagManager.Schema.Variable[] | undefined;
}
interface GetWorkspaceStatusResponse {
mergeConflict?: TagManager.Schema.MergeConflict[] | undefined;
workspaceChange?: TagManager.Schema.Entity[] | undefined;
}
interface ListAccountsResponse {
account?: TagManager.Schema.Account[] | undefined;
nextPageToken?: string | undefined;
}
interface ListContainerVersionsResponse {
containerVersionHeader?: TagManager.Schema.ContainerVersionHeader[] | undefined;
nextPageToken?: string | undefined;
}
interface ListContainersResponse {
container?: TagManager.Schema.Container[] | undefined;
nextPageToken?: string | undefined;
}
interface ListEnabledBuiltInVariablesResponse {
builtInVariable?: TagManager.Schema.BuiltInVariable[] | undefined;
nextPageToken?: string | undefined;
}
interface ListEnvironmentsResponse {
environment?: TagManager.Schema.Environment[] | undefined;
nextPageToken?: string | undefined;
}
interface ListFoldersResponse {
folder?: TagManager.Schema.Folder[] | undefined;
nextPageToken?: string | undefined;
}
interface ListTagsResponse {
nextPageToken?: string | undefined;
tag?: TagManager.Schema.Tag[] | undefined;
}
interface ListTriggersResponse {
nextPageToken?: string | undefined;
trigger?: TagManager.Schema.Trigger[] | undefined;
}
interface ListUserPermissionsResponse {
nextPageToken?: string | undefined;
userPermission?: TagManager.Schema.UserPermission[] | undefined;
}
interface ListVariablesResponse {
nextPageToken?: string | undefined;
variable?: TagManager.Schema.Variable[] | undefined;
}
interface ListWorkspacesResponse {
nextPageToken?: string | undefined;
workspace?: TagManager.Schema.Workspace[] | undefined;
}
interface ListZonesResponse {
nextPageToken?: string | undefined;
zone?: TagManager.Schema.Zone[] | undefined;
}
interface MergeConflict {
entityInBaseVersion?: TagManager.Schema.Entity | undefined;
entityInWorkspace?: TagManager.Schema.Entity | undefined;
}
interface Parameter {
key?: string | undefined;
list?: TagManager.Schema.Parameter[] | undefined;
map?: TagManager.Schema.Parameter[] | undefined;
type?: string | undefined;
value?: string | undefined;
}
interface PublishContainerVersionResponse {
compilerError?: boolean | undefined;
containerVersion?: TagManager.Schema.ContainerVersion | undefined;
}
interface QuickPreviewResponse {
compilerError?: boolean | undefined;
containerVersion?: TagManager.Schema.ContainerVersion | undefined;
syncStatus?: TagManager.Schema.SyncStatus | undefined;
}
interface RevertBuiltInVariableResponse {
enabled?: boolean | undefined;
}
interface RevertFolderResponse {
folder?: TagManager.Schema.Folder | undefined;
}
interface RevertTagResponse {
tag?: TagManager.Schema.Tag | undefined;
}
interface RevertTriggerResponse {
trigger?: TagManager.Schema.Trigger | undefined;
}
interface RevertVariableResponse {
variable?: TagManager.Schema.Variable | undefined;
}
interface RevertZoneResponse {
zone?: TagManager.Schema.Zone | undefined;
}
interface SetupTag {
stopOnSetupFailure?: boolean | undefined;
tagName?: string | undefined;
}
interface SyncStatus {
mergeConflict?: boolean | undefined;
syncError?: boolean | undefined;
}
interface SyncWorkspaceResponse {
mergeConflict?: TagManager.Schema.MergeConflict[] | undefined;
syncStatus?: TagManager.Schema.SyncStatus | undefined;
}
interface Tag {
accountId?: string | undefined;
blockingRuleId?: string[] | undefined;
blockingTriggerId?: string[] | undefined;
containerId?: string | undefined;
fingerprint?: string | undefined;
firingRuleId?: string[] | undefined;
firingTriggerId?: string[] | undefined;
liveOnly?: boolean | undefined;
name?: string | undefined;
notes?: string | undefined;
parameter?: TagManager.Schema.Parameter[] | undefined;
parentFolderId?: string | undefined;
path?: string | undefined;
paused?: boolean | undefined;
priority?: TagManager.Schema.Parameter | undefined;
scheduleEndMs?: string | undefined;
scheduleStartMs?: string | undefined;
setupTag?: TagManager.Schema.SetupTag[] | undefined;
tagFiringOption?: string | undefined;
tagId?: string | undefined;
tagManagerUrl?: string | undefined;
teardownTag?: TagManager.Schema.TeardownTag[] | undefined;
type?: string | undefined;
workspaceId?: string | undefined;
}
interface TeardownTag {
stopTeardownOnFailure?: boolean | undefined;
tagName?: string | undefined;
}
interface Timestamp {
nanos?: number | undefined;
seconds?: string | undefined;
}
interface Trigger {
accountId?: string | undefined;
autoEventFilter?: TagManager.Schema.Condition[] | undefined;
checkValidation?: TagManager.Schema.Parameter | undefined;
containerId?: string | undefined;
continuousTimeMinMilliseconds?: TagManager.Schema.Parameter | undefined;
customEventFilter?: TagManager.Schema.Condition[] | undefined;
eventName?: TagManager.Schema.Parameter | undefined;
filter?: TagManager.Schema.Condition[] | undefined;
fingerprint?: string | undefined;
horizontalScrollPercentageList?: TagManager.Schema.Parameter | undefined;
interval?: TagManager.Schema.Parameter | undefined;
intervalSeconds?: TagManager.Schema.Parameter | undefined;
limit?: TagManager.Schema.Parameter | undefined;
maxTimerLengthSeconds?: TagManager.Schema.Parameter | undefined;
name?: string | undefined;
notes?: string | undefined;
parameter?: TagManager.Schema.Parameter[] | undefined;
parentFolderId?: string | undefined;
path?: string | undefined;
selector?: TagManager.Schema.Parameter | undefined;
tagManagerUrl?: string | undefined;
totalTimeMinMilliseconds?: TagManager.Schema.Parameter | undefined;
triggerId?: string | undefined;
type?: string | undefined;
uniqueTriggerId?: TagManager.Schema.Parameter | undefined;
verticalScrollPercentageList?: TagManager.Schema.Parameter | undefined;
visibilitySelector?: TagManager.Schema.Parameter | undefined;
visiblePercentageMax?: TagManager.Schema.Parameter | undefined;
visiblePercentageMin?: TagManager.Schema.Parameter | undefined;
waitForTags?: TagManager.Schema.Parameter | undefined;
waitForTagsTimeout?: TagManager.Schema.Parameter | undefined;
workspaceId?: string | undefined;
}
interface UserPermission {
accountAccess?: TagManager.Schema.AccountAccess | undefined;
accountId?: string | undefined;
containerAccess?: TagManager.Schema.ContainerAccess[] | undefined;
emailAddress?: string | undefined;
path?: string | undefined;
}
interface Variable {
accountId?: string | undefined;
containerId?: string | undefined;
disablingTriggerId?: string[] | undefined;
enablingTriggerId?: string[] | undefined;
fingerprint?: string | undefined;
formatValue?: TagManager.Schema.VariableFormatValue | undefined;
name?: string | undefined;
notes?: string | undefined;
parameter?: TagManager.Schema.Parameter[] | undefined;
parentFolderId?: string | undefined;
path?: string | undefined;
scheduleEndMs?: string | undefined;
scheduleStartMs?: string | undefined;
tagManagerUrl?: string | undefined;
type?: string | undefined;
variableId?: string | undefined;
workspaceId?: string | undefined;
}
interface VariableFormatValue {
caseConversionType?: string | undefined;
convertFalseToValue?: TagManager.Schema.Parameter | undefined;
convertNullToValue?: TagManager.Schema.Parameter | undefined;
convertTrueToValue?: TagManager.Schema.Parameter | undefined;
convertUndefinedToValue?: TagManager.Schema.Parameter | undefined;
}
interface Workspace {
accountId?: string | undefined;
containerId?: string | undefined;
description?: string | undefined;
fingerprint?: string | undefined;
name?: string | undefined;
path?: string | undefined;
tagManagerUrl?: string | undefined;
workspaceId?: string | undefined;
}
interface Zone {
accountId?: string | undefined;
boundary?: TagManager.Schema.ZoneBoundary | undefined;
childContainer?: TagManager.Schema.ZoneChildContainer[] | undefined;
containerId?: string | undefined;
fingerprint?: string | undefined;
name?: string | undefined;
notes?: string | undefined;
path?: string | undefined;
tagManagerUrl?: string | undefined;
typeRestriction?: TagManager.Schema.ZoneTypeRestriction | undefined;
workspaceId?: string | undefined;
zoneId?: string | undefined;
}
interface ZoneBoundary {
condition?: TagManager.Schema.Condition[] | undefined;
customEvaluationTriggerId?: string[] | undefined;
}
interface ZoneChildContainer {
nickname?: string | undefined;
publicId?: string | undefined;
}
interface ZoneTypeRestriction {
enable?: boolean | undefined;
whitelistedTypeId?: string[] | undefined;
}
}
}
interface TagManager {
Accounts?: TagManager.Collection.AccountsCollection | undefined;
// Create a new instance of Account
newAccount(): TagManager.Schema.Account;
// Create a new instance of AccountAccess
newAccountAccess(): TagManager.Schema.AccountAccess;
// Create a new instance of BuiltInVariable
newBuiltInVariable(): TagManager.Schema.BuiltInVariable;
// Create a new instance of Condition
newCondition(): TagManager.Schema.Condition;
// Create a new instance of Container
newContainer(): TagManager.Schema.Container;
// Create a new instance of ContainerAccess
newContainerAccess(): TagManager.Schema.ContainerAccess;
// Create a new instance of ContainerVersion
newContainerVersion(): TagManager.Schema.ContainerVersion;
// Create a new instance of CreateContainerVersionRequestVersionOptions
newCreateContainerVersionRequestVersionOptions(): TagManager.Schema.CreateContainerVersionRequestVersionOptions;
// Create a new instance of CustomTemplate
newCustomTemplate(): TagManager.Schema.CustomTemplate;
// Create a new instance of Entity
newEntity(): TagManager.Schema.Entity;
// Create a new instance of Environment
newEnvironment(): TagManager.Schema.Environment;
// Create a new instance of Folder
newFolder(): TagManager.Schema.Folder;
// Create a new instance of Parameter
newParameter(): TagManager.Schema.Parameter;
// Create a new instance of SetupTag
newSetupTag(): TagManager.Schema.SetupTag;
// Create a new instance of Tag
newTag(): TagManager.Schema.Tag;
// Create a new instance of TeardownTag
newTeardownTag(): TagManager.Schema.TeardownTag;
// Create a new instance of Timestamp
newTimestamp(): TagManager.Schema.Timestamp;
// Create a new instance of Trigger
newTrigger(): TagManager.Schema.Trigger;
// Create a new instance of UserPermission
newUserPermission(): TagManager.Schema.UserPermission;
// Create a new instance of Variable
newVariable(): TagManager.Schema.Variable;
// Create a new instance of VariableFormatValue
newVariableFormatValue(): TagManager.Schema.VariableFormatValue;
// Create a new instance of Workspace
newWorkspace(): TagManager.Schema.Workspace;
// Create a new instance of Zone
newZone(): TagManager.Schema.Zone;
// Create a new instance of ZoneBoundary
newZoneBoundary(): TagManager.Schema.ZoneBoundary;
// Create a new instance of ZoneChildContainer
newZoneChildContainer(): TagManager.Schema.ZoneChildContainer;
// Create a new instance of ZoneTypeRestriction
newZoneTypeRestriction(): TagManager.Schema.ZoneTypeRestriction;
}
}
declare var TagManager: GoogleAppsScript.TagManager;

View File

@ -0,0 +1,102 @@
declare namespace GoogleAppsScript {
namespace Tasks {
namespace Collection {
interface TasklistsCollection {
// Returns the authenticated user's specified task list.
get(tasklist: string): Tasks.Schema.TaskList;
// Creates a new task list and adds it to the authenticated user's task lists.
insert(resource: Schema.TaskList): Tasks.Schema.TaskList;
// Returns all the authenticated user's task lists.
list(): Tasks.Schema.TaskLists;
// Returns all the authenticated user's task lists.
list(optionalArgs: object): Tasks.Schema.TaskLists;
// Updates the authenticated user's specified task list. This method supports patch semantics.
patch(resource: Schema.TaskList, tasklist: string): Tasks.Schema.TaskList;
// Deletes the authenticated user's specified task list.
remove(tasklist: string): void;
// Updates the authenticated user's specified task list.
update(resource: Schema.TaskList, tasklist: string): Tasks.Schema.TaskList;
}
interface TasksCollection {
// Clears all completed tasks from the specified task list. The affected tasks will be marked as 'hidden' and no longer be returned by default when retrieving all tasks for a task list.
clear(tasklist: string): void;
// Returns the specified task.
get(tasklist: string, task: string): Tasks.Schema.Task;
// Creates a new task on the specified task list.
insert(resource: Schema.Task, tasklist: string): Tasks.Schema.Task;
// Creates a new task on the specified task list.
insert(resource: Schema.Task, tasklist: string, optionalArgs: object): Tasks.Schema.Task;
// Returns all tasks in the specified task list.
list(tasklist: string): Tasks.Schema.Tasks;
// Returns all tasks in the specified task list.
list(tasklist: string, optionalArgs: object): Tasks.Schema.Tasks;
// Moves the specified task to another position in the task list. This can include putting it as a child task under a new parent and/or move it to a different position among its sibling tasks.
move(tasklist: string, task: string): Tasks.Schema.Task;
// Moves the specified task to another position in the task list. This can include putting it as a child task under a new parent and/or move it to a different position among its sibling tasks.
move(tasklist: string, task: string, optionalArgs: object): Tasks.Schema.Task;
// Updates the specified task. This method supports patch semantics.
patch(resource: Schema.Task, tasklist: string, task: string): Tasks.Schema.Task;
// Deletes the specified task from the task list.
remove(tasklist: string, task: string): void;
// Updates the specified task.
update(resource: Schema.Task, tasklist: string, task: string): Tasks.Schema.Task;
}
}
namespace Schema {
interface Task {
completed?: string | undefined;
deleted?: boolean | undefined;
due?: string | undefined;
etag?: string | undefined;
hidden?: boolean | undefined;
id?: string | undefined;
kind?: string | undefined;
links?: Tasks.Schema.TaskLinks[] | undefined;
notes?: string | undefined;
parent?: string | undefined;
position?: string | undefined;
selfLink?: string | undefined;
status?: string | undefined;
title?: string | undefined;
updated?: string | undefined;
}
interface TaskLinks {
description?: string | undefined;
link?: string | undefined;
type?: string | undefined;
}
interface TaskList {
etag?: string | undefined;
id?: string | undefined;
kind?: string | undefined;
selfLink?: string | undefined;
title?: string | undefined;
updated?: string | undefined;
}
interface TaskLists {
etag?: string | undefined;
items?: Tasks.Schema.TaskList[] | undefined;
kind?: string | undefined;
nextPageToken?: string | undefined;
}
interface Tasks {
etag?: string | undefined;
items?: Tasks.Schema.Task[] | undefined;
kind?: string | undefined;
nextPageToken?: string | undefined;
}
}
}
interface Tasks {
Tasklists?: Tasks.Collection.TasklistsCollection | undefined;
Tasks?: Tasks.Collection.TasksCollection | undefined;
// Create a new instance of Task
newTask(): Tasks.Schema.Task;
// Create a new instance of TaskLinks
newTaskLinks(): Tasks.Schema.TaskLinks;
// Create a new instance of TaskList
newTaskList(): Tasks.Schema.TaskList;
}
}
declare var Tasks: GoogleAppsScript.Tasks;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,140 @@
declare namespace GoogleAppsScript {
namespace YouTubeAnalytics {
namespace Collection {
interface GroupItemsCollection {
// Creates a group item.
insert(resource: Schema.GroupItem): YouTubeAnalytics.Schema.GroupItem;
// Creates a group item.
insert(resource: Schema.GroupItem, optionalArgs: object): YouTubeAnalytics.Schema.GroupItem;
// Returns a collection of group items that match the API request parameters.
list(): YouTubeAnalytics.Schema.ListGroupItemsResponse;
// Returns a collection of group items that match the API request parameters.
list(optionalArgs: object): YouTubeAnalytics.Schema.ListGroupItemsResponse;
// Removes an item from a group.
remove(): YouTubeAnalytics.Schema.EmptyResponse;
// Removes an item from a group.
remove(optionalArgs: object): YouTubeAnalytics.Schema.EmptyResponse;
}
interface GroupsCollection {
// Creates a group.
insert(resource: Schema.Group): YouTubeAnalytics.Schema.Group;
// Creates a group.
insert(resource: Schema.Group, optionalArgs: object): YouTubeAnalytics.Schema.Group;
// Returns a collection of groups that match the API request parameters. For
// example, you can retrieve all groups that the authenticated user owns,
// or you can retrieve one or more groups by their unique IDs.
list(): YouTubeAnalytics.Schema.ListGroupsResponse;
// Returns a collection of groups that match the API request parameters. For
// example, you can retrieve all groups that the authenticated user owns,
// or you can retrieve one or more groups by their unique IDs.
list(optionalArgs: object): YouTubeAnalytics.Schema.ListGroupsResponse;
// Deletes a group.
remove(): YouTubeAnalytics.Schema.EmptyResponse;
// Deletes a group.
remove(optionalArgs: object): YouTubeAnalytics.Schema.EmptyResponse;
// Modifies a group. For example, you could change a group's title.
update(resource: Schema.Group): YouTubeAnalytics.Schema.Group;
// Modifies a group. For example, you could change a group's title.
update(resource: Schema.Group, optionalArgs: object): YouTubeAnalytics.Schema.Group;
}
interface ReportsCollection {
// Retrieve your YouTube Analytics reports.
query(): YouTubeAnalytics.Schema.QueryResponse;
// Retrieve your YouTube Analytics reports.
query(optionalArgs: object): YouTubeAnalytics.Schema.QueryResponse;
}
}
namespace Schema {
interface EmptyResponse {
errors?: YouTubeAnalytics.Schema.Errors | undefined;
}
interface ErrorProto {
argument?: string[] | undefined;
code?: string | undefined;
debugInfo?: string | undefined;
domain?: string | undefined;
externalErrorMessage?: string | undefined;
location?: string | undefined;
locationType?: string | undefined;
}
interface Errors {
code?: string | undefined;
error?: YouTubeAnalytics.Schema.ErrorProto[] | undefined;
requestId?: string | undefined;
}
interface Group {
contentDetails?: YouTubeAnalytics.Schema.GroupContentDetails | undefined;
errors?: YouTubeAnalytics.Schema.Errors | undefined;
etag?: string | undefined;
id?: string | undefined;
kind?: string | undefined;
snippet?: YouTubeAnalytics.Schema.GroupSnippet | undefined;
}
interface GroupContentDetails {
itemCount?: string | undefined;
itemType?: string | undefined;
}
interface GroupItem {
errors?: YouTubeAnalytics.Schema.Errors | undefined;
etag?: string | undefined;
groupId?: string | undefined;
id?: string | undefined;
kind?: string | undefined;
resource?: YouTubeAnalytics.Schema.GroupItemResource | undefined;
}
interface GroupItemResource {
id?: string | undefined;
kind?: string | undefined;
}
interface GroupSnippet {
publishedAt?: string | undefined;
title?: string | undefined;
}
interface ListGroupItemsResponse {
errors?: YouTubeAnalytics.Schema.Errors | undefined;
etag?: string | undefined;
items?: YouTubeAnalytics.Schema.GroupItem[] | undefined;
kind?: string | undefined;
}
interface ListGroupsResponse {
errors?: YouTubeAnalytics.Schema.Errors | undefined;
etag?: string | undefined;
items?: YouTubeAnalytics.Schema.Group[] | undefined;
kind?: string | undefined;
nextPageToken?: string | undefined;
}
interface QueryResponse {
columnHeaders?: YouTubeAnalytics.Schema.ResultTableColumnHeader[] | undefined;
errors?: YouTubeAnalytics.Schema.Errors | undefined;
kind?: string | undefined;
rows?: any[][] | undefined;
}
interface ResultTableColumnHeader {
columnType?: string | undefined;
dataType?: string | undefined;
name?: string | undefined;
}
}
}
interface YouTubeAnalytics {
GroupItems?: YouTubeAnalytics.Collection.GroupItemsCollection | undefined;
Groups?: YouTubeAnalytics.Collection.GroupsCollection | undefined;
Reports?: YouTubeAnalytics.Collection.ReportsCollection | undefined;
// Create a new instance of ErrorProto
newErrorProto(): YouTubeAnalytics.Schema.ErrorProto;
// Create a new instance of Errors
newErrors(): YouTubeAnalytics.Schema.Errors;
// Create a new instance of Group
newGroup(): YouTubeAnalytics.Schema.Group;
// Create a new instance of GroupContentDetails
newGroupContentDetails(): YouTubeAnalytics.Schema.GroupContentDetails;
// Create a new instance of GroupItem
newGroupItem(): YouTubeAnalytics.Schema.GroupItem;
// Create a new instance of GroupItemResource
newGroupItemResource(): YouTubeAnalytics.Schema.GroupItemResource;
// Create a new instance of GroupSnippet
newGroupSnippet(): YouTubeAnalytics.Schema.GroupSnippet;
}
}
declare var YouTubeAnalytics: GoogleAppsScript.YouTubeAnalytics;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,115 @@
/// <reference path="google-apps-script.script.d.ts" />
/// <reference path="google-apps-script.spreadsheet.d.ts" />
/// <reference path="google-apps-script.slides.d.ts" />
declare namespace GoogleAppsScript {
/**
* Google Apps Script Events
* @see https://developers.google.com/apps-script/guides/triggers/events
*/
namespace Events {
// Internal interfaces
interface AppsScriptEvent {
authMode: Script.AuthMode;
triggerUid: string;
user: Base.User;
}
interface AppsScriptHttpRequestEvent {
parameter: { [key: string]: string };
pathInfo: string;
contextPath: string;
contentLength: number;
queryString: string;
parameters: { [key: string]: string[] };
}
interface AppsScriptHttpRequestEventPostData {
length: number;
type: string;
contents: string;
name: string;
}
// External interfaces
interface SheetsOnOpen extends AppsScriptEvent {
source: Spreadsheet.Spreadsheet;
}
type SheetsOnChangeChangeType =
| "EDIT"
| "INSERT_ROW"
| "INSERT_COLUMN"
| "REMOVE_ROW"
| "REMOVE_COLUMN"
| "INSERT_GRID"
| "REMOVE_GRID"
| "FORMAT"
| "OTHER";
interface SheetsOnChange extends AppsScriptEvent {
changeType: SheetsOnChangeChangeType;
source: Spreadsheet.Spreadsheet;
}
interface SheetsOnEdit extends AppsScriptEvent {
oldValue: string;
range: Spreadsheet.Range;
source: Spreadsheet.Spreadsheet;
value: string;
}
interface SheetsOnFormSubmit extends AppsScriptEvent {
namedValues: { [key: string]: string[] };
range: Spreadsheet.Range;
values: string[];
}
interface FormsOnFormSubmit extends AppsScriptEvent {
response: Forms.FormResponse;
source: Forms.Form;
}
interface DocsOnOpen extends AppsScriptEvent {
source: Document.Document;
}
interface SlidesOnOpen extends AppsScriptEvent {
source: Slides.Presentation;
}
interface FormsOnOpen extends AppsScriptEvent {
source: Forms.Form;
}
// TODO: Is there a `user` attribute?
interface CalendarEventUpdated extends AppsScriptEvent {
calendarId: string;
}
interface AddonOnInstall {
authMode: Script.AuthMode;
}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface DoGet extends AppsScriptHttpRequestEvent {
}
interface DoPost extends AppsScriptHttpRequestEvent {
postData: AppsScriptHttpRequestEventPostData;
}
interface TimeDriven {
authMode: Script.AuthMode;
year: number;
month: number;
"week-of-year": number;
"day-of-month": number;
"day-of-week": number;
hour: number;
minute: number;
second: number;
timezone: string;
triggerUid: string;
}
}
}

View File

@ -0,0 +1,599 @@
/// <reference path="google-apps-script.types.d.ts" />
interface Console {
error(): void;
error(formatOrObject: object | string, ...values: any[]): void;
info(): void;
info(formatOrObject: object | string, ...values: any[]): void;
log(): void;
log(formatOrObject: object | string, ...values: any[]): void;
time(label: string): void;
timeEnd(label: string): void;
warn(): void;
warn(formatOrObject: object | string, ...values: any[]): void;
}
declare namespace GoogleAppsScript {
namespace Base {
/**
* A data interchange object for Apps Script services.
*/
interface Blob extends BlobSource {
copyBlob(): Blob;
getAs(contentType: string): Blob;
getBytes(): Byte[];
getContentType(): string | null;
getDataAsString(): string;
getDataAsString(charset: string): string;
getName(): string | null;
isGoogleType(): boolean;
setBytes(data: Byte[]): Blob;
setContentType(contentType: string | null): Blob;
setContentTypeFromExtension(): Blob;
setDataFromString(string: string): Blob;
setDataFromString(string: string, charset: string): Blob;
setName(name: string): Blob;
/** @deprecated DO NOT USE */ getAllBlobs(): Blob[];
}
/**
* Interface for objects that can export their data as a Blob.
* Implementing classes
*
* NameBrief description
*
* AttachmentA Sites Attachment such as a file attached to a page.
*
* BlobA data interchange object for Apps Script services.
*
* ChartA Chart object, which can be converted to a static image.
*
* DocumentA document, containing rich text and elements such as tables and lists.
*
* EmbeddedChartRepresents a chart that has been embedded into a spreadsheet.
*
* FileA file in Google Drive.
*
* GmailAttachmentAn attachment from Gmail.
*
* HTTPResponseThis class allows users to access specific information on HTTP responses.
*
* HtmlOutputAn HtmlOutput object that can be served from a script.
*
* ImageA PageElement representing an image.
*
* InlineImageAn element representing an embedded image.
*
* JdbcBlobA JDBC Blob.
*
* JdbcClobA JDBC Clob.
*
* PictureFillA fill that renders an image that's stretched to the dimensions of its container.
*
* PositionedImageFixed position image anchored to a Paragraph.
*
* SpreadsheetAccess and modify Google Sheets files.
*
* StaticMapAllows for the creation and decoration of static map images.
*/
interface BlobSource {
getAs(contentType: string): Blob;
getBlob(): Blob;
}
/**
* This class provides access to dialog boxes specific to Google Sheets.
*
* The methods in this class are only available for use in the context of a Google Spreadsheet.
* Please use G Suite dialogs instead.
* See also
*
* ButtonSet
*/
interface Browser {
Buttons: typeof ButtonSet;
inputBox(prompt: string): string;
inputBox(prompt: string, buttons: ButtonSet): string;
inputBox(title: string, prompt: string, buttons: ButtonSet): string;
msgBox(prompt: string): string;
msgBox(prompt: string, buttons: ButtonSet): string;
msgBox(title: string, prompt: string, buttons: ButtonSet): string;
}
/**
* An enum representing predetermined, localized dialog buttons returned by an alert or PromptResponse.getSelectedButton() to indicate
* which button in a dialog the user clicked. These values cannot be set; to add buttons to an
* alert or prompt, use ButtonSet instead.
*
* // Display a dialog box with a message and "Yes" and "No" buttons.
* var ui = DocumentApp.getUi();
* var response = ui.alert('Are you sure you want to continue?', ui.ButtonSet.YES_NO);
*
* // Process the user's response.
* if (response == ui.Button.YES) {
* Logger.log('The user clicked "Yes."');
* } else {
* Logger.log('The user clicked "No" or the dialog\'s close button.');
* }
*/
enum Button {
CLOSE,
OK,
CANCEL,
YES,
NO,
}
/**
* An enum representing predetermined, localized sets of one or more dialog buttons that can be
* added to an alert or a prompt. To determine which button the user clicked,
* use Button.
*
* // Display a dialog box with a message and "Yes" and "No" buttons.
* var ui = DocumentApp.getUi();
* var response = ui.alert('Are you sure you want to continue?', ui.ButtonSet.YES_NO);
*
* // Process the user's response.
* if (response == ui.Button.YES) {
* Logger.log('The user clicked "Yes."');
* } else {
* Logger.log('The user clicked "No" or the dialog\'s close button.');
* }
*/
enum ButtonSet {
OK,
OK_CANCEL,
YES_NO,
YES_NO_CANCEL,
}
/**
* The types of Colors
*/
enum ColorType {
UNSUPPORTED,
RGB,
THEME,
}
/**
* This class allows the developer to write out text to the debugging logs.
*/
interface Logger {
clear(): void;
getLog(): string;
log(data: any): Logger;
log(format: string, ...values: any[]): Logger;
}
/**
* A custom menu in an instance of the user interface for a Google App. A script can only interact
* with the UI for the current instance of an open document or form, and only if the script is container-bound to the document or form. For more
* information, see the guide to menus.
*
* // Add a custom menu to the active spreadsheet, including a separator and a sub-menu.
* function onOpen(e) {
* SpreadsheetApp.getUi()
* .createMenu('My Menu')
* .addItem('My Menu Item', 'myFunction')
* .addSeparator()
* .addSubMenu(SpreadsheetApp.getUi().createMenu('My Submenu')
* .addItem('One Submenu Item', 'mySecondFunction')
* .addItem('Another Submenu Item', 'myThirdFunction'))
* .addToUi();
* }
*/
interface Menu {
addItem(caption: string, functionName: string): Menu;
addSeparator(): Menu;
addSubMenu(menu: Menu): Menu;
addToUi(): void;
}
/**
* An enumeration that provides access to MIME-type declarations without typing the strings
* explicitly. Methods that expect a MIME type rendered as a string (for example,
* 'image/png') also accept any of the values below, so long as the method supports the
* underlying MIME type.
*
* // Use MimeType enum to log the name of every Google Doc in the user's Drive.
* var docs = DriveApp.getFilesByType(MimeType.GOOGLE_DOCS);
* while (docs.hasNext()) {
* var doc = docs.next();
* Logger.log(doc.getName())
* }
*
* // Use plain string to log the size of every PNG in the user's Drive.
* var pngs = DriveApp.getFilesByType('image/png');
* while (pngs.hasNext()) {
* var png = pngs.next();
* Logger.log(png.getSize());
* }
*/
interface MimeType {
GOOGLE_APPS_SCRIPT: string;
GOOGLE_DRAWINGS: string;
GOOGLE_DOCS: string;
GOOGLE_FORMS: string;
GOOGLE_SHEETS: string;
GOOGLE_SITES: string;
GOOGLE_SLIDES: string;
FOLDER: string;
SHORTCUT: string;
BMP: string;
GIF: string;
JPEG: string;
PNG: string;
SVG: string;
PDF: string;
CSS: string;
CSV: string;
HTML: string;
JAVASCRIPT: string;
PLAIN_TEXT: string;
RTF: string;
OPENDOCUMENT_GRAPHICS: string;
OPENDOCUMENT_PRESENTATION: string;
OPENDOCUMENT_SPREADSHEET: string;
OPENDOCUMENT_TEXT: string;
MICROSOFT_EXCEL: string;
MICROSOFT_EXCEL_LEGACY: string;
MICROSOFT_POWERPOINT: string;
MICROSOFT_POWERPOINT_LEGACY: string;
MICROSOFT_WORD: string;
MICROSOFT_WORD_LEGACY: string;
ZIP: string;
}
/**
* An enum representing the months of the year.
*/
enum Month {
JANUARY,
FEBRUARY,
MARCH,
APRIL,
MAY,
JUNE,
JULY,
AUGUST,
SEPTEMBER,
OCTOBER,
NOVEMBER,
DECEMBER,
}
/**
* A response to a prompt dialog displayed in the
* user-interface environment for a Google App. The response contains any text the user entered in
* the dialog's input field and indicates which button the user clicked to dismiss the dialog.
*
* // Display a dialog box with a title, message, input field, and "Yes" and "No" buttons. The
* // user can also close the dialog by clicking the close button in its title bar.
* var ui = DocumentApp.getUi();
* var response = ui.prompt('Getting to know you', 'May I know your name?', ui.ButtonSet.YES_NO);
*
* // Process the user's response.
* if (response.getSelectedButton() == ui.Button.YES) {
* Logger.log('The user\'s name is %s.', response.getResponseText());
* } else if (response.getSelectedButton() == ui.Button.NO) {
* Logger.log('The user didn\'t want to provide a name.');
* } else {
* Logger.log('The user clicked the close button in the dialog\'s title bar.');
* }
*/
interface PromptResponse {
getResponseText(): string;
getSelectedButton(): Button;
}
/**
* A color defined by red, green, blue color channels.
*/
interface RgbColor {
asHexString(): string;
getBlue(): Integer;
getColorType(): ColorType;
getGreen(): Integer;
getRed(): Integer;
}
/**
* The Session class provides access to session information, such as the user's email address (in
* some circumstances) and language setting.
*/
interface Session {
getActiveUser(): User;
getActiveUserLocale(): string;
getEffectiveUser(): User;
getScriptTimeZone(): string;
getTemporaryActiveUserKey(): string;
/** @deprecated DO NOT USE */ getTimeZone(): string;
/** @deprecated DO NOT USE */ getUser(): User;
}
/**
* An instance of the user-interface environment for a Google App that allows the script to add
* features like menus, dialogs, and sidebars. A script can only interact with the UI for the
* current instance of an open editor, and only if the script is container-bound to the editor.
*
* // Display a dialog box with a title, message, input field, and "Yes" and "No" buttons. The
* // user can also close the dialog by clicking the close button in its title bar.
* var ui = SpreadsheetApp.getUi();
* var response = ui.prompt('Getting to know you', 'May I know your name?', ui.ButtonSet.YES_NO);
*
* // Process the user's response.
* if (response.getSelectedButton() == ui.Button.YES) {
* Logger.log('The user\'s name is %s.', response.getResponseText());
* } else if (response.getSelectedButton() == ui.Button.NO) {
* Logger.log('The user didn\'t want to provide a name.');
* } else {
* Logger.log('The user clicked the close button in the dialog\'s title bar.');
* }
*/
interface Ui {
Button: typeof Button;
ButtonSet: typeof ButtonSet;
alert(prompt: string): Button;
alert(prompt: string, buttons: ButtonSet): Button;
alert(title: string, prompt: string, buttons: ButtonSet): Button;
createAddonMenu(): Menu;
createMenu(caption: string): Menu;
prompt(prompt: string): PromptResponse;
prompt(prompt: string, buttons: ButtonSet): PromptResponse;
prompt(title: string, prompt: string, buttons: ButtonSet): PromptResponse;
showModalDialog(userInterface: HTML.HtmlOutput, title: string): void;
showModelessDialog(userInterface: HTML.HtmlOutput, title: string): void;
showSidebar(userInterface: HTML.HtmlOutput): void;
/** @deprecated DO NOT USE */ showDialog(userInterface: HTML.HtmlOutput): void;
}
/**
* Representation of a user, suitable for scripting.
*/
interface User {
getEmail(): string;
/** @deprecated DO NOT USE */ getUserLoginId(): string;
}
/**
* An enum representing the days of the week.
*/
enum Weekday {
SUNDAY,
MONDAY,
TUESDAY,
WEDNESDAY,
THURSDAY,
FRIDAY,
SATURDAY,
}
/**
* This class allows the developer to write logs to the Google Cloud Platform's Stackdriver Logging service. The following
* shows some logging examples:
*
* function measuringExecutionTime() {
* // A simple INFO log message, using sprintf() formatting.
* console.info('Timing the %s function (%d arguments)', 'myFunction', 1);
*
* // Log a JSON object at a DEBUG level. If the object contains a property called "message",
* // that is used as the summary in the log viewer, otherwise a stringified version of
* // the object is used as the summary.
* var parameters = {
* isValid: true,
* content: 'some string',
* timestamp: new Date()
* };
* console.log(parameters);
*
* var label = 'myFunction() time'; // Labels the timing log entry.
* console.time(label); // Starts the timer.
* try {
* myFunction(parameters); // Function to time.
* } catch (e) {
* // Logs an ERROR message.
* console.error('myFunction() yielded an error: ' + e);
* }
* console.timeEnd(label); // Stops the timer, logs execution duration.
* }
*/
/**
* Apps Script has a non-standard Date Class
*
* @see https://github.com/microsoft/TypeScript/blob/master/lib/lib.es5.d.ts
* Enables basic storage and retrieval of dates and times.
*/
interface Date {
/** Returns a string representation of a date. The format of the string depends on the locale. */
toString(): string;
/** Returns a date as a string value. */
toDateString(): string;
/** Returns a time as a string value. */
toTimeString(): string;
/** Returns a value as a string value appropriate to the host environment's current locale. */
toLocaleString(): string;
/** Returns a date as a string value appropriate to the host environment's current locale. */
toLocaleDateString(): string;
/** Returns a time as a string value appropriate to the host environment's current locale. */
toLocaleTimeString(): string;
/** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */
valueOf(): number;
/** Gets the time value in milliseconds. */
getTime(): number;
/** Gets the year, using local time. */
getFullYear(): number;
/** Gets the year using Universal Coordinated Time (UTC). */
getUTCFullYear(): number;
/** Gets the month, using local time. */
getMonth(): number;
/** Gets the month of a Date object using Universal Coordinated Time (UTC). */
getUTCMonth(): number;
/** Gets the day-of-the-month, using local time. */
getDate(): number;
/** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */
getUTCDate(): number;
/** Gets the day of the week, using local time. */
getDay(): number;
/** Gets the day of the week using Universal Coordinated Time (UTC). */
getUTCDay(): number;
/** Gets the hours in a date, using local time. */
getHours(): number;
/** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */
getUTCHours(): number;
/** Gets the minutes of a Date object, using local time. */
getMinutes(): number;
/** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */
getUTCMinutes(): number;
/** Gets the seconds of a Date object, using local time. */
getSeconds(): number;
/** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */
getUTCSeconds(): number;
/** Gets the milliseconds of a Date, using local time. */
getMilliseconds(): number;
/** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */
getUTCMilliseconds(): number;
/** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */
getTimezoneOffset(): number;
/**
* Sets the date and time value in the Date object.
* @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT.
*/
setTime(time: number): number;
/**
* Sets the milliseconds value in the Date object using local time.
* @param ms A numeric value equal to the millisecond value.
*/
setMilliseconds(ms: number): number;
/**
* Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC).
* @param ms A numeric value equal to the millisecond value.
*/
setUTCMilliseconds(ms: number): number;
/**
* Sets the seconds value in the Date object using local time.
* @param sec A numeric value equal to the seconds value.
* @param ms A numeric value equal to the milliseconds value.
*/
setSeconds(sec: number, ms?: number): number;
/**
* Sets the seconds value in the Date object using Universal Coordinated Time (UTC).
* @param sec A numeric value equal to the seconds value.
* @param ms A numeric value equal to the milliseconds value.
*/
setUTCSeconds(sec: number, ms?: number): number;
/**
* Sets the minutes value in the Date object using local time.
* @param min A numeric value equal to the minutes value.
* @param sec A numeric value equal to the seconds value.
* @param ms A numeric value equal to the milliseconds value.
*/
setMinutes(min: number, sec?: number, ms?: number): number;
/**
* Sets the minutes value in the Date object using Universal Coordinated Time (UTC).
* @param min A numeric value equal to the minutes value.
* @param sec A numeric value equal to the seconds value.
* @param ms A numeric value equal to the milliseconds value.
*/
setUTCMinutes(min: number, sec?: number, ms?: number): number;
/**
* Sets the hour value in the Date object using local time.
* @param hours A numeric value equal to the hours value.
* @param min A numeric value equal to the minutes value.
* @param sec A numeric value equal to the seconds value.
* @param ms A numeric value equal to the milliseconds value.
*/
setHours(hours: number, min?: number, sec?: number, ms?: number): number;
/**
* Sets the hours value in the Date object using Universal Coordinated Time (UTC).
* @param hours A numeric value equal to the hours value.
* @param min A numeric value equal to the minutes value.
* @param sec A numeric value equal to the seconds value.
* @param ms A numeric value equal to the milliseconds value.
*/
setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number;
/**
* Sets the numeric day-of-the-month value of the Date object using local time.
* @param date A numeric value equal to the day of the month.
*/
setDate(date: number): number;
/**
* Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC).
* @param date A numeric value equal to the day of the month.
*/
setUTCDate(date: number): number;
/**
* Sets the month value in the Date object using local time.
* @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.
* @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used.
*/
setMonth(month: number, date?: number): number;
/**
* Sets the month value in the Date object using Universal Coordinated Time (UTC).
* @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.
* @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used.
*/
setUTCMonth(month: number, date?: number): number;
/**
* Sets the year of the Date object using local time.
* @param year A numeric value for the year.
* @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified.
* @param date A numeric value equal for the day of the month.
*/
setFullYear(year: number, month?: number, date?: number): number;
/**
* Sets the year value in the Date object using Universal Coordinated Time (UTC).
* @param year A numeric value equal to the year.
* @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied.
* @param date A numeric value equal to the day of the month.
*/
setUTCFullYear(year: number, month?: number, date?: number): number;
/** Returns a date converted to a string using Universal Coordinated Time (UTC). */
toUTCString(): string;
/** Returns a date as a string value in ISO format. */
toISOString(): string;
/** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */
toJSON(key?: any): string;
}
interface DateConstructor {
new(): Date;
new(value: number | string): Date;
new(
year: number,
month: number,
date?: number,
hours?: number,
minutes?: number,
seconds?: number,
ms?: number,
): Date;
(): string;
readonly prototype: Date;
/**
* Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970.
* @param s A date string
*/
parse(s: string): number;
/**
* Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.
* @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.
* @param month The month as an number between 0 and 11 (January to December).
* @param date The date as an number between 1 and 31.
* @param hours Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour.
* @param minutes Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes.
* @param seconds Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds.
* @param ms An number from 0 to 999 that specifies the milliseconds.
*/
UTC(
year: number,
month: number,
date?: number,
hours?: number,
minutes?: number,
seconds?: number,
ms?: number,
): number;
now(): number;
}
const Date: DateConstructor;
}
}
declare var Browser: GoogleAppsScript.Base.Browser;
declare var Logger: GoogleAppsScript.Base.Logger;
declare var MimeType: GoogleAppsScript.Base.MimeType;
declare var Session: GoogleAppsScript.Base.Session;
declare var console: Console;
// The name `Date` conflicts with lib.es5.d.ts.
// - We cannot include lib.es5.d.ts with Apps Script though because Apps Script is ES3
// and doesn't include all ES5+ features.
// Thus developers using the Date class must alias the type in their own TS projects.
// - We cannot use lib.es3.d.ts because it is no longer by dtslint.
declare var Date2: GoogleAppsScript.Base.DateConstructor;

View File

@ -0,0 +1,53 @@
/// <reference path="google-apps-script.types.d.ts" />
declare namespace GoogleAppsScript {
namespace Cache {
/**
* A reference to a particular cache.
*
* This class allows you to insert, retrieve, and remove items from a cache. This can be
* particularly useful when you want frequent access to an expensive or slow resource. For example,
* say you have an RSS feed at example.com that takes 20 seconds to fetch, but you want to speed up
* access on an average request.
*
* function getRssFeed() {
* var cache = CacheService.getScriptCache();
* var cached = cache.get("rss-feed-contents");
* if (cached != null) {
* return cached;
* }
* var result = UrlFetchApp.fetch("http://example.com/my-slow-rss-feed.xml"); // takes 20 seconds
* var contents = result.getContentText();
* cache.put("rss-feed-contents", contents, 1500); // cache for 25 minutes
* return contents;
* }
*/
interface Cache {
get(key: string): string | null;
getAll(keys: string[]): { [key: string]: any };
put(key: string, value: string): void;
put(key: string, value: string, expirationInSeconds: Integer): void;
putAll(values: { [key: string]: any }): void;
putAll(values: { [key: string]: any }, expirationInSeconds: Integer): void;
remove(key: string): void;
removeAll(keys: string[]): void;
}
/**
* CacheService allows you to access a cache for short term storage of data.
*
* This class lets you get a specific cache instance. Public caches are for things that are not
* dependent on which user is accessing your script. Private caches are for things which are
* user-specific, like settings or recent activity.
*
* The data you write to the cache is not guaranteed to persist until its expiration time. You
* must be prepared to get back null from all reads.
*/
interface CacheService {
getDocumentCache(): Cache | null;
getScriptCache(): Cache;
getUserCache(): Cache;
}
}
}
declare var CacheService: GoogleAppsScript.Cache.CacheService;

View File

@ -0,0 +1,400 @@
/// <reference path="google-apps-script.types.d.ts" />
/// <reference path="google-apps-script.base.d.ts" />
declare namespace GoogleAppsScript {
namespace Calendar {
/**
* Represents a calendar that the user owns or is subscribed to.
*/
interface Calendar {
createAllDayEvent(title: string, date: Base.Date): CalendarEvent;
createAllDayEvent(title: string, startDate: Base.Date, endDate: Base.Date): CalendarEvent;
createAllDayEvent(
title: string,
startDate: Base.Date,
endDate: Base.Date,
options: { [key: string]: any },
): CalendarEvent;
createAllDayEvent(title: string, date: Base.Date, options: { [key: string]: any }): CalendarEvent;
createAllDayEventSeries(
title: string,
startDate: Base.Date,
recurrence: EventRecurrence,
): CalendarEventSeries;
createAllDayEventSeries(
title: string,
startDate: Base.Date,
recurrence: EventRecurrence,
options: { [key: string]: any },
): CalendarEventSeries;
createEvent(title: string, startTime: Base.Date, endTime: Base.Date): CalendarEvent;
createEvent(
title: string,
startTime: Base.Date,
endTime: Base.Date,
options: { [key: string]: any },
): CalendarEvent;
createEventFromDescription(description: string): CalendarEvent;
createEventSeries(
title: string,
startTime: Base.Date,
endTime: Base.Date,
recurrence: EventRecurrence,
): CalendarEventSeries;
createEventSeries(
title: string,
startTime: Base.Date,
endTime: Base.Date,
recurrence: EventRecurrence,
options: { [key: string]: any },
): CalendarEventSeries;
deleteCalendar(): void;
getColor(): string;
getDescription(): string;
getEventById(iCalId: string): CalendarEvent;
getEventSeriesById(iCalId: string): CalendarEventSeries;
getEvents(startTime: Base.Date, endTime: Base.Date): CalendarEvent[];
getEvents(startTime: Base.Date, endTime: Base.Date, options: { [key: string]: any }): CalendarEvent[];
getEventsForDay(date: Base.Date): CalendarEvent[];
getEventsForDay(date: Base.Date, options: { [key: string]: any }): CalendarEvent[];
getId(): string;
getName(): string;
getTimeZone(): string;
isHidden(): boolean;
isMyPrimaryCalendar(): boolean;
isOwnedByMe(): boolean;
isSelected(): boolean;
setColor(color: string): Calendar;
setDescription(description: string): Calendar;
setHidden(hidden: boolean): Calendar;
setName(name: string): Calendar;
setSelected(selected: boolean): Calendar;
setTimeZone(timeZone: string): Calendar;
unsubscribeFromCalendar(): void;
}
/**
* Allows a script to read and update the user's Google Calendar. This class provides direct access
* to the user's default calendar, as well as the ability to retrieve additional calendars that the
* user owns or is subscribed to.
*/
interface CalendarApp {
Color: typeof Color;
EventColor: typeof EventColor;
GuestStatus: typeof GuestStatus;
Month: typeof Base.Month;
Visibility: typeof Visibility;
Weekday: typeof Base.Weekday;
createAllDayEvent(title: string, date: Base.Date): CalendarEvent;
createAllDayEvent(title: string, startDate: Base.Date, endDate: Base.Date): CalendarEvent;
createAllDayEvent(
title: string,
startDate: Base.Date,
endDate: Base.Date,
options: { [key: string]: any },
): CalendarEvent;
createAllDayEvent(title: string, date: Base.Date, options: { [key: string]: any }): CalendarEvent;
createAllDayEventSeries(
title: string,
startDate: Base.Date,
recurrence: EventRecurrence,
): CalendarEventSeries;
createAllDayEventSeries(
title: string,
startDate: Base.Date,
recurrence: EventRecurrence,
options: { [key: string]: any },
): CalendarEventSeries;
createCalendar(name: string): Calendar;
createCalendar(name: string, options: { [key: string]: any }): Calendar;
createEvent(title: string, startTime: Base.Date, endTime: Base.Date): CalendarEvent;
createEvent(
title: string,
startTime: Base.Date,
endTime: Base.Date,
options: { [key: string]: any },
): CalendarEvent;
createEventFromDescription(description: string): CalendarEvent;
createEventSeries(
title: string,
startTime: Base.Date,
endTime: Base.Date,
recurrence: EventRecurrence,
): CalendarEventSeries;
createEventSeries(
title: string,
startTime: Base.Date,
endTime: Base.Date,
recurrence: EventRecurrence,
options: { [key: string]: any },
): CalendarEventSeries;
getAllCalendars(): Calendar[];
getAllOwnedCalendars(): Calendar[];
getCalendarById(id: string): Calendar;
getCalendarsByName(name: string): Calendar[];
getColor(): string;
getDefaultCalendar(): Calendar;
getDescription(): string;
getEventById(iCalId: string): CalendarEvent;
getEventSeriesById(iCalId: string): CalendarEventSeries;
getEvents(startTime: Base.Date, endTime: Base.Date): CalendarEvent[];
getEvents(startTime: Base.Date, endTime: Base.Date, options: { [key: string]: any }): CalendarEvent[];
getEventsForDay(date: Base.Date): CalendarEvent[];
getEventsForDay(date: Base.Date, options: { [key: string]: any }): CalendarEvent[];
getId(): string;
getName(): string;
getOwnedCalendarById(id: string): Calendar;
getOwnedCalendarsByName(name: string): Calendar[];
getTimeZone(): string;
isHidden(): boolean;
isMyPrimaryCalendar(): boolean;
isOwnedByMe(): boolean;
isSelected(): boolean;
newRecurrence(): EventRecurrence;
setColor(color: string): Calendar;
setDescription(description: string): Calendar;
setHidden(hidden: boolean): Calendar;
setName(name: string): Calendar;
setSelected(selected: boolean): Calendar;
setTimeZone(timeZone: string): Calendar;
subscribeToCalendar(id: string): Calendar;
subscribeToCalendar(id: string, options: { [key: string]: any }): Calendar;
}
/**
* Represents a single calendar event.
*/
interface CalendarEvent {
addEmailReminder(minutesBefore: Integer): CalendarEvent;
addGuest(email: string): CalendarEvent;
addPopupReminder(minutesBefore: Integer): CalendarEvent;
addSmsReminder(minutesBefore: Integer): CalendarEvent;
anyoneCanAddSelf(): boolean;
deleteEvent(): void;
deleteTag(key: string): CalendarEvent;
getAllDayEndDate(): Base.Date;
getAllDayStartDate(): Base.Date;
getAllTagKeys(): string[];
getColor(): string;
getCreators(): string[];
getDateCreated(): Base.Date;
getDescription(): string;
getEmailReminders(): Integer[];
getEndTime(): Base.Date;
getEventSeries(): CalendarEventSeries;
getGuestByEmail(email: string): EventGuest;
getGuestList(): EventGuest[];
getGuestList(includeOwner: boolean): EventGuest[];
getId(): string;
getLastUpdated(): Base.Date;
getLocation(): string;
getMyStatus(): GuestStatus;
getOriginalCalendarId(): string;
getPopupReminders(): Integer[];
getSmsReminders(): Integer[];
getStartTime(): Base.Date;
getTag(key: string): string;
getTitle(): string;
getVisibility(): Visibility;
guestsCanInviteOthers(): boolean;
guestsCanModify(): boolean;
guestsCanSeeGuests(): boolean;
isAllDayEvent(): boolean;
isOwnedByMe(): boolean;
isRecurringEvent(): boolean;
removeAllReminders(): CalendarEvent;
removeGuest(email: string): CalendarEvent;
resetRemindersToDefault(): CalendarEvent;
setAllDayDate(date: Base.Date): CalendarEvent;
setAllDayDates(startDate: Base.Date, endDate: Base.Date): CalendarEvent;
setAnyoneCanAddSelf(anyoneCanAddSelf: boolean): CalendarEvent;
setColor(color: string): CalendarEvent;
setDescription(description: string): CalendarEvent;
setGuestsCanInviteOthers(guestsCanInviteOthers: boolean): CalendarEvent;
setGuestsCanModify(guestsCanModify: boolean): CalendarEvent;
setGuestsCanSeeGuests(guestsCanSeeGuests: boolean): CalendarEvent;
setLocation(location: string): CalendarEvent;
setMyStatus(status: GuestStatus): CalendarEvent;
setTag(key: string, value: string): CalendarEvent;
setTime(startTime: Base.Date, endTime: Base.Date): CalendarEvent;
setTitle(title: string): CalendarEvent;
setVisibility(visibility: Visibility): CalendarEvent;
}
/**
* Represents a series of events (a recurring event).
*/
interface CalendarEventSeries {
addEmailReminder(minutesBefore: Integer): CalendarEventSeries;
addGuest(email: string): CalendarEventSeries;
addPopupReminder(minutesBefore: Integer): CalendarEventSeries;
addSmsReminder(minutesBefore: Integer): CalendarEventSeries;
anyoneCanAddSelf(): boolean;
deleteEventSeries(): void;
deleteTag(key: string): CalendarEventSeries;
getAllTagKeys(): string[];
getColor(): string;
getCreators(): string[];
getDateCreated(): Base.Date;
getDescription(): string;
getEmailReminders(): Integer[];
getGuestByEmail(email: string): EventGuest;
getGuestList(): EventGuest[];
getGuestList(includeOwner: boolean): EventGuest[];
getId(): string;
getLastUpdated(): Base.Date;
getLocation(): string;
getMyStatus(): GuestStatus;
getOriginalCalendarId(): string;
getPopupReminders(): Integer[];
getSmsReminders(): Integer[];
getTag(key: string): string;
getTitle(): string;
getVisibility(): Visibility;
guestsCanInviteOthers(): boolean;
guestsCanModify(): boolean;
guestsCanSeeGuests(): boolean;
isOwnedByMe(): boolean;
removeAllReminders(): CalendarEventSeries;
removeGuest(email: string): CalendarEventSeries;
resetRemindersToDefault(): CalendarEventSeries;
setAnyoneCanAddSelf(anyoneCanAddSelf: boolean): CalendarEventSeries;
setColor(color: string): CalendarEventSeries;
setDescription(description: string): CalendarEventSeries;
setGuestsCanInviteOthers(guestsCanInviteOthers: boolean): CalendarEventSeries;
setGuestsCanModify(guestsCanModify: boolean): CalendarEventSeries;
setGuestsCanSeeGuests(guestsCanSeeGuests: boolean): CalendarEventSeries;
setLocation(location: string): CalendarEventSeries;
setMyStatus(status: GuestStatus): CalendarEventSeries;
setRecurrence(recurrence: EventRecurrence, startDate: Base.Date): CalendarEventSeries;
setRecurrence(recurrence: EventRecurrence, startTime: Base.Date, endTime: Base.Date): CalendarEventSeries;
setTag(key: string, value: string): CalendarEventSeries;
setTitle(title: string): CalendarEventSeries;
setVisibility(visibility: Visibility): CalendarEventSeries;
}
/**
* An enum representing the named colors available in the Calendar service.
*/
enum Color {
BLUE,
BROWN,
CHARCOAL,
CHESTNUT,
GRAY,
GREEN,
INDIGO,
LIME,
MUSTARD,
OLIVE,
ORANGE,
PINK,
PLUM,
PURPLE,
RED,
RED_ORANGE,
SEA_BLUE,
SLATE,
TEAL,
TURQOISE,
YELLOW,
}
/**
* An enum representing the named event colors available in the Calendar service.
*/
enum EventColor {
PALE_BLUE,
PALE_GREEN,
MAUVE,
PALE_RED,
YELLOW,
ORANGE,
CYAN,
GRAY,
BLUE,
GREEN,
RED,
}
/**
* Represents a guest of an event.
*/
interface EventGuest {
getAdditionalGuests(): Integer;
getEmail(): string;
getGuestStatus(): GuestStatus;
getName(): string;
/** @deprecated DO NOT USE */ getStatus(): string;
}
/**
* Represents the recurrence settings for an event series.
*/
interface EventRecurrence {
addDailyExclusion(): RecurrenceRule;
addDailyRule(): RecurrenceRule;
addDate(date: Base.Date): EventRecurrence;
addDateExclusion(date: Base.Date): EventRecurrence;
addMonthlyExclusion(): RecurrenceRule;
addMonthlyRule(): RecurrenceRule;
addWeeklyExclusion(): RecurrenceRule;
addWeeklyRule(): RecurrenceRule;
addYearlyExclusion(): RecurrenceRule;
addYearlyRule(): RecurrenceRule;
setTimeZone(timeZone: string): EventRecurrence;
}
/**
* An enum representing the statuses a guest can have for an event.
*/
enum GuestStatus {
INVITED,
MAYBE,
NO,
OWNER,
YES,
}
/**
* Represents a recurrence rule for an event series.
*
* Note that this class also behaves like the EventRecurrence that it belongs to,
* allowing you to chain rule creation together like so:
*
* recurrence.addDailyRule().times(3).interval(2).addWeeklyExclusion().times(2);
*
* times(times)
* interval(interval)
*/
interface RecurrenceRule {
addDailyExclusion(): RecurrenceRule;
addDailyRule(): RecurrenceRule;
addDate(date: Base.Date): EventRecurrence;
addDateExclusion(date: Base.Date): EventRecurrence;
addMonthlyExclusion(): RecurrenceRule;
addMonthlyRule(): RecurrenceRule;
addWeeklyExclusion(): RecurrenceRule;
addWeeklyRule(): RecurrenceRule;
addYearlyExclusion(): RecurrenceRule;
addYearlyRule(): RecurrenceRule;
interval(interval: Integer): RecurrenceRule;
onlyInMonth(month: Base.Month): RecurrenceRule;
onlyInMonths(months: Base.Month[]): RecurrenceRule;
onlyOnMonthDay(day: Integer): RecurrenceRule;
onlyOnMonthDays(days: Integer[]): RecurrenceRule;
onlyOnWeek(week: Integer): RecurrenceRule;
onlyOnWeekday(day: Base.Weekday): RecurrenceRule;
onlyOnWeekdays(days: Base.Weekday[]): RecurrenceRule;
onlyOnWeeks(weeks: Integer[]): RecurrenceRule;
onlyOnYearDay(day: Integer): RecurrenceRule;
onlyOnYearDays(days: Integer[]): RecurrenceRule;
setTimeZone(timeZone: string): EventRecurrence;
times(times: Integer): RecurrenceRule;
until(endDate: Base.Date): RecurrenceRule;
weekStartsOn(day: Base.Weekday): RecurrenceRule;
}
/**
* An enum representing the visibility of an event.
*/
enum Visibility {
CONFIDENTIAL,
DEFAULT,
PRIVATE,
PUBLIC,
}
}
}
declare var CalendarApp: GoogleAppsScript.Calendar.CalendarApp;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,697 @@
/// <reference path="google-apps-script.types.d.ts" />
/// <reference path="google-apps-script.base.d.ts" />
declare namespace GoogleAppsScript {
namespace Charts {
/**
* Builder for area charts. For more details, see the Google Charts documentation.
*
* Here is an example that shows how to build an area chart.
*
* // Create a data table with some sample data.
* var sampleData = Charts.newDataTable()
* .addColumn(Charts.ColumnType.STRING, "Month")
* .addColumn(Charts.ColumnType.NUMBER, "Dining")
* .addColumn(Charts.ColumnType.NUMBER, "Total")
* .addRow(["Jan", 60, 520])
* .addRow(["Feb", 50, 430])
* .addRow(["Mar", 53, 440])
* .addRow(["Apr", 70, 410])
* .addRow(["May", 80, 390])
* .addRow(["Jun", 60, 500])
* .addRow(["Jul", 100, 450])
* .addRow(["Aug", 140, 431])
* .addRow(["Sep", 75, 488])
* .addRow(["Oct", 70, 521])
* .addRow(["Nov", 58, 388])
* .addRow(["Dec", 63, 400])
* .build();
*
* var chart = Charts.newAreaChart()
* .setTitle('Yearly Spending')
* .setXAxisTitle('Month')
* .setYAxisTitle('Spending (USD)')
* .setDimensions(600, 500)
* .setStacked()
* .setColors(['red', 'green'])
* .setDataTable(sampleData)
* .build();
*/
interface AreaChartBuilder {
build(): Chart;
reverseCategories(): AreaChartBuilder;
setBackgroundColor(cssValue: string): AreaChartBuilder;
setColors(cssValues: string[]): AreaChartBuilder;
setDataSourceUrl(url: string): AreaChartBuilder;
setDataTable(tableBuilder: DataTableBuilder): AreaChartBuilder;
setDataTable(table: DataTableSource): AreaChartBuilder;
setDataViewDefinition(dataViewDefinition: DataViewDefinition): AreaChartBuilder;
setDimensions(width: Integer, height: Integer): AreaChartBuilder;
setLegendPosition(position: Position): AreaChartBuilder;
setLegendTextStyle(textStyle: TextStyle): AreaChartBuilder;
setOption(option: string, value: any): AreaChartBuilder;
setPointStyle(style: PointStyle): AreaChartBuilder;
setRange(start: number, end: number): AreaChartBuilder;
setStacked(): AreaChartBuilder;
setTitle(chartTitle: string): AreaChartBuilder;
setTitleTextStyle(textStyle: TextStyle): AreaChartBuilder;
setXAxisTextStyle(textStyle: TextStyle): AreaChartBuilder;
setXAxisTitle(title: string): AreaChartBuilder;
setXAxisTitleTextStyle(textStyle: TextStyle): AreaChartBuilder;
setYAxisTextStyle(textStyle: TextStyle): AreaChartBuilder;
setYAxisTitle(title: string): AreaChartBuilder;
setYAxisTitleTextStyle(textStyle: TextStyle): AreaChartBuilder;
useLogScale(): AreaChartBuilder;
}
/**
* Builder for bar charts. For more details, see the Google Charts documentation.
*
* Here is an example that shows how to build a bar chart. The data is imported from a
* Google spreadsheet.
*
* // Get sample data from a spreadsheet.
* var dataSourceUrl = 'https://docs.google.com/spreadsheet/tq?range=B1%3AC11' +
* '&key=0Aq4s9w_HxMs7dHpfX05JdmVSb1FpT21sbXd4NVE3UEE&gid=0&headers=-1';
*
* var chartBuilder = Charts.newBarChart()
* .setTitle('Top Grossing Films in US and Canada')
* .setXAxisTitle('USD')
* .setYAxisTitle('Film')
* .setDimensions(600, 500)
* .setLegendPosition(Charts.Position.BOTTOM)
* .setDataSourceUrl(dataSourceUrl);
*
* var chart = chartBuilder.build();
*/
interface BarChartBuilder {
build(): Chart;
reverseCategories(): BarChartBuilder;
reverseDirection(): BarChartBuilder;
setBackgroundColor(cssValue: string): BarChartBuilder;
setColors(cssValues: string[]): BarChartBuilder;
setDataSourceUrl(url: string): BarChartBuilder;
setDataTable(tableBuilder: DataTableBuilder): BarChartBuilder;
setDataTable(table: DataTableSource): BarChartBuilder;
setDataViewDefinition(dataViewDefinition: DataViewDefinition): BarChartBuilder;
setDimensions(width: Integer, height: Integer): BarChartBuilder;
setLegendPosition(position: Position): BarChartBuilder;
setLegendTextStyle(textStyle: TextStyle): BarChartBuilder;
setOption(option: string, value: any): BarChartBuilder;
setRange(start: number, end: number): BarChartBuilder;
setStacked(): BarChartBuilder;
setTitle(chartTitle: string): BarChartBuilder;
setTitleTextStyle(textStyle: TextStyle): BarChartBuilder;
setXAxisTextStyle(textStyle: TextStyle): BarChartBuilder;
setXAxisTitle(title: string): BarChartBuilder;
setXAxisTitleTextStyle(textStyle: TextStyle): BarChartBuilder;
setYAxisTextStyle(textStyle: TextStyle): BarChartBuilder;
setYAxisTitle(title: string): BarChartBuilder;
setYAxisTitleTextStyle(textStyle: TextStyle): BarChartBuilder;
useLogScale(): BarChartBuilder;
}
/**
* A Chart object, which can be converted to a static image. For charts embedded in spreadsheets,
* see EmbeddedChart.
*/
interface Chart {
getAs(contentType: string): Base.Blob;
getBlob(): Base.Blob;
getOptions(): ChartOptions;
}
/**
* An enumeration of how hidden dimensions in a source are expressed in a chart.
*/
enum ChartHiddenDimensionStrategy {
IGNORE_BOTH,
IGNORE_ROWS,
IGNORE_COLUMNS,
SHOW_BOTH,
}
/**
* An enumeration of how multiple ranges in the source are expressed in a chart.
*/
enum ChartMergeStrategy {
MERGE_COLUMNS,
MERGE_ROWS,
}
/**
* Exposes options currently configured for a Chart, such as height, color, etc.
*
* Please see the visualization
* reference documentation for information on what options are available. Specific options for
* each chart can be found by clicking on the specific chart in the chart gallery.
*
* These options are immutable.
*/
interface ChartOptions {
get(option: string): any;
}
/**
* Chart types supported by the Charts service.
*/
enum ChartType {
TIMELINE,
AREA,
BAR,
BUBBLE,
CANDLESTICK,
COLUMN,
COMBO,
GAUGE,
GEO,
HISTOGRAM,
RADAR,
LINE,
ORG,
PIE,
SCATTER,
SPARKLINE,
STEPPED_AREA,
TABLE,
TREEMAP,
WATERFALL,
}
/**
* Entry point for creating Charts in scripts.
*
* This example creates a basic data table, populates an area chart with the data, and adds it
* into a web page as an image:
*
* function doGet() {
* var data = Charts.newDataTable()
* .addColumn(Charts.ColumnType.STRING, "Month")
* .addColumn(Charts.ColumnType.NUMBER, "In Store")
* .addColumn(Charts.ColumnType.NUMBER, "Online")
* .addRow(["January", 10, 1])
* .addRow(["February", 12, 1])
* .addRow(["March", 20, 2])
* .addRow(["April", 25, 3])
* .addRow(["May", 30, 4])
* .build();
*
* var chart = Charts.newAreaChart()
* .setDataTable(data)
* .setStacked()
* .setRange(0, 40)
* .setTitle("Sales per Month")
* .build();
*
* var htmlOutput = HtmlService.createHtmlOutput().setTitle('My Chart');
* var imageData = Utilities.base64Encode(chart.getAs('image/png').getBytes());
* var imageUrl = "data:image/png;base64," + encodeURI(imageData);
* htmlOutput.append("Render chart server side: <br/>");
* htmlOutput.append("<img border=\"1\" src=\"" + imageUrl + "\">");
* return htmlOutput;
* }
*/
interface Charts {
ChartHiddenDimensionStrategy: typeof ChartHiddenDimensionStrategy;
ChartMergeStrategy: typeof ChartMergeStrategy;
ChartType: typeof ChartType;
ColumnType: typeof ColumnType;
CurveStyle: typeof CurveStyle;
PointStyle: typeof PointStyle;
Position: typeof Position;
newAreaChart(): AreaChartBuilder;
newBarChart(): BarChartBuilder;
newColumnChart(): ColumnChartBuilder;
newDataTable(): DataTableBuilder;
newDataViewDefinition(): DataViewDefinitionBuilder;
newLineChart(): LineChartBuilder;
newPieChart(): PieChartBuilder;
newScatterChart(): ScatterChartBuilder;
newTableChart(): TableChartBuilder;
newTextStyle(): TextStyleBuilder;
}
/**
* Builder for column charts. For more details, see the Google Charts documentation.
*
* This example shows how to create a column chart with data from a data table.
*
* var sampleData = Charts.newDataTable()
* .addColumn(Charts.ColumnType.STRING, "Year")
* .addColumn(Charts.ColumnType.NUMBER, "Sales")
* .addColumn(Charts.ColumnType.NUMBER, "Expenses")
* .addRow(["2004", 1000, 400])
* .addRow(["2005", 1170, 460])
* .addRow(["2006", 660, 1120])
* .addRow(["2007", 1030, 540])
* .addRow(["2008", 800, 600])
* .addRow(["2009", 943, 678])
* .addRow(["2010", 1020, 550])
* .addRow(["2011", 910, 700])
* .addRow(["2012", 1230, 840])
* .build();
*
* var chart = Charts.newColumnChart()
* .setTitle('Sales & Expenses')
* .setXAxisTitle('Year')
* .setYAxisTitle('Amount (USD)')
* .setDimensions(600, 500)
* .setDataTable(sampleData)
* .build();
*/
interface ColumnChartBuilder {
build(): Chart;
reverseCategories(): ColumnChartBuilder;
setBackgroundColor(cssValue: string): ColumnChartBuilder;
setColors(cssValues: string[]): ColumnChartBuilder;
setDataSourceUrl(url: string): ColumnChartBuilder;
setDataTable(tableBuilder: DataTableBuilder): ColumnChartBuilder;
setDataTable(table: DataTableSource): ColumnChartBuilder;
setDataViewDefinition(dataViewDefinition: DataViewDefinition): ColumnChartBuilder;
setDimensions(width: Integer, height: Integer): ColumnChartBuilder;
setLegendPosition(position: Position): ColumnChartBuilder;
setLegendTextStyle(textStyle: TextStyle): ColumnChartBuilder;
setOption(option: string, value: any): ColumnChartBuilder;
setRange(start: number, end: number): ColumnChartBuilder;
setStacked(): ColumnChartBuilder;
setTitle(chartTitle: string): ColumnChartBuilder;
setTitleTextStyle(textStyle: TextStyle): ColumnChartBuilder;
setXAxisTextStyle(textStyle: TextStyle): ColumnChartBuilder;
setXAxisTitle(title: string): ColumnChartBuilder;
setXAxisTitleTextStyle(textStyle: TextStyle): ColumnChartBuilder;
setYAxisTextStyle(textStyle: TextStyle): ColumnChartBuilder;
setYAxisTitle(title: string): ColumnChartBuilder;
setYAxisTitleTextStyle(textStyle: TextStyle): ColumnChartBuilder;
useLogScale(): ColumnChartBuilder;
}
/**
* An enumeration of the valid data types for columns in a DataTable.
*/
enum ColumnType {
DATE,
NUMBER,
STRING,
}
/**
* An enumeration of the styles for curves in a chart.
*/
enum CurveStyle {
NORMAL,
SMOOTH,
}
/**
* A Data Table to be used in charts. A DataTable can come from sources such as Google
* Sheets or specified data-table URLs, or can be filled in by hand. This class intentionally has no
* methods: a DataTable can be passed around, but not manipulated directly.
*/
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface DataTable {
}
/**
* Builder of DataTable objects. Building a data table consists of first specifying its columns, and
* then adding its rows, one at a time. Example:
*
* var data = Charts.newDataTable()
* .addColumn(Charts.ColumnType.STRING, "Month")
* .addColumn(Charts.ColumnType.NUMBER, "In Store")
* .addColumn(Charts.ColumnType.NUMBER, "Online")
* .addRow(["January", 10, 1])
* .addRow(["February", 12, 1])
* .addRow(["March", 20, 2])
* .addRow(["April", 25, 3])
* .addRow(["May", 30, 4])
* .build();
*/
interface DataTableBuilder {
addColumn(type: ColumnType, label: string): DataTableBuilder;
addRow(values: any[]): DataTableBuilder;
build(): DataTable;
setValue(row: Integer, column: Integer, value: any): DataTableBuilder;
}
/**
* Interface for objects that can represent their data as a DataTable.
* Implementing classes
*
* NameBrief description
*
* DataTableA Data Table to be used in charts.
*
* RangeAccess and modify spreadsheet ranges.
*/
interface DataTableSource {
getDataTable(): DataTable;
}
/**
* A data view definition for visualizing chart data.
*
* Data view definition can be set for charts to visualize a view derived from the given data
* table and not the data table itself. For example if the view definition of a chart states that
* the view columns are [0, 3], only the first and the third columns of the data table is taken into
* consideration when drawing the chart. See DataViewDefinitionBuilder for an example on how
* to define and use a DataViewDefinition.
*/
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface DataViewDefinition {
}
/**
* Builder for DataViewDefinition objects.
*
* Here's an example of using the builder. The data is imported
* from a Google spreadsheet.
*
* function doGet() {
* // This example creates two table charts side by side. One uses a data view definition to
* // restrict the number of displayed columns.
*
* // Get sample data from a spreadsheet.
* var dataSourceUrl = 'https://docs.google.com/spreadsheet/tq?range=A1%3AF' +
* '&key=0Aq4s9w_HxMs7dHpfX05JdmVSb1FpT21sbXd4NVE3UEE&gid=4&headers=-1';
*
* // Create a chart to display all of the data.
* var originalChart = Charts.newTableChart()
* .setDimensions(600, 500)
* .setDataSourceUrl(dataSourceUrl)
* .build();
*
* // Create another chart to display a subset of the data (only columns 1 and 4).
* var dataViewDefinition = Charts.newDataViewDefinition().setColumns([0, 3]);
* var limitedChart = Charts.newTableChart()
* .setDimensions(200, 500)
* .setDataSourceUrl(dataSourceUrl)
* .setDataViewDefinition(dataViewDefinition)
* .build();
*
* var htmlOutput = HtmlService.createHtmlOutput();
* var originalChartData = Utilities.base64Encode(originalChart.getAs('image/png').getBytes());
* var originalChartUrl = "data:image/png;base64," + encodeURI(originalChartData);
* var limitedChartData = Utilities.base64Encode(limitedChart.getAs('image/png').getBytes());
* var limitedChartUrl = "data:image/png;base64," + encodeURI(limitedChartData);
* htmlOutput.append("<table><tr><td>");
* htmlOutput.append("<img border=\"1\" src=\"" + originalChartUrl + "\">");
* htmlOutput.append("</td><td>");
* htmlOutput.append("<img border=\"1\" src=\"" + limitedChartUrl + "\">");
* htmlOutput.append("</td></tr></table>");
* return htmlOutput;
* }
*/
interface DataViewDefinitionBuilder {
build(): DataViewDefinition;
setColumns(columns: any[]): DataViewDefinitionBuilder;
}
/**
* Builder for line charts. For more details, see the Google Charts documentation.
*
* Here is an example that shows how to build a line chart. The data is imported from a Google spreadsheet.
*
* // Get sample data from a spreadsheet.
* var dataSourceUrl = 'https://docs.google.com/spreadsheet/tq?range=A1%3AG5' +
* '&key=0Aq4s9w_HxMs7dHpfX05JdmVSb1FpT21sbXd4NVE3UEE&gid=2&headers=-1';
*
* var chartBuilder = Charts.newLineChart()
* .setTitle('Yearly Rainfall')
* .setXAxisTitle('Month')
* .setYAxisTitle('Rainfall (in)')
* .setDimensions(600, 500)
* .setCurveStyle(Charts.CurveStyle.SMOOTH)
* .setPointStyle(Charts.PointStyle.MEDIUM)
* .setDataSourceUrl(dataSourceUrl);
*
* var chart = chartBuilder.build();
*/
interface LineChartBuilder {
build(): Chart;
reverseCategories(): LineChartBuilder;
setBackgroundColor(cssValue: string): LineChartBuilder;
setColors(cssValues: string[]): LineChartBuilder;
setCurveStyle(style: CurveStyle): LineChartBuilder;
setDataSourceUrl(url: string): LineChartBuilder;
setDataTable(tableBuilder: DataTableBuilder): LineChartBuilder;
setDataTable(table: DataTableSource): LineChartBuilder;
setDataViewDefinition(dataViewDefinition: DataViewDefinition): LineChartBuilder;
setDimensions(width: Integer, height: Integer): LineChartBuilder;
setLegendPosition(position: Position): LineChartBuilder;
setLegendTextStyle(textStyle: TextStyle): LineChartBuilder;
setOption(option: string, value: any): LineChartBuilder;
setPointStyle(style: PointStyle): LineChartBuilder;
setRange(start: number, end: number): LineChartBuilder;
setTitle(chartTitle: string): LineChartBuilder;
setTitleTextStyle(textStyle: TextStyle): LineChartBuilder;
setXAxisTextStyle(textStyle: TextStyle): LineChartBuilder;
setXAxisTitle(title: string): LineChartBuilder;
setXAxisTitleTextStyle(textStyle: TextStyle): LineChartBuilder;
setYAxisTextStyle(textStyle: TextStyle): LineChartBuilder;
setYAxisTitle(title: string): LineChartBuilder;
setYAxisTitleTextStyle(textStyle: TextStyle): LineChartBuilder;
useLogScale(): LineChartBuilder;
}
/**
* An enumeration of how a string value should be matched. Matching a string is a boolean operation.
* Given a string, a match term (string), and a match type, the operation outputs true in
* the following cases:
*
* If the match type equals EXACT and the match term equals the string.
*
* If the match type equals PREFIX and the match term is a prefix of the string.
*
* If the match type equals ANY and the match term is a substring of the string.
*
* This enumeration can be used in by a string filter control to decide which rows to filter out
* of the data table. Given a column to filter on, leave only the rows that match the value entered
* in the filter input box, using one of the above matching types.
*/
enum MatchType {
EXACT,
PREFIX,
ANY,
}
/**
* A builder for number range filter controls.
*
* A number range filter is a slider with two thumbs that lets the user select ranges of numeric
* values. Given a column of type number and matching options, this control filters out the rows
* that don't match the range that was selected.
*
* For more details, see the Gviz
* documentation.
*/
interface NumberRangeFilterBuilder {
setMaxValue(maxValue: Integer): NumberRangeFilterBuilder;
setMinValue(minValue: Integer): NumberRangeFilterBuilder;
setOrientation(orientation: Orientation): NumberRangeFilterBuilder;
setShowRangeValues(showRangeValues: boolean): NumberRangeFilterBuilder;
setTicks(ticks: Integer): NumberRangeFilterBuilder;
}
/**
* An enumeration of the orientation of an object.
*/
enum Orientation {
HORIZONTAL,
VERTICAL,
}
/**
* An enumeration of how to display selected values in picker widget.
*/
enum PickerValuesLayout {
ASIDE,
BELOW,
BELOW_WRAPPING,
BELOW_STACKED,
}
/**
* A builder for pie charts. For more details, see the Google Charts documentation.
*
* Here is an example that shows how to build a pie chart. The data is imported from a Google spreadsheet.
*
* // Get sample data from a spreadsheet.
* var dataSourceUrl = 'https://docs.google.com/spreadsheet/tq?range=A1%3AB8' +
* '&key=0Aq4s9w_HxMs7dHpfX05JdmVSb1FpT21sbXd4NVE3UEE&gid=3&headers=-1';
*
* var chartBuilder = Charts.newPieChart()
* .setTitle('World Population by Continent')
* .setDimensions(600, 500)
* .set3D()
* .setDataSourceUrl(dataSourceUrl);
*
* var chart = chartBuilder.build();
*/
interface PieChartBuilder {
build(): Chart;
reverseCategories(): PieChartBuilder;
set3D(): PieChartBuilder;
setBackgroundColor(cssValue: string): PieChartBuilder;
setColors(cssValues: string[]): PieChartBuilder;
setDataSourceUrl(url: string): PieChartBuilder;
setDataTable(tableBuilder: DataTableBuilder): PieChartBuilder;
setDataTable(table: DataTableSource): PieChartBuilder;
setDataViewDefinition(dataViewDefinition: DataViewDefinition): PieChartBuilder;
setDimensions(width: Integer, height: Integer): PieChartBuilder;
setLegendPosition(position: Position): PieChartBuilder;
setLegendTextStyle(textStyle: TextStyle): PieChartBuilder;
setOption(option: string, value: any): PieChartBuilder;
setTitle(chartTitle: string): PieChartBuilder;
setTitleTextStyle(textStyle: TextStyle): PieChartBuilder;
}
/**
* An enumeration of the styles of points in a line.
*/
enum PointStyle {
NONE,
TINY,
MEDIUM,
LARGE,
HUGE,
}
/**
* An enumeration of legend positions within a chart.
*/
enum Position {
TOP,
RIGHT,
BOTTOM,
NONE,
}
/**
* Builder for scatter charts. For more details, see the Google Charts documentation.
*
* Here is an example that shows how to build a scatter chart. The data is imported from a Google spreadsheet.
*
* // Get sample data from a spreadsheet.
* var dataSourceUrl = 'https://docs.google.com/spreadsheet/tq?range=C1%3AD' +
* '&key=0Aq4s9w_HxMs7dHpfX05JdmVSb1FpT21sbXd4NVE3UEE&gid=4&headers=-1';
*
* var chartBuilder = Charts.newScatterChart()
* .setTitle('Adjusted GDP & U.S. Population')
* .setXAxisTitle('U.S. Population (millions)')
* .setYAxisTitle('Adjusted GDP ($ billions)')
* .setDimensions(600, 500)
* .setLegendPosition(Charts.Position.NONE)
* .setDataSourceUrl(dataSourceUrl);
*
* var chart = chartBuilder.build();
*/
interface ScatterChartBuilder {
build(): Chart;
setBackgroundColor(cssValue: string): ScatterChartBuilder;
setColors(cssValues: string[]): ScatterChartBuilder;
setDataSourceUrl(url: string): ScatterChartBuilder;
setDataTable(tableBuilder: DataTableBuilder): ScatterChartBuilder;
setDataTable(table: DataTableSource): ScatterChartBuilder;
setDataViewDefinition(dataViewDefinition: DataViewDefinition): ScatterChartBuilder;
setDimensions(width: Integer, height: Integer): ScatterChartBuilder;
setLegendPosition(position: Position): ScatterChartBuilder;
setLegendTextStyle(textStyle: TextStyle): ScatterChartBuilder;
setOption(option: string, value: any): ScatterChartBuilder;
setPointStyle(style: PointStyle): ScatterChartBuilder;
setTitle(chartTitle: string): ScatterChartBuilder;
setTitleTextStyle(textStyle: TextStyle): ScatterChartBuilder;
setXAxisLogScale(): ScatterChartBuilder;
setXAxisRange(start: number, end: number): ScatterChartBuilder;
setXAxisTextStyle(textStyle: TextStyle): ScatterChartBuilder;
setXAxisTitle(title: string): ScatterChartBuilder;
setXAxisTitleTextStyle(textStyle: TextStyle): ScatterChartBuilder;
setYAxisLogScale(): ScatterChartBuilder;
setYAxisRange(start: number, end: number): ScatterChartBuilder;
setYAxisTextStyle(textStyle: TextStyle): ScatterChartBuilder;
setYAxisTitle(title: string): ScatterChartBuilder;
setYAxisTitleTextStyle(textStyle: TextStyle): ScatterChartBuilder;
}
/**
* A builder for string filter controls.
*
* A string filter is a simple text input field that lets the user filter data via string
* matching. Given a column of type string and matching options, this control filters out the rows
* that don't match the term that's in the input field.
*
* For more details, see the Gviz
* documentation.
*/
interface StringFilterBuilder {
setCaseSensitive(caseSensitive: boolean): StringFilterBuilder;
setMatchType(matchType: MatchType): StringFilterBuilder;
setRealtimeTrigger(realtimeTrigger: boolean): StringFilterBuilder;
}
/**
* A builder for table charts. For more details, see the Google Charts documentation.
*
* Here is an example that shows how to build a table chart. The data is imported from a Google spreadsheet.
*
* // Get sample data from a spreadsheet.
* var dataSourceUrl = 'https://docs.google.com/spreadsheet/tq?range=A1%3AF' +
* '&key=0Aq4s9w_HxMs7dHpfX05JdmVSb1FpT21sbXd4NVE3UEE&gid=4&headers=-1';
*
* var chartBuilder = Charts.newTableChart()
* .setDimensions(600, 500)
* .enablePaging(20)
* .setDataSourceUrl(dataSourceUrl);
*
* var chart = chartBuilder.build();
*/
interface TableChartBuilder {
build(): Chart;
enablePaging(enablePaging: boolean): TableChartBuilder;
enablePaging(pageSize: Integer): TableChartBuilder;
enablePaging(pageSize: Integer, startPage: Integer): TableChartBuilder;
enableRtlTable(rtlEnabled: boolean): TableChartBuilder;
enableSorting(enableSorting: boolean): TableChartBuilder;
setDataSourceUrl(url: string): TableChartBuilder;
setDataTable(tableBuilder: DataTableBuilder): TableChartBuilder;
setDataTable(table: DataTableSource): TableChartBuilder;
setDataViewDefinition(dataViewDefinition: DataViewDefinition): TableChartBuilder;
setDimensions(width: Integer, height: Integer): TableChartBuilder;
setFirstRowNumber(number: Integer): TableChartBuilder;
setInitialSortingAscending(column: Integer): TableChartBuilder;
setInitialSortingDescending(column: Integer): TableChartBuilder;
setOption(option: string, value: any): TableChartBuilder;
showRowNumberColumn(showRowNumber: boolean): TableChartBuilder;
useAlternatingRowStyle(alternate: boolean): TableChartBuilder;
}
/**
* A text style configuration object. Used in charts options to configure text style for elements
* that accepts it, such as title, horizontal axis, vertical axis, legend and tooltip.
*
* // This example creates a chart specifying different text styles for the title and axes.
* var sampleData = Charts.newDataTable()
* .addColumn(Charts.ColumnType.STRING, "Seasons")
* .addColumn(Charts.ColumnType.NUMBER, "Rainy Days")
* .addRow(["Winter", 5])
* .addRow(["Spring", 12])
* .addRow(["Summer", 8])
* .addRow(["Fall", 8])
* .build();
*
* var titleTextStyleBuilder = Charts.newTextStyle()
* .setColor('#0000FF').setFontSize(26).setFontName('Ariel');
* var axisTextStyleBuilder = Charts.newTextStyle()
* .setColor('#3A3A3A').setFontSize(20).setFontName('Ariel');
* var titleTextStyle = titleTextStyleBuilder.build();
* var axisTextStyle = axisTextStyleBuilder.build();
*
* var chart = Charts.newLineChart()
* .setTitleTextStyle(titleTextStyle)
* .setXAxisTitleTextStyle(axisTextStyle)
* .setYAxisTitleTextStyle(axisTextStyle)
* .setTitle('Rainy Days Per Season')
* .setXAxisTitle('Season')
* .setYAxisTitle('Number of Rainy Days')
* .setDataTable(sampleData)
* .build();
*/
interface TextStyle {
getColor(): string;
getFontName(): string;
getFontSize(): number;
}
/**
* A builder used to create TextStyle objects. It allows configuration of the text's
* properties such as name, color, and size.
*
* The following example shows how to create a text style using the builder. For a more complete
* example, refer to the documentation for TextStyle.
*
* // Creates a new text style that uses 26-point, blue, Ariel font.
* var textStyleBuilder = Charts.newTextStyle()
* .setColor('#0000FF').setFontName('Ariel').setFontSize(26);
* var style = textStyleBuilder.build();
*/
interface TextStyleBuilder {
build(): TextStyle;
setColor(cssValue: string): TextStyleBuilder;
setFontName(fontName: string): TextStyleBuilder;
setFontSize(fontSize: number): TextStyleBuilder;
}
}
}
declare var Charts: GoogleAppsScript.Charts.Charts;

View File

@ -0,0 +1,306 @@
/// <reference path="google-apps-script.types.d.ts" />
declare namespace GoogleAppsScript {
namespace Conference_Data {
/**
* Container for all conference-related information.
*
* var conferenceId;
* // Set the conference ID, that is, the identifier your system creates for the meeting.
*
* var entryPoint = ConferenceDataService.newEntryPoint();
* // Finish building the entry point ...
*
* var conferenceParameter = ConferenceDataService.newConferenceParameter();
* // Finish building the parameter ...
*
* var conferenceData = ConferenceDataService.newConferenceDataBuilder()
* .setConferenceId(conferenceId);
* .addEntryPoint(entryPoint)
* .addConferenceParameter(conferenceParameter)
* .build();
*/
interface ConferenceData {
/**
* Prints the JSON representation of this object. This is for debugging only.
* https://developers.google.com/apps-script/reference/conference-data/conference-data#printJson()
*/
printJson(): string;
}
/**
* Builder for creating for ConferenceData objects.
*/
interface ConferenceDataBuilder {
/**
* Adds a ConferenceParameter to this ConferenceData. The maximum number of
* parameters per ConferenceData is 300.
* https://developers.google.com/apps-script/reference/conference-data/conference-data-builder#addConferenceParameter(ConferenceParameter)
* @param conferenceParameter The parameter to add.
*/
addConferenceParameter(conferenceParameter: ConferenceParameter): ConferenceDataBuilder;
/**
* Adds an EntryPoint to this ConferenceData. The maximum number of entry points
* per ConferenceData is 300.
* https://developers.google.com/apps-script/reference/conference-data/conference-data-builder#addEntryPoint(EntryPoint)
* @param entryPoint The entry point to add.
*/
addEntryPoint(entryPoint: EntryPoint): ConferenceDataBuilder;
/**
* Builds and validates the ConferenceData.
* https://developers.google.com/apps-script/reference/conference-data/conference-data-builder#build()
*/
build(): ConferenceData;
/**
* Sets the conference ID of this ConferenceData. The maximum length for this field is 512
* characters.
* https://developers.google.com/apps-script/reference/conference-data/conference-data-builder#setConferenceId(String)
* @param conferenceId The ID to set.
*/
setConferenceId(conferenceId: string): ConferenceDataBuilder;
/**
* Sets the conference solution ID defined in the addon's manifest. The value must be specified
* and populates conference's name and iconUrl values.
*
* Note that the field is required for GSuite add-ons whereas it's ignored for Conferencing
* add-ons
* https://developers.google.com/apps-script/reference/conference-data/conference-data-builder#setConferenceSolutionId(String)
* @param conferenceSolutionId The ID matching the manifest.
*/
setConferenceSolutionId(conferenceSolutionId: string): ConferenceDataBuilder;
/**
* Sets the ConferenceError of this ConferenceData, indicating that the conference
* was not successfully created.
* https://developers.google.com/apps-script/reference/conference-data/conference-data-builder#setError(ConferenceError)
* @param conferenceError The error to set.
*/
setError(conferenceError: ConferenceError): ConferenceDataBuilder;
/**
* Sets the additional notes of this ConferenceData, such as instructions from the
* administrator or legal notices. Can contain HTML. The maximum length for this field is 2048
* characters.
* https://developers.google.com/apps-script/reference/conference-data/conference-data-builder#setNotes(String)
* @param notes The additional notes to set.
*/
setNotes(notes: string): ConferenceDataBuilder;
}
/**
* Service that scripts can use to create conferencing information.
*/
interface ConferenceDataService {
ConferenceErrorType: typeof ConferenceErrorType;
EntryPointFeature: typeof EntryPointFeature;
EntryPointType: typeof EntryPointType;
/**
* Returns a new, empty ConferenceDataBuilder.
* https://developers.google.com/apps-script/reference/conference-data/conference-data-service#newConferenceDataBuilder()
*/
newConferenceDataBuilder(): ConferenceDataBuilder;
/**
* Returns a new, empty ConferenceError.
* https://developers.google.com/apps-script/reference/conference-data/conference-data-service#newConferenceError()
*/
newConferenceError(): ConferenceError;
/**
* Returns a new, empty ConferenceParameter.
* https://developers.google.com/apps-script/reference/conference-data/conference-data-service#newConferenceParameter()
*/
newConferenceParameter(): ConferenceParameter;
/**
* Returns a new, empty EntryPoint.
* https://developers.google.com/apps-script/reference/conference-data/conference-data-service#newEntryPoint()
*/
newEntryPoint(): EntryPoint;
}
/**
* Error that occurred in a conferencing add-on. Example usage:
*
* var conferenceError = ConferenceDataService.newConferenceError()
* .setConferenceErrorType(ConferenceErrorType.PERMANENT);
*
* var state = ScriptApp.newStateToken()
* .withMethod('myLoginCallbackFunction');
* .withTimeout(3600)
* .createToken();
*
* var authenticationUrl = 'https://script.google.com/a/google.com/d/'
* + ScriptApp.getScriptId()
* + '/usercallback?state='
* + state;
*
* var conferenceError = ConferenceDataService.newConferenceError()
* .setConferenceErrorType(ConferenceErrorType.UNAUTHENTICATED)
* .setAuthenticationUrl(authenticationUrl);
*/
interface ConferenceError {
/**
* If the error type is AUTHENTICATION, the add-on must
* provide a URL calling back into the add-on to allow users to log in. The maximum length for
* this field is 1800 characters.
* https://developers.google.com/apps-script/reference/conference-data/conference-error#setAuthenticationUrl(String)
* @param authenticationUrl The authentication URL to set.
*/
setAuthenticationUrl(authenticationUrl: string): ConferenceError;
/**
* Sets the error type of this ConferenceError.
* https://developers.google.com/apps-script/reference/conference-data/conference-error#setConferenceErrorType(ConferenceErrorType)
* @param conferenceErrorType The type of error to set.
*/
setConferenceErrorType(conferenceErrorType: ConferenceErrorType): ConferenceError;
}
/**
* Enum that defines the types of errors that you can specify in a ConferenceError.
*/
enum ConferenceErrorType {
AUTHENTICATION,
CONFERENCE_SOLUTION_FORBIDDEN,
PERMANENT,
PERMISSION_DENIED,
TEMPORARY,
UNKNOWN,
}
/**
* Solution-specific parameter available fo the add-on's use. This parameter is persisted with the
* conference data and, if an update or delete is needed, is passed to the add-on. Example usage:
*
* var conferenceParameter = ConferenceDataService.newConferenceParameter()
* .setKey('meetingId')
* .setValue('123456');
*/
interface ConferenceParameter {
/**
* Sets the key of this ConferenceParameter. The maximum length for this field is 50
* characters. Required.
* https://developers.google.com/apps-script/reference/conference-data/conference-parameter#setKey(String)
* @param key The key to set.
*/
setKey(key: string): ConferenceParameter;
/**
* Sets the value of this ConferenceParameter. The maximum length for this field is 1024
* characters. Required.
* https://developers.google.com/apps-script/reference/conference-data/conference-parameter#setValue(String)
* @param value The value to set.
*/
setValue(value: string): ConferenceParameter;
}
/**
* Definition of a specific way to join a conference. Example usage:
*
* var videoEntryPoint = ConferenceDataService.newEntryPoint()
* .setEntryPointType(ConferenceDataService.EntryPointType.VIDEO)
* .setUri('https://example.com/myroom');
* .setPasscode('12345');
*
* var phoneEntryPoint = ConferenceDataService.newEntryPoint()
* .setEntryPointType(ConferenceDataService.EntryPointType.PHONE)
* .setUri('tel:+11234567890,,,112233445;9687')
* .addFeature(ConferenceDataService.EntryPointFeature.TOLL)
* setPin('9687');
*
* var sipEntryPoint = ConferenceDataService.newEntryPoint()
* .setEntryPointType(ConferenceDataService.EntryPointType.SIP)
* .setUri('sip:joe@example.com')
* .setAccessCode('1234567');
*
* var moreEntryPoint = ConferenceDataService.newEntryPoint()
* .setEntryPointType(ConferenceDataService.EntryPointType.MORE)
* .setUri('https://example.com/moreJoiningInfo');
*/
interface EntryPoint {
/**
* Adds the feature of the entry point, such as being toll or toll-free.
* https://developers.google.com/apps-script/reference/conference-data/entry-point#addFeature(EntryPointFeature)
* @param feature The feature to set.
*/
addFeature(feature: EntryPointFeature): EntryPoint;
/**
* An access code for accessing the conference. Maximum length 128 characters. Optional.
* https://developers.google.com/apps-script/reference/conference-data/entry-point#setAccessCode(String)
* @param accessCode The access code to set.
*/
setAccessCode(accessCode: string): EntryPoint;
/**
* Sets the type of this entry point. Required.
* https://developers.google.com/apps-script/reference/conference-data/entry-point#setEntryPointType(EntryPointType)
* @param entryPointType The entry point type to set.
*/
setEntryPointType(entryPointType: EntryPointType): EntryPoint;
/**
* A meeting code for accessing the conference. Maximum length 128 characters. Optional.
* https://developers.google.com/apps-script/reference/conference-data/entry-point#setMeetingCode(String)
* @param meetingCode The meeting code to set.
*/
setMeetingCode(meetingCode: string): EntryPoint;
/**
* A passcode for accessing the conference. Maximum length 128 characters. Optional.
* https://developers.google.com/apps-script/reference/conference-data/entry-point#setPasscode(String)
* @param passcode The passcode to set.
*/
setPasscode(passcode: string): EntryPoint;
/**
* A password code for accessing the conference. Maximum length 128 characters. Optional.
* https://developers.google.com/apps-script/reference/conference-data/entry-point#setPassword(String)
* @param password The password to set.
*/
setPassword(password: string): EntryPoint;
/**
* A PIN code for accessing the conference. Maximum length 128 characters. Optional.
* https://developers.google.com/apps-script/reference/conference-data/entry-point#setPin(String)
* @param pin The PIN code to set.
*/
setPin(pin: string): EntryPoint;
/**
* The CLDR/ISO 3166 region code for the country associated with this entry point. Applicable only
* to phone entry point types. Optional.
* https://developers.google.com/apps-script/reference/conference-data/entry-point#setRegionCode(String)
* @param regionCode The regionCode to set.
*/
setRegionCode(regionCode: string): EntryPoint;
/**
* Sets the URI for joining the conference through this entry point. For PHONE entry points, the prefix tel: is required. For SIP entry points, the prefix sip: is required. For VIDEO and MORE entry points, the prefixes
* http: or https: are required. Maximum length 1300 characters. Required.
* https://developers.google.com/apps-script/reference/conference-data/entry-point#setUri(String)
* @param uri The URI to set.
*/
setUri(uri: string): EntryPoint;
}
/**
* Enum that defines the features of the entry point that can be created by a conferencing add-on.
*/
enum EntryPointFeature {
UNKNOWN_FEATURE,
TOLL,
TOLL_FREE,
}
/**
* Enum that defines the types of entry points that can be created by a conferencing add-on.
*/
enum EntryPointType {
VIDEO,
PHONE,
MORE,
SIP,
}
}
}
declare var ConferenceDataService: GoogleAppsScript.Conference_Data.ConferenceDataService;

View File

@ -0,0 +1,356 @@
/// <reference path="google-apps-script.types.d.ts" />
/// <reference path="google-apps-script.base.d.ts" />
declare namespace GoogleAppsScript {
namespace Contacts {
/**
* Address field in a contact.
*/
interface AddressField {
deleteAddressField(): void;
getAddress(): string;
getLabel(): Field | ExtendedField | string;
isPrimary(): boolean;
setAddress(address: string): AddressField;
setAsPrimary(): AddressField;
setLabel(field: Field): AddressField;
setLabel(label: string): AddressField;
}
/**
* Company field in a Contact.
*/
interface CompanyField {
deleteCompanyField(): void;
getCompanyName(): string;
getJobTitle(): string;
isPrimary(): boolean;
setAsPrimary(): CompanyField;
setCompanyName(company: string): CompanyField;
setJobTitle(title: string): CompanyField;
}
/**
* A Contact contains the name, address, and various contact details of a contact.
*/
interface Contact {
addAddress(label: typeof ContactsApp.Field | string, address: string): AddressField;
addCompany(company: string, title: string): CompanyField;
addCustomField(label: typeof ContactsApp.ExtendedField | string, content: any): CustomField;
addDate(
label: typeof ContactsApp.Field | string,
month: Base.Month,
day: Integer,
year: Integer,
): DateField;
addEmail(label: typeof ContactsApp.Field | string, address: string): EmailField;
addIM(label: typeof ContactsApp.Field | string, address: string): IMField;
addPhone(label: typeof ContactsApp.Field | string, number: string): PhoneField;
addToGroup(group: ContactGroup): Contact;
addUrl(label: typeof ContactsApp.Field | string, url: string): UrlField;
deleteContact(): void;
getAddresses(): AddressField[];
getAddresses(label: typeof ContactsApp.Field | string): AddressField[];
getCompanies(): CompanyField[];
getContactGroups(): ContactGroup[];
getCustomFields(): CustomField[];
getCustomFields(label: typeof ContactsApp.ExtendedField | string): CustomField[];
getDates(): DateField[];
getDates(label: typeof ContactsApp.Field | string): DateField[];
getEmails(): EmailField[];
getEmails(label: typeof ContactsApp.Field | string): EmailField[];
getFamilyName(): string;
getFullName(): string;
getGivenName(): string;
getIMs(): IMField[];
getIMs(label: typeof ContactsApp.Field | string): IMField[];
getId(): string;
getInitials(): string;
getLastUpdated(): Base.Date;
getMaidenName(): string;
getMiddleName(): string;
getNickname(): string;
getNotes(): string;
getPhones(): PhoneField[];
getPhones(label: typeof ContactsApp.Field | string): PhoneField[];
getPrefix(): string;
getPrimaryEmail(): string;
getShortName(): string;
getSuffix(): string;
getUrls(): UrlField[];
getUrls(label: typeof ContactsApp.Field | string): UrlField[];
removeFromGroup(group: ContactGroup): Contact;
setFamilyName(familyName: string): Contact;
setFullName(fullName: string): Contact;
setGivenName(givenName: string): Contact;
setInitials(initials: string): Contact;
setMaidenName(maidenName: string): Contact;
setMiddleName(middleName: string): Contact;
setNickname(nickname: string): Contact;
setNotes(notes: string): Contact;
setPrefix(prefix: string): Contact;
setShortName(shortName: string): Contact;
setSuffix(suffix: string): Contact;
/** @deprecated DO NOT USE */ getEmailAddresses(): string[];
/** @deprecated DO NOT USE */ getHomeAddress(): string;
/** @deprecated DO NOT USE */ getHomeFax(): string;
/** @deprecated DO NOT USE */ getHomePhone(): string;
/** @deprecated DO NOT USE */ getMobilePhone(): string;
/** @deprecated DO NOT USE */ getPager(): string;
/** @deprecated DO NOT USE */ getUserDefinedField(key: string): string;
/** @deprecated DO NOT USE */ getUserDefinedFields(): object;
/** @deprecated DO NOT USE */ getWorkAddress(): string;
/** @deprecated DO NOT USE */ getWorkFax(): string;
/** @deprecated DO NOT USE */ getWorkPhone(): string;
/** @deprecated DO NOT USE */ setHomeAddress(addr: string): void;
/** @deprecated DO NOT USE */ setHomeFax(phone: string): void;
/** @deprecated DO NOT USE */ setHomePhone(phone: string): void;
/** @deprecated DO NOT USE */ setMobilePhone(phone: string): void;
/** @deprecated DO NOT USE */ setPager(phone: string): void;
/** @deprecated DO NOT USE */ setPrimaryEmail(primaryEmail: string): void;
/** @deprecated DO NOT USE */ setUserDefinedField(key: string, value: string): void;
/** @deprecated DO NOT USE */ setUserDefinedFields(o: object): void;
/** @deprecated DO NOT USE */ setWorkAddress(addr: string): void;
/** @deprecated DO NOT USE */ setWorkFax(phone: string): void;
/** @deprecated DO NOT USE */ setWorkPhone(phone: string): void;
}
/**
* A ContactGroup is is a group of contacts.
*/
interface ContactGroup {
addContact(contact: Contact): ContactGroup;
deleteGroup(): void;
getContacts(): Contact[];
getId(): string;
getName(): string;
isSystemGroup(): boolean;
removeContact(contact: Contact): ContactGroup;
setName(name: string): ContactGroup;
/** @deprecated DO NOT USE */ getGroupName(): string;
/** @deprecated DO NOT USE */ setGroupName(name: string): void;
}
/**
* This class allows users to access their own Google Contacts and create, remove, and update
* contacts listed therein.
*/
interface ContactsApp {
ExtendedField: typeof ExtendedField;
Field: typeof Field;
Gender: typeof Gender;
Month: typeof Base.Month;
Priority: typeof Priority;
Sensitivity: typeof Sensitivity;
createContact(givenName: string, familyName: string, email: string): Contact;
createContactGroup(name: string): ContactGroup;
deleteContact(contact: Contact): void;
deleteContactGroup(group: ContactGroup): void;
getContact(emailAddress: string): Contact;
getContactById(id: string): Contact;
getContactGroup(name: string): ContactGroup;
getContactGroupById(id: string): ContactGroup;
getContactGroups(): ContactGroup[];
getContacts(): Contact[];
getContactsByAddress(query: string): Contact[];
getContactsByAddress(query: string, label: Field): Contact[];
getContactsByAddress(query: string, label: string): Contact[];
getContactsByCompany(query: string): Contact[];
getContactsByCustomField(query: typeof ContactsApp.ExtendedField | string, label: ExtendedField): Contact[];
getContactsByDate(month: Base.Month, day: Integer, label: Field): Contact[];
getContactsByDate(month: Base.Month, day: Integer, year: Integer, label: Field): Contact[];
getContactsByDate(month: Base.Month, day: Integer, year: Integer, label: string): Contact[];
getContactsByDate(month: Base.Month, day: Integer, label: string): Contact[];
getContactsByEmailAddress(query: string): Contact[];
getContactsByEmailAddress(query: string, label: Field): Contact[];
getContactsByEmailAddress(query: string, label: string): Contact[];
getContactsByGroup(group: ContactGroup): Contact[];
getContactsByIM(query: string): Contact[];
getContactsByIM(query: string, label: Field): Contact[];
getContactsByIM(query: string, label: string): Contact[];
getContactsByJobTitle(query: string): Contact[];
getContactsByName(query: string): Contact[];
getContactsByName(query: string, label: Field): Contact[];
getContactsByNotes(query: string): Contact[];
getContactsByPhone(query: string): Contact[];
getContactsByPhone(query: string, label: Field): Contact[];
getContactsByPhone(query: string, label: string): Contact[];
getContactsByUrl(query: string): Contact[];
getContactsByUrl(query: string, label: Field): Contact[];
getContactsByUrl(query: string, label: string): Contact[];
/** @deprecated DO NOT USE */ findByEmailAddress(email: string): Contact;
/** @deprecated DO NOT USE */ findContactGroup(name: string): ContactGroup;
/** @deprecated DO NOT USE */ getAllContacts(): Contact[];
}
/**
* A custom field in a Contact.
*/
interface CustomField {
deleteCustomField(): void;
getLabel(): Field | ExtendedField | string;
getValue(): any;
setLabel(field: ExtendedField): CustomField;
setLabel(label: string): CustomField;
setValue(value: any): CustomField;
}
/**
* A date field in a Contact.
*
* This class is only used by the Contacts service, and dates used elsewhere in App Script use
* JavaScript's standard
* Date object.
*/
interface DateField {
deleteDateField(): void;
getDay(): Integer;
getLabel(): Field | ExtendedField | string;
getMonth(): Base.Month;
getYear(): Integer;
setDate(month: Base.Month, day: Integer): DateField;
setDate(month: Base.Month, day: Integer, year: Integer): DateField;
setLabel(label: Field): DateField;
setLabel(label: string): DateField;
}
/**
* An email field in a Contact.
*/
interface EmailField {
deleteEmailField(): void;
getAddress(): string;
getDisplayName(): string;
getLabel(): Field | ExtendedField | string;
isPrimary(): boolean;
setAddress(address: string): EmailField;
setAsPrimary(): EmailField;
setDisplayName(name: string): EmailField;
setLabel(field: Field): EmailField;
setLabel(label: string): EmailField;
}
/**
* An enum for extended contacts fields.
*/
enum ExtendedField {
HOBBY,
MILEAGE,
LANGUAGE,
GENDER,
BILLING_INFORMATION,
DIRECTORY_SERVER,
SENSITIVITY,
PRIORITY,
HOME,
WORK,
USER,
OTHER,
}
/**
* An enum for contacts fields.
*/
enum Field {
FULL_NAME,
GIVEN_NAME,
MIDDLE_NAME,
FAMILY_NAME,
MAIDEN_NAME,
NICKNAME,
SHORT_NAME,
INITIALS,
PREFIX,
SUFFIX,
HOME_EMAIL,
WORK_EMAIL,
BIRTHDAY,
ANNIVERSARY,
HOME_ADDRESS,
WORK_ADDRESS,
ASSISTANT_PHONE,
CALLBACK_PHONE,
MAIN_PHONE,
PAGER,
HOME_FAX,
WORK_FAX,
HOME_PHONE,
WORK_PHONE,
MOBILE_PHONE,
GOOGLE_VOICE,
NOTES,
GOOGLE_TALK,
AIM,
YAHOO,
SKYPE,
QQ,
MSN,
ICQ,
JABBER,
BLOG,
FTP,
PROFILE,
HOME_PAGE,
WORK_WEBSITE,
HOME_WEBSITE,
JOB_TITLE,
COMPANY,
}
/**
* An enum for contact gender.
*/
enum Gender {
MALE,
FEMALE,
}
/**
* An instant messaging field in a Contact.
*/
interface IMField {
deleteIMField(): void;
getAddress(): string;
getLabel(): Field | ExtendedField | string;
isPrimary(): boolean;
setAddress(address: string): IMField;
setAsPrimary(): IMField;
setLabel(field: Field): IMField;
setLabel(label: string): IMField;
}
/**
* A phone number field in a Contact.
*/
interface PhoneField {
deletePhoneField(): void;
getLabel(): Field | ExtendedField | string;
getPhoneNumber(): string;
isPrimary(): boolean;
setAsPrimary(): PhoneField;
setLabel(field: Field): PhoneField;
setLabel(label: string): PhoneField;
setPhoneNumber(number: string): PhoneField;
}
/**
* An enum for contact priority.
*/
enum Priority {
HIGH,
LOW,
NORMAL,
}
/**
* An enum for contact sensitivity.
*/
enum Sensitivity {
CONFIDENTIAL,
NORMAL,
PERSONAL,
PRIVATE,
}
/**
* A URL field in a Contact.
*/
interface UrlField {
deleteUrlField(): void;
getAddress(): string;
getLabel(): Field | ExtendedField | string;
isPrimary(): boolean;
setAddress(address: string): UrlField;
setAsPrimary(): UrlField;
setLabel(field: Field): UrlField;
setLabel(label: string): UrlField;
}
}
}
declare var ContactsApp: GoogleAppsScript.Contacts.ContactsApp;

View File

@ -0,0 +1,61 @@
/// <reference path="google-apps-script.types.d.ts" />
declare namespace GoogleAppsScript {
namespace Content {
/**
* Service for returning text content from a script.
*
* You can serve up text in various forms. For example, publish this script as a web app.
*
* function doGet() {
* return ContentService.createTextOutput("Hello World");
* }
*/
interface ContentService {
MimeType: typeof MimeType;
createTextOutput(): TextOutput;
createTextOutput(content: string): TextOutput;
}
/**
* An enum for mime types that can be served from a script.
*/
enum MimeType {
ATOM,
CSV,
ICAL,
JAVASCRIPT,
JSON,
RSS,
TEXT,
VCARD,
XML,
}
/**
* A TextOutput object that can be served from a script.
*
* Due to security considerations, scripts cannot directly return text content to a browser.
* Instead, the browser is redirected to googleusercontent.com, which will display it without any
* further sanitization or manipulation.
*
* You can return text content like this:
*
* function doGet() {
* return ContentService.createTextOutput("hello world!");
* }
*
* ContentService
*/
interface TextOutput {
append(addedContent: string): TextOutput;
clear(): TextOutput;
downloadAsFile(filename: string): TextOutput;
getContent(): string;
getFileName(): string;
getMimeType(): MimeType;
setContent(content: string): TextOutput;
setMimeType(mimeType: MimeType): TextOutput;
}
}
}
declare var ContentService: GoogleAppsScript.Content.ContentService;

View File

@ -0,0 +1,628 @@
/// <reference path="google-apps-script.types.d.ts" />
declare namespace GoogleAppsScript {
namespace Data_Studio {
/**
* An enum that defines the aggregation types that can be set for a Field.
*/
enum AggregationType {
AVG,
COUNT,
COUNT_DISTINCT,
MAX,
MIN,
SUM,
AUTO,
NO_AGGREGATION,
}
/**
* An enum that defines the authentication types that can be set for a connector.
*/
enum AuthType {
NONE,
OAUTH2,
USER_PASS,
KEY,
USER_TOKEN,
}
/**
* A configuration object for a native BigQuery connector. Return this object from getData()
* for Data Studio to query BigQuery for the connector.
*
* var cc = DataStudioApp.createCommunityConnector();
* var types = cc.BigQueryParameterType;
*
* var bqConfig = cc.newBigQueryConfig()
* .setBillingProjectId('billingProjectId')
* .setQuery('queryString')
* .setUseStandardSql(true)
* .setAccessToken('accessToken')
* .addQueryParameter('dob', types.STRING, '01011990')
* .build();
*/
interface BigQueryConfig {
addQueryParameter(name: string, type: BigQueryParameterType, value: string): BigQueryConfig;
build(): Config;
printJson(): string;
setAccessToken(accessToken: string): BigQueryConfig;
setBillingProjectId(billingProjectId: string): BigQueryConfig;
setQuery(query: string): BigQueryConfig;
setUseStandardSql(useStandardSql: boolean): BigQueryConfig;
}
/**
* An enum that defines the BigQuery parameter types that you can set.
*/
enum BigQueryParameterType {
STRING,
INT64,
BOOL,
FLOAT64,
}
/**
* Contains checkbox information for the config. Its properties determine how the checkbox is
* displayed in Data Studio.
*
* var checkbox = config.newCheckbox()
* .setId("use_https")
* .setName("Use Https?")
* .setHelpText("Whether or not https should be used.")
* .setAllowOverride(true);
*/
interface Checkbox {
setAllowOverride(allowOverride: boolean): Checkbox;
setHelpText(helpText: string): Checkbox;
setId(id: string): Checkbox;
setIsDynamic(isDynamic: boolean): Checkbox;
setName(name: string): Checkbox;
}
/**
* CommunityConnector enables scripts to access builders and utilities to help with development of
* Community Connectors for Data Studio. Use this class to get a reference to the Fields
* object and the FieldType and AggregationType enums so they can be used in the
* construction of Fields.
*
* var cc = DataStudioApp.createCommunityConnector();
* var fieldType = cc.FieldType;
* var aggregationType = cc.AggregationType;
*
* var fields = cc.getFields();
*
* fields.newMetric()
* .setAggregation(aggregationType.AVG)
* .setType(fieldType.CURRENCY_USD);
*/
interface CommunityConnector {
AggregationType: typeof AggregationType;
AuthType: typeof AuthType;
BigQueryParameterType: typeof BigQueryParameterType;
FieldType: typeof FieldType;
getConfig(): Config;
getFields(): Fields;
newAuthTypeResponse(): GetAuthTypeResponse;
newBigQueryConfig(): BigQueryConfig;
newDebugError(): DebugError;
newGetDataResponse(): GetDataResponse;
newGetSchemaResponse(): GetSchemaResponse;
newSetCredentialsResponse(): SetCredentialsResponse;
newUserError(): UserError;
}
/**
* Contains the configuration entries for a connector. These configuration entries define what
* questions are asked when adding a new connector.
*
* var cc = DataStudioApp.createCommunityConnector();
* var config = cc.getConfig();
*
* var info_entry = config.newInfo()
* .setId("info_id")
* .setHelpText("This connector can connect to multiple data endpoints.");
*/
interface Config {
build(): Config;
newCheckbox(): Checkbox;
newInfo(): Info;
newOptionBuilder(): OptionBuilder;
newSelectMultiple(): SelectMultiple;
newSelectSingle(): SelectSingle;
newTextArea(): TextArea;
newTextInput(): TextInput;
printJson(): string;
setDateRangeRequired(dateRangeRequired: boolean): Config;
setIsSteppedConfig(isSteppedConfig: boolean): Config;
}
/**
* DataStudioApp allows scripts to interact with developer-oriented features for Data Studio.
*/
interface DataStudioApp {
createCommunityConnector(): CommunityConnector;
}
/**
* An error that is only visible to admins of the connector.
*
* var cc = DataStudioApp.createCommunityConnector();
*
* cc.newDebugError()
* .setText("This is the debug error text.")
* .throwException();
*/
interface DebugError {
printJson(): string;
setText(text: string): DebugError;
throwException(): never;
}
/**
* Contains field-related data. Its properties determine how the field is used in Data Studio.
*
* var cc = DataStudioApp.createCommunityConnector();
* var fields = cc.getFields();
* var types = cc.FieldType;
*
* var field1 = fields.newDimension()
* .setId('field1_id')
* .setName('Field 1 ID')
* .setDescription('The first field.')
* .setType(types.YEAR_MONTH)
* .setGroup('DATETIME');
*/
interface Field {
getAggregation(): AggregationType | null;
getDescription(): string | null;
getFormula(): string | null;
getGroup(): string | null;
getId(): string | null;
getIsReaggregatable(): boolean | null;
getName(): string | null;
getType(): FieldType | null;
isDefault(): boolean;
isDimension(): boolean;
isHidden(): boolean;
isMetric(): boolean;
setAggregation(aggregation: AggregationType): Field;
setDescription(description: string): Field;
setFormula(formula: string): Field;
setGroup(group: string): Field;
setId(id: string): Field;
setIsHidden(isHidden: boolean): Field;
setIsReaggregatable(isReaggregatable: boolean): Field;
setName(name: string): Field;
setType(type: FieldType): Field;
}
/**
* An enum that defines the types that can be set for a Field.
*/
enum FieldType {
YEAR,
YEAR_QUARTER,
YEAR_MONTH,
YEAR_WEEK,
YEAR_MONTH_DAY,
YEAR_MONTH_DAY_HOUR,
YEAR_MONTH_DAY_SECOND,
QUARTER,
MONTH,
WEEK,
MONTH_DAY,
DAY_OF_WEEK,
DAY,
HOUR,
MINUTE,
DURATION,
COUNTRY,
COUNTRY_CODE,
CONTINENT,
CONTINENT_CODE,
SUB_CONTINENT,
SUB_CONTINENT_CODE,
REGION,
REGION_CODE,
CITY,
CITY_CODE,
METRO,
METRO_CODE,
LATITUDE_LONGITUDE,
NUMBER,
PERCENT,
TEXT,
BOOLEAN,
URL,
HYPERLINK,
IMAGE,
IMAGE_LINK,
CURRENCY_AED,
CURRENCY_ALL,
CURRENCY_ARS,
CURRENCY_AUD,
CURRENCY_BDT,
CURRENCY_BGN,
CURRENCY_BOB,
CURRENCY_BRL,
CURRENCY_CAD,
CURRENCY_CDF,
CURRENCY_CHF,
CURRENCY_CLP,
CURRENCY_CNY,
CURRENCY_COP,
CURRENCY_CRC,
CURRENCY_CZK,
CURRENCY_DKK,
CURRENCY_DOP,
CURRENCY_EGP,
CURRENCY_ETB,
CURRENCY_EUR,
CURRENCY_GBP,
CURRENCY_HKD,
CURRENCY_HRK,
CURRENCY_HUF,
CURRENCY_IDR,
CURRENCY_ILS,
CURRENCY_INR,
CURRENCY_IRR,
CURRENCY_ISK,
CURRENCY_JMD,
CURRENCY_JPY,
CURRENCY_KRW,
CURRENCY_LKR,
CURRENCY_LTL,
CURRENCY_MNT,
CURRENCY_MVR,
CURRENCY_MXN,
CURRENCY_MYR,
CURRENCY_NOK,
CURRENCY_NZD,
CURRENCY_PAB,
CURRENCY_PEN,
CURRENCY_PHP,
CURRENCY_PKR,
CURRENCY_PLN,
CURRENCY_RON,
CURRENCY_RSD,
CURRENCY_RUB,
CURRENCY_SAR,
CURRENCY_SEK,
CURRENCY_SGD,
CURRENCY_THB,
CURRENCY_TRY,
CURRENCY_TWD,
CURRENCY_TZS,
CURRENCY_UAH,
CURRENCY_USD,
CURRENCY_UYU,
CURRENCY_VEF,
CURRENCY_VND,
CURRENCY_YER,
CURRENCY_ZAR,
}
/**
* Contains a set of Fields for a community connector. This set of fields define which
* dimensions and metrics can be used in Data Studio.
*
* var cc = DataStudioApp.createCommunityConnector();
* var fields = cc.getFields();
* var types = cc.FieldType;
*
* var field1 = fields.newDimension()
* // Set other properties as needed.
* .setId('field1_id');
*/
interface Fields {
asArray(): Field[];
build(): any[];
forIds(ids: string[]): Fields;
getDefaultDimension(): Field | null;
getDefaultMetric(): Field | null;
getFieldById(fieldId: string): Field | null;
newDimension(): Field;
newMetric(): Field;
setDefaultDimension(fieldId: string): void;
setDefaultMetric(fieldId: string): void;
}
/**
* Builder to create a getAuthType() response for your script project.
*
* function getAuthType() {
* var cc = DataStudioApp.createCommunityConnector();
* var authTypes = cc.AuthType;
*
* return cc.newGetAuthTypeResponse()
* .setAuthType(authTypes.USER_PASS)
* .setHelpUrl("https://www.example.org/connector-auth-help")
* .build();
* }
*/
interface GetAuthTypeResponse {
build(): GetAuthTypeResponse;
printJson(): string;
setAuthType(authType: AuthType): GetAuthTypeResponse;
setHelpUrl(helpUrl: string): GetAuthTypeResponse;
}
/**
* Builder to create a getData() response for your script project.
*
* function getFields() {...}
* function getData() {
* var cc = DataStudioApp.createCommunityConnector();
*
* return cc.newGetDataResponse()
* .setFields(getFields())
* .addRow(['3', 'Foobar.com'])
* .addRow(['4', 'Foobaz.com'])
* .addRows([
* ['5', 'Fizzbuz.com'],
* ['6', 'Fizzbaz.com']
* ])
* .build();
* }
*/
interface GetDataResponse {
addAllRows(rows: string[][]): GetDataResponse;
addRow(row: string[]): GetDataResponse;
build(): any;
setFields(fields: Fields): GetDataResponse;
setFiltersApplied(filtersApplied: boolean): GetDataResponse;
}
/**
* Builder to create a getSchema() response for your script project.
*
* function getSchema() {
* var cc = DataStudioApp.createCommunityConnector();
* var fields = cc.getFields();
* var types = cc.FieldType;
*
* fields.newDimension()
* .setId('Created')
* .setName('Date Created')
* .setDescription('The date that this was created')
* .setType(types.YEAR_MONTH_DAY);
*
* fields.newMetric()
* .setId('Amount')
* .setName('Amount (USD)')
* .setDescription('The cost in US dollars')
* .setType(types.CURRENCY_USD);
*
* return cc.newGetSchemaResponse()
* .setFields(fields)
* .build();
* }
*/
interface GetSchemaResponse {
build(): any;
printJson(): string;
setFields(fields: Fields): GetSchemaResponse;
}
/**
* Contains info data for the config. Its properties determine how the info is displayed in Data
* Studio.
*
* var cc = DataStudioApp.createCommunityConnector();
* var config = cc.getConfig();
*
* var info1 = config.newInfo()
* .setId("info1")
* .setText("This text gives some context on the configuration.");
*/
interface Info {
setId(id: string): Info;
setText(text: string): Info;
}
/**
* A builder for creating options for SelectSingles and SelectMultiples.
*
* var cc = DataStudioApp.createCommunityConnector();
* var config = cc.getConfig();
*
* var option1 = config.newOptionBuilder()
* .setLabel("option label")
* .setValue("option_value");
*
* var option2 = config.newOptionBuilder()
* .setLabel("second option label")
* .setValue("option_value_2");
*
* var info1 = config.newSelectSingle()
* .setId("api_endpoint")
* .setName("Data Type")
* .setHelpText("Select the data type you're interested in.")
* .addOption(option1)
* .addOption(option2);
*/
interface OptionBuilder {
setLabel(label: string): OptionBuilder;
setValue(value: string): OptionBuilder;
}
/**
* Contains select multiple information for the config. Its properties determine how the select
* multiple is displayed in Data Studio.
*
* Usage:
*
* var option1 = config.newOptionBuilder()
* .setLabel("option label")
* .setValue("option_value");
*
* var option2 = config.newOptionBuilder()
* .setLabel("second option label")
* .setValue("option_value_2");
*
* var info1 = config.newSelectMultiple()
* .setId("api_endpoint")
* .setName("Data Type")
* .setHelpText("Select the data type you're interested in.")
* .setAllowOverride(true)
* .addOption(option1)
* .addOption(option2);
*/
interface SelectMultiple {
addOption(optionBuilder: OptionBuilder): SelectMultiple;
setAllowOverride(allowOverride: boolean): SelectMultiple;
setHelpText(helpText: string): SelectMultiple;
setId(id: string): SelectMultiple;
setIsDynamic(isDynamic: boolean): SelectMultiple;
setName(name: string): SelectMultiple;
}
/**
* Contains select single information for the config. Its properties determine how the select single
* is displayed in Data Studio.
*
* var option1 = config.newOptionBuilder()
* .setLabel("option label")
* .setValue("option_value");
*
* var option2 = config.newOptionBuilder()
* .setLabel("second option label")
* .setValue("option_value_2");
*
* var info1 = config.newSelectSingle()
* .setId("api_endpoint")
* .setName("Data Type")
* .setHelpText("Select the data type you're interested in.")
* .setAllowOverride(true)
* .addOption(option1)
* .addOption(option2);
*/
interface SelectSingle {
addOption(optionBuilder: OptionBuilder): SelectSingle;
setAllowOverride(allowOverride: boolean): SelectSingle;
setHelpText(helpText: string): SelectSingle;
setId(id: string): SelectSingle;
setIsDynamic(isDynamic: boolean): SelectSingle;
setName(name: string): SelectSingle;
}
/**
* Builder to create a setCredentials() response for your script project.
*
* function setCredentials(request) {
* var isValid = checkForValidCreds(request);
*
* if (isValid) {
* // store the creds somewhere.
* }
*
* return cc.newSetCredentialsResponse()
* .setIsValid(isValid)
* .build();
* }
*/
interface SetCredentialsResponse {
build(): any;
printJson(): string;
setIsValid(isValid: boolean): SetCredentialsResponse;
}
/**
* Contains text area information for the config. Its properties determine how the text input is
* displayed in Data Studio.
*
* Usage:
*
* var cc = DataStudioApp.createCommunityConnector();
* var config = cc.getConfig();
*
* var textArea1 = config.newTextArea()
* .setId("textArea1")
* .setName("Search")
* .setHelpText("for example, Coldplay")
* .setAllowOverride(true)
* .setPlaceholder("Search for an artist for all songs.");
*/
interface TextArea {
setAllowOverride(allowOverride: boolean): TextArea;
setHelpText(helpText: string): TextArea;
setId(id: string): TextArea;
setIsDynamic(isDynamic: boolean): TextArea;
setName(name: string): TextArea;
setPlaceholder(placeholder: string): TextArea;
}
/**
* Contains text input information for the config. Its properties determine how the text input is
* displayed in Data Studio.
*
* var cc = DataStudioApp.createCommunityConnector();
* var config = cc.getConfig();
*
* var info1 = config.newTextInput()
* .setId("info1")
* .setName("Search")
* .setHelpText("for example, Coldplay")
* .setAllowOverride(true)
* .setPlaceholder("Search for an artist for all songs.");
*/
interface TextInput {
setAllowOverride(allowOverride: boolean): TextInput;
setHelpText(helpText: string): TextInput;
setId(id: string): TextInput;
setIsDynamic(isDynamic: boolean): TextInput;
setName(name: string): TextInput;
setPlaceholder(placeholder: string): TextInput;
}
/**
* An error that is shown to users of the connector.
*
* var cc = DataStudioApp.createCommunityConnector();
*
* cc.newUserError()
* .setText("This is the debug error text.")
* .setDebugText("This text is only shown to admins.")
* .throwException();
*/
interface UserError {
printJson(): string;
setDebugText(text: string): UserError;
setText(text: string): UserError;
throwException(): never;
}
/**
* function getData(request: GoogleAppsScript.Data_Studio.Request<YourConnectorParams>)
*
* See https://developers.google.com/datastudio/connector/reference#getdata
*/
interface Request<T> {
/** An object containing the user provided values for the config parameters defined by the connector. */
configParams: T;
/** An object containing information relevant to connector execution. */
scriptParams: ScriptParams;
/**
* By default, the date range provided will be the last 28 days excluding today.
* If a user applies a date range filter for a report, then the date range provided will reflect the user selection.
* When sampleExtraction is set to true, the date two days earlier than today is given as both the start and end date.
*/
dateRange: DateRange;
/** The names of the requested fields. */
fields: Array<{ name: string }>;
/**
* A nested array of the user selected filters.
* The innermost arrays should be ORed together, the outermost arrays should be ANDed together.
*/
dimensionsFilters: DimensionsFilters[][];
}
interface DateRange {
/** The start date for filtering the data. Applies only if dateRangeRequired is set to true. It will be in YYYY-MM-DD format. */
startDate: string;
/** The end date for filtering the data. Applies only dateRangeRequired is set to true. It will be in YYYY-MM-DD format. */
endDate: string;
}
interface ScriptParams {
/** If true, the getData() request is for automatic semantic type detection. */
sampleExtraction?: boolean | undefined;
/** A timestamp that marks the most recent request for a refresh of data. */
lastRefresh: string;
}
type RegexpOperator = "REGEXP_PARTIAL_MATCH" | "REGEXP_EXACT_MATCH";
type NumericOperator =
| "NUMERIC_GREATER_THAN"
| "NUMERIC_GREATER_THAN_OR_EQUAL"
| "NUMERIC_LESS_THAN"
| "NUMERIC_LESS_THAN_OR_EQUAL";
interface DimensionsFilters {
/** The name of the field to be filtered */
fieldName: string;
/** An array of values to use for the operator. */
values: string[];
/** Whether data matching this filter should be included or excluded from the getData() response. */
type: "INCLUDE" | "EXCLUDE";
/** The operator to apply. */
operator: "EQUALS" | "CONTAINS" | RegexpOperator | "IN_LIST" | "IS_NULL" | "BETWEEN" | NumericOperator;
}
}
}
declare var DataStudioApp: GoogleAppsScript.Data_Studio.DataStudioApp;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,398 @@
/// <reference path="google-apps-script.types.d.ts" />
/// <reference path="google-apps-script.base.d.ts" />
declare namespace GoogleAppsScript {
namespace Drive {
/**
* An enum representing classes of users who can access a file or folder, besides any individual
* users who have been explicitly given access. These properties can be accessed from DriveApp.Access.
*
* // Creates a folder that anyone on the Internet can read from and write to. (Domain
* // administrators can prohibit this setting for users of a G Suite domain.)
* var folder = DriveApp.createFolder('Shared Folder');
* folder.setSharing(DriveApp.Access.ANYONE, DriveApp.Permission.EDIT);
*/
enum Access {
ANYONE,
ANYONE_WITH_LINK,
DOMAIN,
DOMAIN_WITH_LINK,
PRIVATE,
}
/**
* Allows scripts to create, find, and modify files and folders in Google Drive.
*
* // Log the name of every file in the user's Drive.
* var files = DriveApp.getFiles();
* while (files.hasNext()) {
* var file = files.next();
* Logger.log(file.getName());
* }
*/
interface DriveApp {
Access: typeof Access;
Permission: typeof Permission;
/**
* Adds the given file to the root of the user's Drive.
* This method does not move the file out of its existing parent folder;
* a file can have more than one parent simultaneously.
*/
addFile(child: File): Folder;
/**
* Adds the given folder to the root of the user's Drive.
* This method does not move the folder out of its existing parent folder;
* a folder can have more than one parent simultaneously.
*/
addFolder(child: Folder): Folder;
/**
* Resumes a file iteration using a continuation token from a previous iterator.
* This method is useful if processing an iterator in one execution would exceed
* the maximum execution time. Continuation tokens are generally valid for one week.
*/
continueFileIterator(continuationToken: string): FileIterator;
/**
* Resumes a folder iteration using a continuation token from a previous iterator.
* This method is useful if processing an iterator in one execution would exceed
* the maximum execution time. Continuation tokens are generally valid for one week.
*/
continueFolderIterator(continuationToken: string): FolderIterator;
/** Creates a file in the root of the user's Drive from a given Blob of arbitrary data. */
createFile(blob: Base.BlobSource): File;
/**
* Creates a text file in the root of the user's Drive with the given name
* and contents. Throws an exception if content is larger than 50 MB.
*/
createFile(name: string, content: string): File;
/**
* Creates a file in the root of the user's Drive with the given name, contents, and MIME type.
* Throws an exception if content is larger than 10MB.
*/
createFile(name: string, content: string, mimeType: string): File;
/** Creates a folder in the root of the user's Drive with the given name. */
createFolder(name: string): Folder;
/** Creates a shortcut to the provided Drive item ID, and returns it. */
createShortcut(targetId: string): File;
/**
* Creates a shortcut to the provided Drive item ID and resource key, and
* returns it. Resource keys are an additional parameter which need to be
* passed to access the target file or folder that has been shared using a
* link.
*/
createShortcutForTargetIdAndResourceKey(targetId: string, targetResourceKey: string): File;
/**
* Gets the file with the given ID.
* Throws a scripting exception if the file does not exist or
* the user does not have permission to access it.
*/
getFileById(id: string): File;
/**
* Gets the file with the given ID and resource key. Resource keys are an
* additional parameter which need to be passed to access files that have
* been shared using a link.
*
* Throws a scripting exception if the file doesn't exist or the user
* doesn't have permission to access it.
*/
getFileByIdAndResourceKey(id: string, resourceKey: string): File;
/** Gets a collection of all files in the user's Drive. */
getFiles(): FileIterator;
/** Gets a collection of all files in the user's Drive that have the given name. */
getFilesByName(name: string): FileIterator;
/** Gets a collection of all files in the user's Drive that have the given MIME type. */
getFilesByType(mimeType: string): FileIterator;
/**
* Gets the folder with the given ID. Throws a scripting exception if the folder
* does not exist or the user does not have permission to access it.
*/
getFolderById(id: string): Folder;
/**
* Gets the folder with the given ID and resource key. Resource keys are
* an additional parameter which need to be passed to access folders that
* have been shared using a link.
* Throws a scripting exception if the folder doesn't exist or the user
* doesn't have permission to access it.
*/
getFolderByIdAndResourceKey(id: string, resourceKey: string): Folder;
/** Gets a collection of all folders in the user's Drive. */
getFolders(): FolderIterator;
/** Gets a collection of all folders in the user's Drive that have the given name. */
getFoldersByName(name: string): FolderIterator;
/** Gets the folder at the root of the user's Drive. */
getRootFolder(): Folder;
/** Gets the number of bytes the user is allowed to store in Drive. */
getStorageLimit(): Integer;
/** Gets the number of bytes the user is currently storing in Drive. */
getStorageUsed(): Integer;
/** Gets a collection of all the files in the trash of the user's Drive. */
getTrashedFiles(): FileIterator;
/** Gets a collection of all the folders in the trash of the user's Drive. */
getTrashedFolders(): FolderIterator;
/**
* Removes the given file from the root of the user's Drive.
* This method does not delete the file, but if a file is removed from all
* of its parents, it cannot be seen in Drive except by searching for it
* or using the "All items" view.
*/
removeFile(child: File): Folder;
/**
* Removes the given folder from the root of the user's Drive.
* This method does not delete the folder or its contents, but if a folder
* is removed from all of its parents, it cannot be seen in Drive except
* by searching for it or using the "All items" view.
*/
removeFolder(child: Folder): Folder;
/**
* Gets a collection of all files in the user's Drive that match the given search criteria.
* The search criteria are detailed the Google Drive SDK documentation.
* Note that the params argument is a query string that may contain string values,
* so take care to escape quotation marks correctly
* (for example "title contains 'Gulliver\\'s Travels'" or 'title contains "Gulliver\'s Travels"').
*/
searchFiles(params: string): FileIterator;
/**
* Gets a collection of all folders in the user's Drive that match the given search criteria.
* The search criteria are detailed the Google Drive SDK documentation.
* Note that the params argument is a query string that may contain string values,
* so take care to escape quotation marks correctly
* (for example "title contains 'Gulliver\\'s Travels'" or 'title contains "Gulliver\'s Travels"').
*/
searchFolders(params: string): FolderIterator;
}
/**
* A file in Google Drive. Files can be accessed or created from DriveApp.
*
* // Trash every untitled spreadsheet that hasn't been updated in a week.
* var files = DriveApp.getFilesByName('Untitled spreadsheet');
* while (files.hasNext()) {
* var file = files.next();
* if (new Date() - file.getLastUpdated() > 7 * 24 * 60 * 60 * 1000) {
* file.setTrashed(true);
* }
* }
*/
interface File {
addCommenter(emailAddress: string): File;
addCommenter(user: Base.User): File;
addCommenters(emailAddresses: string[]): File;
addEditor(emailAddress: string): File;
addEditor(user: Base.User): File;
addEditors(emailAddresses: string[]): File;
addViewer(emailAddress: string): File;
addViewer(user: Base.User): File;
addViewers(emailAddresses: string[]): File;
getAccess(email: string): Permission;
getAccess(user: Base.User): Permission;
getAs(contentType: string): Base.Blob;
getBlob(): Base.Blob;
getDateCreated(): Base.Date;
getDescription(): string | null;
getDownloadUrl(): string;
getEditors(): User[];
getId(): string;
getLastUpdated(): Base.Date;
getMimeType(): string;
getName(): string;
getOwner(): User;
getParents(): FolderIterator;
getResourceKey(): string | null;
getSecurityUpdateEligible(): boolean;
getSecurityUpdateEnabled(): boolean;
getSharingAccess(): Access;
getSharingPermission(): Permission;
getSize(): Integer;
getTargetId(): string | null;
getTargetMimeType(): string | null;
getTargetResourceKey(): string | null;
getThumbnail(): Base.Blob;
getUrl(): string;
getViewers(): User[];
isShareableByEditors(): boolean;
isStarred(): boolean;
isTrashed(): boolean;
makeCopy(): File;
makeCopy(destination: Folder): File;
makeCopy(name: string): File;
makeCopy(name: string, destination: Folder): File;
moveTo(destination: Folder): File;
removeCommenter(emailAddress: string): File;
removeCommenter(user: Base.User): File;
removeEditor(emailAddress: string): File;
removeEditor(user: Base.User): File;
removeViewer(emailAddress: string): File;
removeViewer(user: Base.User): File;
revokePermissions(user: string): File;
revokePermissions(user: Base.User): File;
setContent(content: string): File;
setDescription(description: string): File;
setName(name: string): File;
setOwner(emailAddress: string): File;
setOwner(user: Base.User): File;
setSecurityUpdateEnabled(enabled: boolean): File;
setShareableByEditors(shareable: boolean): File;
setSharing(accessType: Access, permissionType: Permission): File;
setStarred(starred: boolean): File;
setTrashed(trashed: boolean): File;
}
/**
* An iterator that allows scripts to iterate over a potentially large collection of files. File
* iterators can be acccessed from DriveApp or a Folder.
*
* // Log the name of every file in the user's Drive.
* var files = DriveApp.getFiles();
* while (files.hasNext()) {
* var file = files.next();
* Logger.log(file.getName());
* }
*/
interface FileIterator {
/**
* Gets a token that can be used to resume this iteration at a later time.
* This method is useful if processing an iterator in one execution would
* exceed the maximum execution time. Continuation tokens are generally valid for one week.
*/
getContinuationToken(): string;
/** Determines whether calling next() will return an item. */
hasNext(): boolean;
/**
* Gets the next item in the collection of files or folders.
* Throws an exception if no items remain.
*/
next(): File;
}
/**
* A folder in Google Drive. Folders can be accessed or created from DriveApp.
*
* // Log the name of every folder in the user's Drive.
* var folders = DriveApp.getFolders();
* while (folders.hasNext()) {
* var folder = folders.next();
* Logger.log(folder.getName());
* }
*/
interface Folder {
addEditor(emailAddress: string): Folder;
addEditor(user: Base.User): Folder;
addEditors(emailAddresses: string[]): Folder;
addFile(child: File): Folder;
addFolder(child: Folder): Folder;
addViewer(emailAddress: string): Folder;
addViewer(user: Base.User): Folder;
addViewers(emailAddresses: string[]): Folder;
createFile(blob: Base.BlobSource): File;
createFile(name: string, content: string): File;
createFile(name: string, content: string, mimeType: string): File;
createFolder(name: string): Folder;
createShortcut(targetId: string): File;
createShortcutForTargetIdAndResourceKey(targetId: string, targetResourceKey: string): File;
getAccess(email: string): Permission;
getAccess(user: Base.User): Permission;
getDateCreated(): Base.Date;
getDescription(): string | null;
getEditors(): User[];
getFiles(): FileIterator;
getFilesByName(name: string): FileIterator;
getFilesByType(mimeType: string): FileIterator;
getFolders(): FolderIterator;
getFoldersByName(name: string): FolderIterator;
getId(): string;
getLastUpdated(): Base.Date;
getName(): string;
getOwner(): User;
getParents(): FolderIterator;
getResourceKey(): string | null;
getSecurityUpdateEligible(): boolean;
getSecurityUpdateEnabled(): boolean;
getSharingAccess(): Access;
getSharingPermission(): Permission;
getSize(): Integer;
getUrl(): string;
getViewers(): User[];
isShareableByEditors(): boolean;
isStarred(): boolean;
isTrashed(): boolean;
moveTo(destination: Folder): Folder;
removeEditor(emailAddress: string): Folder;
removeEditor(user: Base.User): Folder;
removeFile(child: File): Folder;
removeFolder(child: Folder): Folder;
removeViewer(emailAddress: string): Folder;
removeViewer(user: Base.User): Folder;
revokePermissions(user: string): Folder;
revokePermissions(user: Base.User): Folder;
searchFiles(params: string): FileIterator;
searchFolders(params: string): FolderIterator;
setDescription(description: string): Folder;
setName(name: string): Folder;
setOwner(emailAddress: string): Folder;
setOwner(user: Base.User): Folder;
setSecurityUpdateEnabled(enabled: boolean): Folder;
setShareableByEditors(shareable: boolean): Folder;
setSharing(accessType: Access, permissionType: Permission): Folder;
setStarred(starred: boolean): Folder;
setTrashed(trashed: boolean): Folder;
}
/**
* An object that allows scripts to iterate over a potentially large collection of folders. Folder
* iterators can be acccessed from DriveApp, a File, or a Folder.
*
* // Log the name of every folder in the user's Drive.
* var folders = DriveApp.getFolders();
* while (folders.hasNext()) {
* var folder = folders.next();
* Logger.log(folder.getName());
* }
*/
interface FolderIterator {
getContinuationToken(): string;
hasNext(): boolean;
next(): Folder;
}
/**
* An enum representing the permissions granted to users who can access a file or folder, besides
* any individual users who have been explicitly given access. These properties can be accessed from
* DriveApp.Permission.
*
* // Creates a folder that anyone on the Internet can read from and write to. (Domain
* // administrators can prohibit this setting for G Suite users.)
* var folder = DriveApp.createFolder('Shared Folder');
* folder.setSharing(DriveApp.Access.ANYONE, DriveApp.Permission.EDIT);
*/
enum Permission {
VIEW,
EDIT,
COMMENT,
OWNER,
ORGANIZER,
NONE,
}
/**
* A user associated with a file in Google Drive. Users can be accessed from File.getEditors(), Folder.getViewers(), and other methods.
*
* // Log the email address of all users who have edit access to a file.
* var file = DriveApp.getFileById('1234567890abcdefghijklmnopqrstuvwxyz');
* var editors = file.getEditors();
* for (var i = 0; i < editors.length; i++) {
* Logger.log(editors[i].getEmail());
* }
*/
interface User {
/** Gets the domain name associated with the user's account. */
getDomain(): string;
/**
* Gets the user's email address. The user's email address is only available
* if the user has chosen to share the address from the Google+ account settings
* page, or if the user belongs to the same domain as the user running the script
* and the domain administrator has allowed all users within the domain to see
* other users' email addresses.
*/
getEmail(): string;
/** Gets the user's name. This method returns null if the user's name is not available. */
getName(): string;
/** Gets the URL for the user's photo. This method returns null if the user's photo is not available. */
getPhotoUrl(): string;
/** @deprecated DO NOT USE */ getUserLoginId(): string;
}
}
}
declare var DriveApp: GoogleAppsScript.Drive.DriveApp;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,303 @@
/// <reference path="google-apps-script.types.d.ts" />
/// <reference path="google-apps-script.base.d.ts" />
declare namespace GoogleAppsScript {
namespace Gmail {
/**
* Provides access to Gmail threads, messages, and labels.
*/
interface GmailApp {
createDraft(recipient: string, subject: string, body: string): GmailDraft;
createDraft(recipient: string, subject: string, body: string, options: GmailAdvancedOptions): GmailDraft;
createLabel(name: string): GmailLabel;
deleteLabel(label: GmailLabel): GmailApp;
getAliases(): string[];
getChatThreads(): GmailThread[];
getChatThreads(start: Integer, max: Integer): GmailThread[];
getDraft(draftId: string): GmailDraft;
getDraftMessages(): GmailMessage[];
getDrafts(): GmailDraft[];
getInboxThreads(): GmailThread[];
getInboxThreads(start: Integer, max: Integer): GmailThread[];
getInboxUnreadCount(): Integer;
getMessageById(id: string): GmailMessage;
getMessagesForThread(thread: GmailThread): GmailMessage[];
getMessagesForThreads(threads: GmailThread[]): GmailMessage[][];
getPriorityInboxThreads(): GmailThread[];
getPriorityInboxThreads(start: Integer, max: Integer): GmailThread[];
getPriorityInboxUnreadCount(): Integer;
getSpamThreads(): GmailThread[];
getSpamThreads(start: Integer, max: Integer): GmailThread[];
getSpamUnreadCount(): Integer;
getStarredThreads(): GmailThread[];
getStarredThreads(start: Integer, max: Integer): GmailThread[];
getStarredUnreadCount(): Integer;
getThreadById(id: string): GmailThread;
getTrashThreads(): GmailThread[];
getTrashThreads(start: Integer, max: Integer): GmailThread[];
getUserLabelByName(name: string): GmailLabel;
getUserLabels(): GmailLabel[];
markMessageRead(message: GmailMessage): GmailApp;
markMessageUnread(message: GmailMessage): GmailApp;
markMessagesRead(messages: GmailMessage[]): GmailApp;
markMessagesUnread(messages: GmailMessage[]): GmailApp;
markThreadImportant(thread: GmailThread): GmailApp;
markThreadRead(thread: GmailThread): GmailApp;
markThreadUnimportant(thread: GmailThread): GmailApp;
markThreadUnread(thread: GmailThread): GmailApp;
markThreadsImportant(threads: GmailThread[]): GmailApp;
markThreadsRead(threads: GmailThread[]): GmailApp;
markThreadsUnimportant(threads: GmailThread[]): GmailApp;
markThreadsUnread(threads: GmailThread[]): GmailApp;
moveMessageToTrash(message: GmailMessage): GmailApp;
moveMessagesToTrash(messages: GmailMessage[]): GmailApp;
moveThreadToArchive(thread: GmailThread): GmailApp;
moveThreadToInbox(thread: GmailThread): GmailApp;
moveThreadToSpam(thread: GmailThread): GmailApp;
moveThreadToTrash(thread: GmailThread): GmailApp;
moveThreadsToArchive(threads: GmailThread[]): GmailApp;
moveThreadsToInbox(threads: GmailThread[]): GmailApp;
moveThreadsToSpam(threads: GmailThread[]): GmailApp;
moveThreadsToTrash(threads: GmailThread[]): GmailApp;
refreshMessage(message: GmailMessage): GmailApp;
refreshMessages(messages: GmailMessage[]): GmailApp;
refreshThread(thread: GmailThread): GmailApp;
refreshThreads(threads: GmailThread[]): GmailApp;
search(query: string): GmailThread[];
search(query: string, start: Integer, max: Integer): GmailThread[];
sendEmail(recipient: string, subject: string, body: string): GmailApp;
sendEmail(recipient: string, subject: string, body: string, options: GmailAdvancedOptions): GmailApp;
setCurrentMessageAccessToken(accessToken: string): void;
starMessage(message: GmailMessage): GmailApp;
starMessages(messages: GmailMessage[]): GmailApp;
unstarMessage(message: GmailMessage): GmailApp;
unstarMessages(messages: GmailMessage[]): GmailApp;
}
/**
* An attachment from Gmail. This is a regular Blob except that it has an extra getSize() method that is faster than calling
* getBytes().length and does not count against the Gmail read quota.
*
* // Logs information about any attachments in the first 100 inbox threads.
* var threads = GmailApp.getInboxThreads(0, 100);
* var msgs = GmailApp.getMessagesForThreads(threads);
* for (var i = 0 ; i < msgs.length; i++) {
* for (var j = 0; j < msgs[i].length; j++) {
* var attachments = msgs[i][j].getAttachments();
* for (var k = 0; k < attachments.length; k++) {
* Logger.log('Message "%s" contains the attachment "%s" (%s bytes)',
* msgs[i][j].getSubject(), attachments[k].getName(), attachments[k].getSize());
* }
* }
* }
*/
interface GmailAttachment {
copyBlob(): Base.Blob;
getAs(contentType: string): Base.Blob;
getBytes(): Byte[];
getContentType(): string;
getDataAsString(): string;
getDataAsString(charset: string): string;
getHash(): string;
getName(): string;
getSize(): Integer;
isGoogleType(): boolean;
setBytes(data: Byte[]): Base.Blob;
setContentType(contentType: string): Base.Blob;
setContentTypeFromExtension(): Base.Blob;
setDataFromString(string: string): Base.Blob;
setDataFromString(string: string, charset: string): Base.Blob;
setName(name: string): Base.Blob;
/** @deprecated DO NOT USE */ getAllBlobs(): Base.Blob[];
}
/**
* A user-created draft message in a user's Gmail account.
*/
interface GmailDraft {
/**
* Deletes this draft message.
*/
deleteDraft(): void;
/**
* Gets the ID of this draft message.
*/
getId(): string;
/**
* Returns a GmailMessage representing this draft.
*/
getMessage(): GmailMessage;
/**
* Returns the ID of the `GmailMessage` representing this draft.
*/
getMessageId(): string;
/**
* Sends this draft email message.
*/
send(): GmailMessage;
/**
* Replaces the contents of this draft message.
*/
update(recipient: string, subject: string, body: string): GmailDraft;
/**
* Replaces the contents of this draft message using optional arguments.
*/
update(recipient: string, subject: string, body: string, options: GmailAdvancedOptions): GmailDraft;
}
/**
* Options for a Gmail draft.
*/
interface GmailAdvancedOptions {
/**
* An array of files to send with the email.
*/
attachments?: Base.BlobSource[] | undefined;
/**
* A comma-separated list of email addresses to BCC.
*/
bcc?: string | undefined;
/**
* A comma-separated list of email addresses to CC.
*/
cc?: string | undefined;
/**
* The address that the email should be sent from, which must be one of the values returned by `GmailApp.getAliases()`.
*/
from?: string | undefined;
/**
* If set, devices capable of rendering HTML will use it instead of the required body argument; you can add an optional `inlineImages` field in HTML body if you have inlined images for your email.
*/
htmlBody?: string | undefined;
/**
* A JavaScript object containing a mapping from image key (`String`) to image data (`BlobSource`) ; this assumes that the `htmlBody` parameter is used and contains references to these images in the format `<img src="cid:imageKey" />`.
*/
inlineImages?: { [imageKey: string]: Base.BlobSource } | undefined;
/**
* The name of the sender of the email (default: the user's name).
*/
name?: string | undefined;
/**
* True if the email should be sent from a generic no-reply email address to discourage recipients from responding to emails; this option is only possible for Google Workspace accounts, not Gmail users.
*/
noReply?: boolean | undefined;
/**
* An email address to use as the default reply-to address (default: the user's email address).
*/
replyTo?: string | undefined;
}
/** alias to GmailAdvancedOptions */
type GmailDraftOptions = GmailAdvancedOptions;
/**
* Options for a Gmail Attachments.
*/
interface GmailAttachmentOptions {
/**
* If the returned array of Blob attachments should include inline images.
*/
includeInlineImages?: boolean | undefined;
/**
* If the returned array of Blob attachments should include regular (non-inline) attachments.
*/
includeAttachments?: boolean | undefined;
/**
* A comma-separated list of email addresses to BCC.
*/
}
/**
* A user-created label in a user's Gmail account.
*/
interface GmailLabel {
addToThread(thread: GmailThread): GmailLabel;
addToThreads(threads: GmailThread[]): GmailLabel;
deleteLabel(): void;
getName(): string;
getThreads(): GmailThread[];
getThreads(start: Integer, max: Integer): GmailThread[];
getUnreadCount(): Integer;
removeFromThread(thread: GmailThread): GmailLabel;
removeFromThreads(threads: GmailThread[]): GmailLabel;
}
/**
* A message in a user's Gmail account.
*/
interface GmailMessage {
createDraftReply(body: string): GmailDraft;
createDraftReply(body: string, options: GmailAdvancedOptions): GmailDraft;
createDraftReplyAll(body: string): GmailDraft;
createDraftReplyAll(body: string, options: GmailAdvancedOptions): GmailDraft;
forward(recipient: string): GmailMessage;
forward(recipient: string, options: GmailAdvancedOptions): GmailMessage;
getAttachments(): GmailAttachment[];
getAttachments(options: GmailAttachmentOptions): GmailAttachment[];
getBcc(): string;
getBody(): string;
getCc(): string;
getDate(): Base.Date;
getFrom(): string;
getHeader(name: string): string;
getId(): string;
getPlainBody(): string;
getRawContent(): string;
getReplyTo(): string;
getSubject(): string;
getThread(): GmailThread;
getTo(): string;
isDraft(): boolean;
isInChats(): boolean;
isInInbox(): boolean;
isInPriorityInbox(): boolean;
isInTrash(): boolean;
isStarred(): boolean;
isUnread(): boolean;
markRead(): GmailMessage;
markUnread(): GmailMessage;
moveToTrash(): GmailMessage;
refresh(): GmailMessage;
reply(body: string): GmailMessage;
reply(body: string, options: GmailAdvancedOptions): GmailMessage;
replyAll(body: string): GmailMessage;
replyAll(body: string, options: GmailAdvancedOptions): GmailMessage;
star(): GmailMessage;
unstar(): GmailMessage;
}
/**
* A thread in a user's Gmail account.
*/
interface GmailThread {
addLabel(label: GmailLabel): GmailThread;
createDraftReply(body: string): GmailDraft;
createDraftReply(body: string, options: GmailAdvancedOptions): GmailDraft;
createDraftReplyAll(body: string): GmailDraft;
createDraftReplyAll(body: string, options: GmailAdvancedOptions): GmailDraft;
getFirstMessageSubject(): string;
getId(): string;
getLabels(): GmailLabel[];
getLastMessageDate(): Base.Date;
getMessageCount(): Integer;
getMessages(): GmailMessage[];
getPermalink(): string;
hasStarredMessages(): boolean;
isImportant(): boolean;
isInChats(): boolean;
isInInbox(): boolean;
isInPriorityInbox(): boolean;
isInSpam(): boolean;
isInTrash(): boolean;
isUnread(): boolean;
markImportant(): GmailThread;
markRead(): GmailThread;
markUnimportant(): GmailThread;
markUnread(): GmailThread;
moveToArchive(): GmailThread;
moveToInbox(): GmailThread;
moveToSpam(): GmailThread;
moveToTrash(): GmailThread;
refresh(): GmailThread;
removeLabel(label: GmailLabel): GmailThread;
reply(body: string): GmailThread;
reply(body: string, options: GmailAdvancedOptions): GmailThread;
replyAll(body: string): GmailThread;
replyAll(body: string, options: GmailAdvancedOptions): GmailThread;
}
}
}
declare var GmailApp: GoogleAppsScript.Gmail.GmailApp;

View File

@ -0,0 +1,66 @@
/// <reference path="google-apps-script.types.d.ts" />
/// <reference path="google-apps-script.base.d.ts" />
declare namespace GoogleAppsScript {
namespace Groups {
/**
* A group object whose members and those members' roles within the group can be queried.
*
* Here's an example which shows the members of a group. Before running it, replace the email
* address of the group with that of one on your domain.
*
* function listGroupMembers() {
* var group = GroupsApp.getGroupByEmail("example@googlegroups.com");
* var str = group.getEmail() + ': ';
* var users = group.getUsers();
* for (var i = 0; i < users.length; i++) {
* var user = users[i];
* str = str + user.getEmail() + ", ";
* }
* Logger.log(str);
* }
*/
interface Group {
getEmail(): string;
getGroups(): Group[];
getRole(email: string): Role;
getRole(user: Base.User): Role;
getRoles(users: Base.User[]): Role[];
getUsers(): Base.User[];
hasGroup(group: Group): boolean;
hasGroup(email: string): boolean;
hasUser(email: string): boolean;
hasUser(user: Base.User): boolean;
}
/**
* This class provides access to Google Groups information. It can be used to query information such
* as a group's email address, or the list of groups in which the user is a direct member.
*
* Here's an example that shows how many groups the current user is a member of:
*
* var groups = GroupsApp.getGroups();
* Logger.log('You belong to ' + groups.length + ' groups.');
*/
interface GroupsApp {
Role: typeof Role;
getGroupByEmail(email: string): Group;
getGroups(): Group[];
}
/**
* Possible roles of a user within a group, such as owner or ordinary member. Users subscribed to a
* group have exactly one role within the context of that group.
* See also
*
* Group.getRole(email)
*/
enum Role {
OWNER,
MANAGER,
MEMBER,
INVITED,
PENDING,
}
}
}
declare var GroupsApp: GoogleAppsScript.Groups.GroupsApp;

View File

@ -0,0 +1,135 @@
/// <reference path="google-apps-script.types.d.ts" />
/// <reference path="google-apps-script.base.d.ts" />
declare namespace GoogleAppsScript {
namespace HTML {
/**
* An HtmlOutput object that can be served from a script. Due to security considerations,
* scripts cannot directly return HTML to a browser. Instead, they must sanitize it so that it
* cannot perform malicious actions. You can return sanitized HTML like this:
*
* function doGet() {
* return HtmlService.createHtmlOutput('<b>Hello, world!</b>');
* }
*
* HtmlOutput
* iframe
* sandboxing
* guide to restrictions in HTML service
*/
interface HtmlOutput {
addMetaTag(name: string, content: string): HtmlOutput;
append(addedContent: string): HtmlOutput;
appendUntrusted(addedContent: string): HtmlOutput;
asTemplate(): HtmlTemplate;
clear(): HtmlOutput;
getAs(contentType: string): Base.Blob;
getBlob(): Base.Blob;
getContent(): string;
getFaviconUrl(): string;
getHeight(): Integer;
getMetaTags(): HtmlOutputMetaTag[];
getTitle(): string;
getWidth(): Integer;
setContent(content: string): HtmlOutput;
setFaviconUrl(iconUrl: string): HtmlOutput;
setHeight(height: Integer): HtmlOutput;
setSandboxMode(mode: SandboxMode): HtmlOutput;
setTitle(title: string): HtmlOutput;
setWidth(width: Integer): HtmlOutput;
setXFrameOptionsMode(mode: XFrameOptionsMode): HtmlOutput;
}
/**
* An object that represents a meta tag added to the page by calling HtmlOutput.addMetaTag(name, content).
*
* var output = HtmlService.createHtmlOutput('<b>Hello, world!</b>');
* output.addMetaTag('viewport', 'width=device-width, initial-scale=1');
*
* var tags = output.getMetaTags();
* Logger.log('<meta name="%s" content="%s"/>', tags[0].getName(), tags[0].getContent());
*/
interface HtmlOutputMetaTag {
getContent(): string;
getName(): string;
}
/**
* Service for returning HTML and other text content from a script.
*
* Due to security considerations, scripts cannot directly return content to a browser. Instead,
* they must sanitize the HTML so that it cannot perform malicious actions. See the description of
* HtmlOutput for what limitations this implies on what can be returned.
*/
interface HtmlService {
SandboxMode: typeof SandboxMode;
XFrameOptionsMode: typeof XFrameOptionsMode;
createHtmlOutput(): HtmlOutput;
createHtmlOutput(blob: Base.BlobSource): HtmlOutput;
createHtmlOutput(html: string): HtmlOutput;
createHtmlOutputFromFile(filename: string): HtmlOutput;
createTemplate(blob: Base.BlobSource): HtmlTemplate;
createTemplate(html: string): HtmlTemplate;
createTemplateFromFile(filename: string): HtmlTemplate;
getUserAgent(): string;
}
/**
* A template object for dynamically constructing HTML. For more information, see the guide to templates.
*/
interface HtmlTemplate {
evaluate(): HtmlOutput;
getCode(): string;
getCodeWithComments(): string;
getRawContent(): string;
[propName: string]: any;
}
/**
* An enum representing the sandbox modes that can be used for client-side HtmlService
* scripts. These values can be accessed from HtmlService.SandboxMode, and set by calling
* HtmlOutput.setSandboxMode(mode).
*
* The NATIVE and EMULATED modes were deprecated on October 13, 2015 and both are now sunset. Only
* IFRAME mode is now supported.
*
* To protect users from being served malicious HTML or JavaScript, client-side code served from
* HTML service executes in a security sandbox that imposes restrictions on the code. The method
* HtmlOutput.setSandboxMode(mode) previously allowed script authors to choose
* between different versions of the sandbox, but now has no effect. For more information, see the
* guide to restrictions in HTML service.
*
* The IFRAME mode imposes many fewer restrictions than the other sandbox modes and runs
* fastest, but does not work at all in certain older browsers, including Internet Explorer 9. The
* sandbox mode can also be read in a client-side script by inspecting google.script.sandbox.mode. Note that this property returns the actual mode on the client, which
* may differ from the mode requested on the server if the requested mode is not supported in the
* user's browser.
*
* <!-- Read the sandbox mode (in a client-side script). -->
* <script>
* alert(google.script.sandbox.mode);
* </script>
*/
enum SandboxMode {
EMULATED,
IFRAME,
NATIVE,
}
/**
* An enum representing the X-Frame-Options modes that can be used for client-side HtmlService scripts. These values can be accessed from HtmlService.XFrameOptionsMode,
* and set by calling HtmlOutput.setXFrameOptionsMode(mode).
*
* Setting XFrameOptionsMode.ALLOWALL will let any site iframe the page, so the developer
* should implement their own protection against clickjacking.
*
* If a script does not set an X-Frame-Options mode, Apps Script uses DEFAULT
* mode as the default.
*
* // Serve HTML with no X-Frame-Options header (in Apps Script server-side code).
* var output = HtmlService.createHtmlOutput('<b>Hello, world!</b>');
* output.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL);
*/
enum XFrameOptionsMode {
ALLOWALL,
DEFAULT,
}
}
}
declare var HtmlService: GoogleAppsScript.HTML.HtmlService;

View File

@ -0,0 +1,973 @@
/// <reference path="google-apps-script.types.d.ts" />
/// <reference path="google-apps-script.base.d.ts" />
declare namespace GoogleAppsScript {
namespace JDBC {
/** JdbcAdvancedParameters */
interface CloudSqlAdvancedParameters {
/** connection timeout in seconds */
connectTimeoutSeconds?: Integer | undefined;
/** the database to connect to */
database?: string | undefined;
/** the name of a Google SQL Service instance */
instance?: string | undefined;
/** the user's password */
password?: string | undefined;
/** query timeout in seconds */
queryTimeoutSeconds?: Integer | undefined;
/** the username to pass to the database */
user?: string | undefined;
}
/** JdbcAdvancedParameters */
interface ConnectionAdvancedParameters {
/** the database to connect to */
databaseName?: string | undefined;
/** the user's password */
password?: string | undefined;
/** whether or not the connection should comply with JDBC rules when converting time zones. The default is false. */
useJDBCCompliantTimeZoneShift?: boolean | undefined;
/** the username to pass to the database */
user?: string | undefined;
/** the server's SSL certificate */
_serverSslCertificate?: string | undefined;
/** the client's SSL certificate */
_clientSslCertificate?: string | undefined;
/** the client's SSL key */
_clientSslKey?: string | undefined;
}
/**
* The JDBC service allows scripts to connect to Google Cloud SQL, MySQL,
* Microsoft SQL Server, and Oracle databases. For more information, see the guide to JDBC.
*/
interface Jdbc {
getCloudSqlConnection(url: string): JdbcConnection;
getCloudSqlConnection(url: string, info: CloudSqlAdvancedParameters): JdbcConnection;
getCloudSqlConnection(url: string, userName: string, password: string): JdbcConnection;
getConnection(url: string): JdbcConnection;
getConnection(url: string, info: ConnectionAdvancedParameters): JdbcConnection;
getConnection(url: string, userName: string, password: string): JdbcConnection;
newDate(milliseconds: Integer): JdbcDate;
newTime(milliseconds: Integer): JdbcTime;
newTimestamp(milliseconds: Integer): JdbcTimestamp;
parseDate(date: string): JdbcDate;
parseTime(time: string): JdbcTime;
parseTimestamp(timestamp: string): JdbcTimestamp;
}
/**
* A JDBC Array. For documentation of this class, see java.sql.Array
* .
*/
interface JdbcArray {
free(): void;
getArray(): any;
getArray(index: Integer, count: Integer): any;
getBaseType(): Integer;
getBaseTypeName(): string;
getResultSet(): JdbcResultSet;
getResultSet(index: Integer, count: Integer): JdbcResultSet;
}
/**
* A JDBC Blob. For documentation of this class, see java.sql.Blob
* .
*/
interface JdbcBlob {
free(): void;
getAppsScriptBlob(): Base.Blob;
getAs(contentType: string): Base.Blob;
getBytes(position: Integer, length: Integer): Byte[];
length(): Integer;
position(pattern: Byte[], start: Integer): Integer;
position(pattern: JdbcBlob, start: Integer): Integer;
setBytes(position: Integer, blobSource: Base.BlobSource): Integer;
setBytes(position: Integer, blobSource: Base.BlobSource, offset: Integer, length: Integer): Integer;
setBytes(position: Integer, bytes: Byte[]): Integer;
setBytes(position: Integer, bytes: Byte[], offset: Integer, length: Integer): Integer;
truncate(length: Integer): void;
}
/**
* A JDBC CallableStatement. For documentation of this class, see
* java.sql.CallableStatement.
*/
interface JdbcCallableStatement {
addBatch(): void;
addBatch(sql: string): void;
cancel(): void;
clearBatch(): void;
clearParameters(): void;
clearWarnings(): void;
close(): void;
execute(): boolean;
execute(sql: string): boolean;
execute(sql: string, autoGeneratedKeys: Integer, sql_: string, columnIndexes: Integer[]): boolean;
execute(sql: string, autoGeneratedKeys: Integer, sql_: string, columnIndexes: Integer[]): boolean;
execute(sql: string, columnNames: string[]): boolean;
executeBatch(): Integer[];
executeQuery(): JdbcResultSet;
executeQuery(sql: string): JdbcResultSet;
executeUpdate(): Integer;
executeUpdate(sql: string): Integer;
executeUpdate(sql: string, autoGeneratedKeys: Integer, sql_: string, columnIndexes: Integer[]): Integer;
executeUpdate(sql: string, autoGeneratedKeys: Integer, sql_: string, columnIndexes: Integer[]): Integer;
executeUpdate(sql: string, columnNames: string[]): Integer;
getArray(parameterIndex: Integer): JdbcArray;
getArray(parameterName: string): JdbcArray;
getBigDecimal(parameterIndex: Integer): BigNumber;
getBigDecimal(parameterName: string): BigNumber;
getBlob(parameterIndex: Integer): JdbcBlob;
getBlob(parameterName: string): JdbcBlob;
getBoolean(parameterIndex: Integer): boolean;
getBoolean(parameterName: string): boolean;
getByte(parameterIndex: Integer): Byte;
getByte(parameterName: string): Byte;
getBytes(parameterIndex: Integer): Byte[];
getBytes(parameterName: string): Byte[];
getClob(parameterIndex: Integer): JdbcClob;
getClob(parameterName: string): JdbcClob;
getConnection(): JdbcConnection;
getDate(parameterIndex: Integer): JdbcDate;
getDate(parameterIndex: Integer, timeZone: string): JdbcDate;
getDate(parameterName: string): JdbcDate;
getDate(parameterName: string, timeZone: string): JdbcDate;
getDouble(parameterIndex: Integer): number;
getDouble(parameterName: string): number;
getFetchDirection(): Integer;
getFetchSize(): Integer;
getFloat(parameterIndex: Integer): number;
getFloat(parameterName: string): number;
getGeneratedKeys(): JdbcResultSet;
getInt(parameterIndex: Integer): Integer;
getInt(parameterName: string): Integer;
getLong(parameterIndex: Integer): Integer;
getLong(parameterName: string): Integer;
getMaxFieldSize(): Integer;
getMaxRows(): Integer;
getMetaData(): JdbcResultSetMetaData;
getMoreResults(): boolean;
getMoreResults(current: Integer): boolean;
getNClob(parameterIndex: Integer): JdbcClob;
getNClob(parameterName: string): JdbcClob;
getNString(parameterIndex: Integer): string;
getNString(parameterName: string): string;
getObject(parameterIndex: Integer): any;
getObject(parameterName: string): any;
getParameterMetaData(): JdbcParameterMetaData;
getQueryTimeout(): Integer;
getRef(parameterIndex: Integer): JdbcRef;
getRef(parameterName: string): JdbcRef;
getResultSet(): JdbcResultSet;
getResultSetConcurrency(): Integer;
getResultSetHoldability(): Integer;
getResultSetType(): Integer;
getRowId(parameterIndex: Integer): JdbcRowId;
getRowId(parameterName: string): JdbcRowId;
getSQLXML(parameterIndex: Integer): JdbcSQLXML;
getSQLXML(parameterName: string): JdbcSQLXML;
getShort(parameterIndex: Integer): Integer;
getShort(parameterName: string): Integer;
getString(parameterIndex: Integer): string;
getString(parameterName: string): string;
getTime(parameterIndex: Integer): JdbcTime;
getTime(parameterIndex: Integer, timeZone: string): JdbcTime;
getTime(parameterName: string): JdbcTime;
getTime(parameterName: string, timeZone: string): JdbcTime;
getTimestamp(parameterIndex: Integer): JdbcTimestamp;
getTimestamp(parameterIndex: Integer, timeZone: string): JdbcTimestamp;
getTimestamp(parameterName: string): JdbcTimestamp;
getTimestamp(parameterName: string, timeZone: string): JdbcTimestamp;
getURL(parameterIndex: Integer): string;
getURL(parameterName: string): string;
getUpdateCount(): Integer;
getWarnings(): string[];
isClosed(): boolean;
isPoolable(): boolean;
registerOutParameter(parameterIndex: Integer, sqlType: Integer): void;
registerOutParameter(parameterIndex: Integer, sqlType: Integer, scale: Integer): void;
registerOutParameter(parameterIndex: Integer, sqlType: Integer, typeName: string): void;
registerOutParameter(parameterName: string, sqlType: Integer): void;
registerOutParameter(parameterName: string, sqlType: Integer, scale: Integer): void;
registerOutParameter(parameterName: string, sqlType: Integer, typeName: string): void;
setArray(parameterIndex: Integer, x: JdbcArray): void;
setBigDecimal(parameterIndex: Integer, x: BigNumber): void;
setBigDecimal(parameterName: string, x: BigNumber): void;
setBlob(parameterIndex: Integer, x: JdbcBlob): void;
setBlob(parameterName: string, x: JdbcBlob): void;
setBoolean(parameterIndex: Integer, x: boolean): void;
setBoolean(parameterName: string, x: boolean): void;
setByte(parameterIndex: Integer, x: Byte): void;
setByte(parameterName: string, x: Byte): void;
setBytes(parameterIndex: Integer, x: Byte[]): void;
setBytes(parameterName: string, x: Byte[]): void;
setClob(parameterIndex: Integer, x: JdbcClob): void;
setClob(parameterName: string, x: JdbcClob): void;
setCursorName(name: string): void;
setDate(parameterIndex: Integer, x: JdbcDate): void;
setDate(parameterIndex: Integer, x: JdbcDate, timeZone: string): void;
setDate(parameterName: string, x: JdbcDate): void;
setDate(parameterName: string, x: JdbcDate, timeZone: string): void;
setDouble(parameterIndex: Integer, x: number): void;
setDouble(parameterName: string, x: number): void;
setEscapeProcessing(enable: boolean): void;
setFetchDirection(direction: Integer): void;
setFetchSize(rows: Integer): void;
setFloat(parameterIndex: Integer, x: number): void;
setFloat(parameterName: string, x: number): void;
setInt(parameterIndex: Integer, x: Integer): void;
setInt(parameterName: string, x: Integer): void;
setLong(parameterIndex: Integer, x: Integer): void;
setLong(parameterName: string, x: Integer): void;
setMaxFieldSize(max: Integer): void;
setMaxRows(max: Integer): void;
setNClob(parameterIndex: Integer, x: JdbcClob): void;
setNClob(parameterName: string, value: JdbcClob): void;
setNString(parameterIndex: Integer, x: string): void;
setNString(parameterName: string, value: string): void;
setNull(parameterIndex: Integer, sqlType: Integer): void;
setNull(parameterIndex: Integer, sqlType: Integer, typeName: string): void;
setNull(parameterName: string, sqlType: Integer): void;
setNull(parameterName: string, sqlType: Integer, typeName: string): void;
setObject(index: Integer, x: any): void;
setObject(parameterIndex: Integer, x: any, targetSqlType: Integer): void;
setObject(parameterIndex: Integer, x: any, targetSqlType: Integer, scaleOrLength: Integer): void;
setObject(parameterName: string, x: any): void;
setObject(parameterName: string, x: any, targetSqlType: Integer): void;
setObject(parameterName: string, x: any, targetSqlType: Integer, scale: Integer): void;
setPoolable(poolable: boolean): void;
setQueryTimeout(seconds: Integer): void;
setRef(parameterIndex: Integer, x: JdbcRef): void;
setRowId(parameterIndex: Integer, x: JdbcRowId): void;
setRowId(parameterName: string, x: JdbcRowId): void;
setSQLXML(parameterIndex: Integer, x: JdbcSQLXML): void;
setSQLXML(parameterName: string, xmlObject: JdbcSQLXML): void;
setShort(parameterIndex: Integer, x: Integer): void;
setShort(parameterName: string, x: Integer): void;
setString(parameterIndex: Integer, x: string): void;
setString(parameterName: string, x: string): void;
setTime(parameterIndex: Integer, x: JdbcTime): void;
setTime(parameterIndex: Integer, x: JdbcTime, timeZone: string): void;
setTime(parameterName: string, x: JdbcTime): void;
setTime(parameterName: string, x: JdbcTime, timeZone: string): void;
setTimestamp(parameterIndex: Integer, x: JdbcTimestamp): void;
setTimestamp(parameterIndex: Integer, x: JdbcTimestamp, timeZone: string): void;
setTimestamp(parameterName: string, x: JdbcTimestamp): void;
setTimestamp(parameterName: string, x: JdbcTimestamp, timeZone: string): void;
setURL(parameterIndex: Integer, x: string): void;
setURL(parameterName: string, val: string): void;
wasNull(): boolean;
}
/**
* A JDBC Clob. For documentation of this class, see java.sql.Clob
* .
*/
interface JdbcClob {
free(): void;
getAppsScriptBlob(): Base.Blob;
getAs(contentType: string): Base.Blob;
getSubString(position: Integer, length: Integer): string;
length(): Integer;
position(search: JdbcClob, start: Integer): Integer;
position(search: string, start: Integer): Integer;
setString(position: Integer, blobSource: Base.BlobSource): Integer;
setString(position: Integer, blobSource: Base.BlobSource, offset: Integer, len: Integer): Integer;
setString(position: Integer, value: string): Integer;
setString(position: Integer, value: string, offset: Integer, len: Integer): Integer;
truncate(length: Integer): void;
}
/**
* A JDBC Connection. For documentation of this class, see
* java.sql.Connection.
*/
interface JdbcConnection {
clearWarnings(): void;
close(): void;
commit(): void;
createArrayOf(typeName: string, elements: any[]): JdbcArray;
createBlob(): JdbcBlob;
createClob(): JdbcClob;
createNClob(): JdbcClob;
createSQLXML(): JdbcSQLXML;
createStatement(): JdbcStatement;
createStatement(resultSetType: Integer, resultSetConcurrency: Integer): JdbcStatement;
createStatement(
resultSetType: Integer,
resultSetConcurrency: Integer,
resultSetHoldability: Integer,
): JdbcStatement;
createStruct(typeName: string, attributes: any[]): JdbcStruct;
getAutoCommit(): boolean;
getCatalog(): string;
getHoldability(): Integer;
getMetaData(): JdbcDatabaseMetaData;
getTransactionIsolation(): Integer;
getWarnings(): string[];
isClosed(): boolean;
isReadOnly(): boolean;
isValid(timeout: Integer): boolean;
nativeSQL(sql: string): string;
prepareCall(sql: string): JdbcCallableStatement;
prepareCall(sql: string, resultSetType: Integer, resultSetConcurrency: Integer): JdbcCallableStatement;
prepareCall(
sql: string,
resultSetType: Integer,
resultSetConcurrency: Integer,
resultSetHoldability: Integer,
): JdbcCallableStatement;
prepareStatement(sql: string): JdbcPreparedStatement;
prepareStatement(sql: string, autoGeneratedKeys: Integer): JdbcPreparedStatement;
prepareStatement(sql: string, resultSetType: Integer, resultSetConcurrency: Integer): JdbcPreparedStatement;
prepareStatement(
sql: string,
resultSetType: Integer,
resultSetConcurrency: Integer,
resultSetHoldability: Integer,
): JdbcPreparedStatement;
prepareStatementByIndex(sql: string, indices: Integer[]): JdbcPreparedStatement;
prepareStatementByName(sql: string, columnNames: string[]): JdbcPreparedStatement;
releaseSavepoint(savepoint: JdbcSavepoint): void;
rollback(): void;
rollback(savepoint: JdbcSavepoint): void;
setAutoCommit(autoCommit: boolean): void;
setCatalog(catalog: string): void;
setHoldability(holdability: Integer): void;
setReadOnly(readOnly: boolean): void;
setSavepoint(): JdbcSavepoint;
setSavepoint(name: string): JdbcSavepoint;
setTransactionIsolation(level: Integer): void;
}
/**
* A JDBC database metadata object. For documentation of this class, see
* java.sql.DatabaseMetaData.
*/
interface JdbcDatabaseMetaData {
allProceduresAreCallable(): boolean;
allTablesAreSelectable(): boolean;
autoCommitFailureClosesAllResultSets(): boolean;
dataDefinitionCausesTransactionCommit(): boolean;
dataDefinitionIgnoredInTransactions(): boolean;
deletesAreDetected(type: Integer): boolean;
doesMaxRowSizeIncludeBlobs(): boolean;
getAttributes(
catalog: string,
schemaPattern: string,
typeNamePattern: string,
attributeNamePattern: string,
): JdbcResultSet;
getBestRowIdentifier(
catalog: string,
schema: string,
table: string,
scope: Integer,
nullable: boolean,
): JdbcResultSet;
getCatalogSeparator(): string;
getCatalogTerm(): string;
getCatalogs(): JdbcResultSet;
getClientInfoProperties(): JdbcResultSet;
getColumnPrivileges(
catalog: string,
schema: string,
table: string,
columnNamePattern: string,
): JdbcResultSet;
getColumns(
catalog: string,
schemaPattern: string,
tableNamePattern: string,
columnNamePattern: string,
): JdbcResultSet;
getConnection(): JdbcConnection;
getCrossReference(
parentCatalog: string,
parentSchema: string,
parentTable: string,
foreignCatalog: string,
foreignSchema: string,
foreignTable: string,
): JdbcResultSet;
getDatabaseMajorVersion(): Integer;
getDatabaseMinorVersion(): Integer;
getDatabaseProductName(): string;
getDatabaseProductVersion(): string;
getDefaultTransactionIsolation(): Integer;
getDriverMajorVersion(): Integer;
getDriverMinorVersion(): Integer;
getDriverName(): string;
getDriverVersion(): string;
getExportedKeys(catalog: string, schema: string, table: string): JdbcResultSet;
getExtraNameCharacters(): string;
getFunctionColumns(
catalog: string,
schemaPattern: string,
functionNamePattern: string,
columnNamePattern: string,
): JdbcResultSet;
getFunctions(catalog: string, schemaPattern: string, functionNamePattern: string): JdbcResultSet;
getIdentifierQuoteString(): string;
getImportedKeys(catalog: string, schema: string, table: string): JdbcResultSet;
getIndexInfo(
catalog: string,
schema: string,
table: string,
unique: boolean,
approximate: boolean,
): JdbcResultSet;
getJDBCMajorVersion(): Integer;
getJDBCMinorVersion(): Integer;
getMaxBinaryLiteralLength(): Integer;
getMaxCatalogNameLength(): Integer;
getMaxCharLiteralLength(): Integer;
getMaxColumnNameLength(): Integer;
getMaxColumnsInGroupBy(): Integer;
getMaxColumnsInIndex(): Integer;
getMaxColumnsInOrderBy(): Integer;
getMaxColumnsInSelect(): Integer;
getMaxColumnsInTable(): Integer;
getMaxConnections(): Integer;
getMaxCursorNameLength(): Integer;
getMaxIndexLength(): Integer;
getMaxProcedureNameLength(): Integer;
getMaxRowSize(): Integer;
getMaxSchemaNameLength(): Integer;
getMaxStatementLength(): Integer;
getMaxStatements(): Integer;
getMaxTableNameLength(): Integer;
getMaxTablesInSelect(): Integer;
getMaxUserNameLength(): Integer;
getNumericFunctions(): string;
getPrimaryKeys(catalog: string, schema: string, table: string): JdbcResultSet;
getProcedureColumns(
catalog: string,
schemaPattern: string,
procedureNamePattern: string,
columnNamePattern: string,
): JdbcResultSet;
getProcedureTerm(): string;
getProcedures(catalog: string, schemaPattern: string, procedureNamePattern: string): JdbcResultSet;
getResultSetHoldability(): Integer;
getRowIdLifetime(): Integer;
getSQLKeywords(): string;
getSQLStateType(): Integer;
getSchemaTerm(): string;
getSchemas(): JdbcResultSet;
getSchemas(catalog: string, schemaPattern: string): JdbcResultSet;
getSearchStringEscape(): string;
getStringFunctions(): string;
getSuperTables(catalog: string, schemaPattern: string, tableNamePattern: string): JdbcResultSet;
getSuperTypes(catalog: string, schemaPattern: string, typeNamePattern: string): JdbcResultSet;
getSystemFunctions(): string;
getTablePrivileges(catalog: string, schemaPattern: string, tableNamePattern: string): JdbcResultSet;
getTableTypes(): JdbcResultSet;
getTables(catalog: string, schemaPattern: string, tableNamePattern: string, types: string[]): JdbcResultSet;
getTimeDateFunctions(): string;
getTypeInfo(): JdbcResultSet;
getUDTs(catalog: string, schemaPattern: string, typeNamePattern: string, types: Integer[]): JdbcResultSet;
getURL(): string;
getUserName(): string;
getVersionColumns(catalog: string, schema: string, table: string): JdbcResultSet;
insertsAreDetected(type: Integer): boolean;
isCatalogAtStart(): boolean;
isReadOnly(): boolean;
locatorsUpdateCopy(): boolean;
nullPlusNonNullIsNull(): boolean;
nullsAreSortedAtEnd(): boolean;
nullsAreSortedAtStart(): boolean;
nullsAreSortedHigh(): boolean;
nullsAreSortedLow(): boolean;
othersDeletesAreVisible(type: Integer): boolean;
othersInsertsAreVisible(type: Integer): boolean;
othersUpdatesAreVisible(type: Integer): boolean;
ownDeletesAreVisible(type: Integer): boolean;
ownInsertsAreVisible(type: Integer): boolean;
ownUpdatesAreVisible(type: Integer): boolean;
storesLowerCaseIdentifiers(): boolean;
storesLowerCaseQuotedIdentifiers(): boolean;
storesMixedCaseIdentifiers(): boolean;
storesMixedCaseQuotedIdentifiers(): boolean;
storesUpperCaseIdentifiers(): boolean;
storesUpperCaseQuotedIdentifiers(): boolean;
supportsANSI92EntryLevelSQL(): boolean;
supportsANSI92FullSQL(): boolean;
supportsANSI92IntermediateSQL(): boolean;
supportsAlterTableWithAddColumn(): boolean;
supportsAlterTableWithDropColumn(): boolean;
supportsBatchUpdates(): boolean;
supportsCatalogsInDataManipulation(): boolean;
supportsCatalogsInIndexDefinitions(): boolean;
supportsCatalogsInPrivilegeDefinitions(): boolean;
supportsCatalogsInProcedureCalls(): boolean;
supportsCatalogsInTableDefinitions(): boolean;
supportsColumnAliasing(): boolean;
supportsConvert(): boolean;
supportsConvert(fromType: Integer, toType: Integer): boolean;
supportsCoreSQLGrammar(): boolean;
supportsCorrelatedSubqueries(): boolean;
supportsDataDefinitionAndDataManipulationTransactions(): boolean;
supportsDataManipulationTransactionsOnly(): boolean;
supportsDifferentTableCorrelationNames(): boolean;
supportsExpressionsInOrderBy(): boolean;
supportsExtendedSQLGrammar(): boolean;
supportsFullOuterJoins(): boolean;
supportsGetGeneratedKeys(): boolean;
supportsGroupBy(): boolean;
supportsGroupByBeyondSelect(): boolean;
supportsGroupByUnrelated(): boolean;
supportsIntegrityEnhancementFacility(): boolean;
supportsLikeEscapeClause(): boolean;
supportsLimitedOuterJoins(): boolean;
supportsMinimumSQLGrammar(): boolean;
supportsMixedCaseIdentifiers(): boolean;
supportsMixedCaseQuotedIdentifiers(): boolean;
supportsMultipleOpenResults(): boolean;
supportsMultipleResultSets(): boolean;
supportsMultipleTransactions(): boolean;
supportsNamedParameters(): boolean;
supportsNonNullableColumns(): boolean;
supportsOpenCursorsAcrossCommit(): boolean;
supportsOpenCursorsAcrossRollback(): boolean;
supportsOpenStatementsAcrossCommit(): boolean;
supportsOpenStatementsAcrossRollback(): boolean;
supportsOrderByUnrelated(): boolean;
supportsOuterJoins(): boolean;
supportsPositionedDelete(): boolean;
supportsPositionedUpdate(): boolean;
supportsResultSetConcurrency(type: Integer, concurrency: Integer): boolean;
supportsResultSetHoldability(holdability: Integer): boolean;
supportsResultSetType(type: Integer): boolean;
supportsSavepoints(): boolean;
supportsSchemasInDataManipulation(): boolean;
supportsSchemasInIndexDefinitions(): boolean;
supportsSchemasInPrivilegeDefinitions(): boolean;
supportsSchemasInProcedureCalls(): boolean;
supportsSchemasInTableDefinitions(): boolean;
supportsSelectForUpdate(): boolean;
supportsStatementPooling(): boolean;
supportsStoredFunctionsUsingCallSyntax(): boolean;
supportsStoredProcedures(): boolean;
supportsSubqueriesInComparisons(): boolean;
supportsSubqueriesInExists(): boolean;
supportsSubqueriesInIns(): boolean;
supportsSubqueriesInQuantifieds(): boolean;
supportsTableCorrelationNames(): boolean;
supportsTransactionIsolationLevel(level: Integer): boolean;
supportsTransactions(): boolean;
supportsUnion(): boolean;
supportsUnionAll(): boolean;
updatesAreDetected(type: Integer): boolean;
usesLocalFilePerTable(): boolean;
usesLocalFiles(): boolean;
}
/**
* A JDBC Date. For documentation of this class, see java.sql.Date
* .
*/
interface JdbcDate {
after(when: JdbcDate): boolean;
before(when: JdbcDate): boolean;
getDate(): Integer;
getMonth(): Integer;
getTime(): Integer;
getYear(): Integer;
setDate(date: Integer): void;
setMonth(month: Integer): void;
setTime(milliseconds: Integer): void;
setYear(year: Integer): void;
}
/**
* A JDBC ParameterMetaData. For documentation of this class, see
* java.sql.ParameterMetaData.
*/
interface JdbcParameterMetaData {
getParameterClassName(param: Integer): string;
getParameterCount(): Integer;
getParameterMode(param: Integer): Integer;
getParameterType(param: Integer): Integer;
getParameterTypeName(param: Integer): string;
getPrecision(param: Integer): Integer;
getScale(param: Integer): Integer;
isNullable(param: Integer): Integer;
isSigned(param: Integer): boolean;
}
/**
* A JDBC PreparedStatement. For documentation of this class, see
* java.sql.PreparedStatement.
*/
interface JdbcPreparedStatement {
addBatch(): void;
addBatch(sql: string): void;
cancel(): void;
clearBatch(): void;
clearParameters(): void;
clearWarnings(): void;
close(): void;
execute(): boolean;
execute(sql: string): boolean;
execute(sql: string, autoGeneratedKeys: Integer, sql_: string, columnIndexes: Integer[]): boolean;
execute(sql: string, autoGeneratedKeys: Integer, sql_: string, columnIndexes: Integer[]): boolean;
execute(sql: string, columnNames: string[]): boolean;
executeBatch(): Integer[];
executeQuery(): JdbcResultSet;
executeQuery(sql: string): JdbcResultSet;
executeUpdate(): Integer;
executeUpdate(sql: string): Integer;
executeUpdate(sql: string, autoGeneratedKeys: Integer, sql_: string, columnIndexes: Integer[]): Integer;
executeUpdate(sql: string, autoGeneratedKeys: Integer, sql_: string, columnIndexes: Integer[]): Integer;
executeUpdate(sql: string, columnNames: string[]): Integer;
getConnection(): JdbcConnection;
getFetchDirection(): Integer;
getFetchSize(): Integer;
getGeneratedKeys(): JdbcResultSet;
getMaxFieldSize(): Integer;
getMaxRows(): Integer;
getMetaData(): JdbcResultSetMetaData;
getMoreResults(): boolean;
getMoreResults(current: Integer): boolean;
getParameterMetaData(): JdbcParameterMetaData;
getQueryTimeout(): Integer;
getResultSet(): JdbcResultSet;
getResultSetConcurrency(): Integer;
getResultSetHoldability(): Integer;
getResultSetType(): Integer;
getUpdateCount(): Integer;
getWarnings(): string[];
isClosed(): boolean;
isPoolable(): boolean;
setArray(parameterIndex: Integer, x: JdbcArray): void;
setBigDecimal(parameterIndex: Integer, x: BigNumber): void;
setBlob(parameterIndex: Integer, x: JdbcBlob): void;
setBoolean(parameterIndex: Integer, x: boolean): void;
setByte(parameterIndex: Integer, x: Byte): void;
setBytes(parameterIndex: Integer, x: Byte[]): void;
setClob(parameterIndex: Integer, x: JdbcClob): void;
setCursorName(name: string): void;
setDate(parameterIndex: Integer, x: JdbcDate): void;
setDate(parameterIndex: Integer, x: JdbcDate, timeZone: string): void;
setDouble(parameterIndex: Integer, x: number): void;
setEscapeProcessing(enable: boolean): void;
setFetchDirection(direction: Integer): void;
setFetchSize(rows: Integer): void;
setFloat(parameterIndex: Integer, x: number): void;
setInt(parameterIndex: Integer, x: Integer): void;
setLong(parameterIndex: Integer, x: Integer): void;
setMaxFieldSize(max: Integer): void;
setMaxRows(max: Integer): void;
setNClob(parameterIndex: Integer, x: JdbcClob): void;
setNString(parameterIndex: Integer, x: string): void;
setNull(parameterIndex: Integer, sqlType: Integer): void;
setNull(parameterIndex: Integer, sqlType: Integer, typeName: string): void;
setObject(index: Integer, x: any): void;
setObject(parameterIndex: Integer, x: any, targetSqlType: Integer): void;
setObject(parameterIndex: Integer, x: any, targetSqlType: Integer, scaleOrLength: Integer): void;
setPoolable(poolable: boolean): void;
setQueryTimeout(seconds: Integer): void;
setRef(parameterIndex: Integer, x: JdbcRef): void;
setRowId(parameterIndex: Integer, x: JdbcRowId): void;
setSQLXML(parameterIndex: Integer, x: JdbcSQLXML): void;
setShort(parameterIndex: Integer, x: Integer): void;
setString(parameterIndex: Integer, x: string): void;
setTime(parameterIndex: Integer, x: JdbcTime): void;
setTime(parameterIndex: Integer, x: JdbcTime, timeZone: string): void;
setTimestamp(parameterIndex: Integer, x: JdbcTimestamp): void;
setTimestamp(parameterIndex: Integer, x: JdbcTimestamp, timeZone: string): void;
setURL(parameterIndex: Integer, x: string): void;
}
/**
* A JDBC Ref. For documentation of this class, see java.sql.Ref.
*/
interface JdbcRef {
getBaseTypeName(): string;
getObject(): any;
setObject(object: any): void;
}
/**
* A JDBC ResultSet. For documentation of this class, see java.sql.ResultSet
* .
*/
interface JdbcResultSet {
absolute(row: Integer): boolean;
afterLast(): void;
beforeFirst(): void;
cancelRowUpdates(): void;
clearWarnings(): void;
close(): void;
deleteRow(): void;
findColumn(columnLabel: string): Integer;
first(): boolean;
getArray(columnIndex: Integer): JdbcArray;
getArray(columnLabel: string): JdbcArray;
getBigDecimal(columnIndex: Integer): BigNumber;
getBigDecimal(columnLabel: string): BigNumber;
getBlob(columnIndex: Integer): JdbcBlob;
getBlob(columnLabel: string): JdbcBlob;
getBoolean(columnIndex: Integer): boolean;
getBoolean(columnLabel: string): boolean;
getByte(columnIndex: Integer): Byte;
getByte(columnLabel: string): Byte;
getBytes(columnIndex: Integer): Byte[];
getBytes(columnLabel: string): Byte[];
getClob(columnIndex: Integer): JdbcClob;
getClob(columnLabel: string): JdbcClob;
getConcurrency(): Integer;
getCursorName(): string;
getDate(columnIndex: Integer): JdbcDate;
getDate(columnIndex: Integer, timeZone: string): JdbcDate;
getDate(columnLabel: string): JdbcDate;
getDate(columnLabel: string, timeZone: string): JdbcDate;
getDouble(columnIndex: Integer): number;
getDouble(columnLabel: string): number;
getFetchDirection(): Integer;
getFetchSize(): Integer;
getFloat(columnIndex: Integer): number;
getFloat(columnLabel: string): number;
getHoldability(): Integer;
getInt(columnIndex: Integer): Integer;
getInt(columnLabel: string): Integer;
getLong(columnIndex: Integer): Integer;
getLong(columnLabel: string): Integer;
getMetaData(): JdbcResultSetMetaData;
getNClob(columnIndex: Integer): JdbcClob;
getNClob(columnLabel: string): JdbcClob;
getNString(columnIndex: Integer): string;
getNString(columnLabel: string): string;
getObject(columnIndex: Integer): any;
getObject(columnLabel: string): any;
getRef(columnIndex: Integer): JdbcRef;
getRef(columnLabel: string): JdbcRef;
getRow(): Integer;
getRowId(columnIndex: Integer): JdbcRowId;
getRowId(columnLabel: string): JdbcRowId;
getSQLXML(columnIndex: Integer): JdbcSQLXML;
getSQLXML(columnLabel: string): JdbcSQLXML;
getShort(columnIndex: Integer): Integer;
getShort(columnLabel: string): Integer;
getStatement(): JdbcStatement;
getString(columnIndex: Integer): string;
getString(columnLabel: string): string;
getTime(columnIndex: Integer): JdbcTime;
getTime(columnIndex: Integer, timeZone: string): JdbcTime;
getTime(columnLabel: string): JdbcTime;
getTime(columnLabel: string, timeZone: string): JdbcTime;
getTimestamp(columnIndex: Integer): JdbcTimestamp;
getTimestamp(columnIndex: Integer, timeZone: string): JdbcTimestamp;
getTimestamp(columnLabel: string): JdbcTimestamp;
getTimestamp(columnLabel: string, timeZone: string): JdbcTimestamp;
getType(): Integer;
getURL(columnIndex: Integer): string;
getURL(columnLabel: string): string;
getWarnings(): string[];
insertRow(): void;
isAfterLast(): boolean;
isBeforeFirst(): boolean;
isClosed(): boolean;
isFirst(): boolean;
isLast(): boolean;
last(): boolean;
moveToCurrentRow(): void;
moveToInsertRow(): void;
next(): boolean;
previous(): boolean;
refreshRow(): void;
relative(rows: Integer): boolean;
rowDeleted(): boolean;
rowInserted(): boolean;
rowUpdated(): boolean;
setFetchDirection(direction: Integer): void;
setFetchSize(rows: Integer): void;
updateArray(columnIndex: Integer, x: JdbcArray): void;
updateArray(columnLabel: string, x: JdbcArray): void;
updateBigDecimal(columnIndex: Integer, x: BigNumber): void;
updateBigDecimal(columnLabel: string, x: BigNumber): void;
updateBlob(columnIndex: Integer, x: JdbcBlob): void;
updateBlob(columnLabel: string, x: JdbcBlob): void;
updateBoolean(columnIndex: Integer, x: boolean): void;
updateBoolean(columnLabel: string, x: boolean): void;
updateByte(columnIndex: Integer, x: Byte): void;
updateByte(columnLabel: string, x: Byte): void;
updateBytes(columnIndex: Integer, x: Byte[]): void;
updateBytes(columnLabel: string, x: Byte[]): void;
updateClob(columnIndex: Integer, x: JdbcClob): void;
updateClob(columnLabel: string, x: JdbcClob): void;
updateDate(columnIndex: Integer, x: JdbcDate): void;
updateDate(columnLabel: string, x: JdbcDate): void;
updateDouble(columnIndex: Integer, x: number): void;
updateDouble(columnLabel: string, x: number): void;
updateFloat(columnIndex: Integer, x: number): void;
updateFloat(columnLabel: string, x: number): void;
updateInt(columnIndex: Integer, x: Integer): void;
updateInt(columnLabel: string, x: Integer): void;
updateLong(columnIndex: Integer, x: Integer): void;
updateLong(columnLabel: string, x: Integer): void;
updateNClob(columnIndex: Integer, x: JdbcClob): void;
updateNClob(columnLabel: string, x: JdbcClob): void;
updateNString(columnIndex: Integer, x: string): void;
updateNString(columnLabel: string, x: string): void;
updateNull(columnIndex: Integer): void;
updateNull(columnLabel: string): void;
updateObject(columnIndex: Integer, x: any): void;
updateObject(columnIndex: Integer, x: any, scaleOrLength: Integer): void;
updateObject(columnLabel: string, x: any): void;
updateObject(columnLabel: string, x: any, scaleOrLength: Integer): void;
updateRef(columnIndex: Integer, x: JdbcRef): void;
updateRef(columnLabel: string, x: JdbcRef): void;
updateRow(): void;
updateRowId(columnIndex: Integer, x: JdbcRowId): void;
updateRowId(columnLabel: string, x: JdbcRowId): void;
updateSQLXML(columnIndex: Integer, x: JdbcSQLXML): void;
updateSQLXML(columnLabel: string, x: JdbcSQLXML): void;
updateShort(columnIndex: Integer, x: Integer): void;
updateShort(columnLabel: string, x: Integer): void;
updateString(columnIndex: Integer, x: string): void;
updateString(columnLabel: string, x: string): void;
updateTime(columnIndex: Integer, x: JdbcTime): void;
updateTime(columnLabel: string, x: JdbcTime): void;
updateTimestamp(columnIndex: Integer, x: JdbcTimestamp): void;
updateTimestamp(columnLabel: string, x: JdbcTimestamp): void;
wasNull(): boolean;
}
/**
* A JDBC ResultSetMetaData. For documentation of this class, see
* java.sql.ResultSetMetaData.
*/
interface JdbcResultSetMetaData {
getCatalogName(column: Integer): string;
getColumnClassName(column: Integer): string;
getColumnCount(): Integer;
getColumnDisplaySize(column: Integer): Integer;
getColumnLabel(column: Integer): string;
getColumnName(column: Integer): string;
getColumnType(column: Integer): Integer;
getColumnTypeName(column: Integer): string;
getPrecision(column: Integer): Integer;
getScale(column: Integer): Integer;
getSchemaName(column: Integer): string;
getTableName(column: Integer): string;
isAutoIncrement(column: Integer): boolean;
isCaseSensitive(column: Integer): boolean;
isCurrency(column: Integer): boolean;
isDefinitelyWritable(column: Integer): boolean;
isNullable(column: Integer): Integer;
isReadOnly(column: Integer): boolean;
isSearchable(column: Integer): boolean;
isSigned(column: Integer): boolean;
isWritable(column: Integer): boolean;
}
/**
* A JDBC RowId. For documentation of this class, see java.sql.RowId
* .
*/
interface JdbcRowId {
getBytes(): Byte[];
}
/**
* A JDBC SQLXML. For documentation of this class, see java.sql.SQLXML
* .
*/
interface JdbcSQLXML {
free(): void;
getString(): string;
setString(value: string): void;
}
/**
* A JDBC Savepoint. For documentation of this class, see java.sql.Savepoint
* .
*/
interface JdbcSavepoint {
getSavepointId(): Integer;
getSavepointName(): string;
}
/**
* A JDBC Statement. For documentation of this class, see java.sql.Statement
* .
*/
interface JdbcStatement {
addBatch(sql: string): void;
cancel(): void;
clearBatch(): void;
clearWarnings(): void;
close(): void;
execute(sql: string): boolean;
execute(sql: string, autoGeneratedKeys: Integer, sql_: string, columnIndexes: Integer[]): boolean;
execute(sql: string, autoGeneratedKeys: Integer, sql_: string, columnIndexes: Integer[]): boolean;
execute(sql: string, columnNames: string[]): boolean;
executeBatch(): Integer[];
executeQuery(sql: string): JdbcResultSet;
executeUpdate(sql: string): Integer;
executeUpdate(sql: string, autoGeneratedKeys: Integer, sql_: string, columnIndexes: Integer[]): Integer;
executeUpdate(sql: string, autoGeneratedKeys: Integer, sql_: string, columnIndexes: Integer[]): Integer;
executeUpdate(sql: string, columnNames: string[]): Integer;
getConnection(): JdbcConnection;
getFetchDirection(): Integer;
getFetchSize(): Integer;
getGeneratedKeys(): JdbcResultSet;
getMaxFieldSize(): Integer;
getMaxRows(): Integer;
getMoreResults(): boolean;
getMoreResults(current: Integer): boolean;
getQueryTimeout(): Integer;
getResultSet(): JdbcResultSet;
getResultSetConcurrency(): Integer;
getResultSetHoldability(): Integer;
getResultSetType(): Integer;
getUpdateCount(): Integer;
getWarnings(): string[];
isClosed(): boolean;
isPoolable(): boolean;
setCursorName(name: string): void;
setEscapeProcessing(enable: boolean): void;
setFetchDirection(direction: Integer): void;
setFetchSize(rows: Integer): void;
setMaxFieldSize(max: Integer): void;
setMaxRows(max: Integer): void;
setPoolable(poolable: boolean): void;
setQueryTimeout(seconds: Integer): void;
}
/**
* A JDBC Struct. For documentation of this class, see java.sql.Struct
* .
*/
interface JdbcStruct {
getAttributes(): any[];
getSQLTypeName(): string;
}
/**
* A JDBC Time. For documentation of this class, see java.sql.Time
* .
*/
interface JdbcTime {
after(when: JdbcTime): boolean;
before(when: JdbcTime): boolean;
getHours(): Integer;
getMinutes(): Integer;
getSeconds(): Integer;
getTime(): Integer;
setHours(hours: Integer): void;
setMinutes(minutes: Integer): void;
setSeconds(seconds: Integer): void;
setTime(milliseconds: Integer): void;
}
/**
* A JDBC Timestamp. For documentation of this class, see java.sql.Timestamp
* .
*/
interface JdbcTimestamp {
after(when: JdbcTimestamp): boolean;
before(when: JdbcTimestamp): boolean;
getDate(): Integer;
getHours(): Integer;
getMinutes(): Integer;
getMonth(): Integer;
getNanos(): Integer;
getSeconds(): Integer;
getTime(): Integer;
getYear(): Integer;
setDate(date: Integer): void;
setHours(hours: Integer): void;
setMinutes(minutes: Integer): void;
setMonth(month: Integer): void;
setNanos(nanoseconds: Integer): void;
setSeconds(seconds: Integer): void;
setTime(milliseconds: Integer): void;
setYear(year: Integer): void;
}
}
}
declare var Jdbc: GoogleAppsScript.JDBC.Jdbc;

View File

@ -0,0 +1,28 @@
/// <reference path="google-apps-script.types.d.ts" />
declare namespace GoogleAppsScript {
namespace Language {
interface LanguageAdvancedParameters {
/** the content type of the text; supported values are 'text' (default) and 'html' */
contentType?: "html" | "text" | undefined;
}
/**
* The Language service provides scripts a way to compute automatic translations of text.
*
* // The code below will write "Esta es una prueba" to the log.
* var spanish = LanguageApp.translate('This is a test', 'en', 'es');
* Logger.log(spanish);
*/
interface LanguageApp {
translate(text: string, sourceLanguage: string, targetLanguage: string): string;
translate(
text: string,
sourceLanguage: string,
targetLanguage: string,
advancedArgs: LanguageAdvancedParameters,
): string;
}
}
}
declare var LanguageApp: GoogleAppsScript.Language.LanguageApp;

View File

@ -0,0 +1,53 @@
/// <reference path="google-apps-script.types.d.ts" />
declare namespace GoogleAppsScript {
namespace Lock {
/**
* A representation of a mutual-exclusion lock.
*
* This class allows scripts to make sure that only one instance of the script is executing a
* given section of code at a time. This is particularly useful for callbacks and triggers, where a
* user action may cause changes to a shared resource and you want to ensure that aren't collisions.
*
* The following examples shows how to use a lock in a form submit handler.
*
* // Generates a unique ticket number for every form submission.
* function onFormSubmit(e) {
* var targetCell = e.range.offset(0, e.range.getNumColumns(), 1, 1);
*
* // Get a script lock, because we're about to modify a shared resource.
* var lock = LockService.getScriptLock();
* // Wait for up to 30 seconds for other processes to finish.
* lock.waitLock(30000);
*
* var ticketNumber = Number(ScriptProperties.getProperty('lastTicketNumber')) + 1;
* ScriptProperties.setProperty('lastTicketNumber', ticketNumber);
*
* // Release the lock so that other processes can continue.
* lock.releaseLock();
*
* targetCell.setValue(ticketNumber);
* }
*
* lastTicketNumber
* ScriptProperties
*/
interface Lock {
hasLock(): boolean;
releaseLock(): void;
tryLock(timeoutInMillis: Integer): boolean;
waitLock(timeoutInMillis: Integer): void;
}
/**
* Prevents concurrent access to sections of code. This can be useful when you have multiple users
* or processes modifying a shared resource and want to prevent collisions.
*/
interface LockService {
getDocumentLock(): Lock;
getScriptLock(): Lock;
getUserLock(): Lock;
}
}
}
declare var LockService: GoogleAppsScript.Lock.LockService;

View File

@ -0,0 +1,49 @@
/// <reference path="google-apps-script.types.d.ts" />
declare namespace GoogleAppsScript {
namespace Mail {
interface MailAdvancedParameters {
/** an array of files to send with the email */
attachments?: Base.BlobSource[] | undefined;
/** a comma-separated list of email addresses to BCC */
bcc?: string | undefined;
/** the body of the email */
body?: string | undefined;
/** a comma-separated list of email addresses to CC */
cc?: string | undefined;
/** if set, devices capable of rendering HTML will use it instead of the required body argument; you can add an optional inlineImages field in HTML body if you have inlined images for your email */
htmlBody?: string | undefined;
/** a JavaScript object containing a mapping from image key (String) to image data (BlobSource); this assumes that the htmlBody parameter is used and contains references to these images in the format <img src="cid:imageKey" /> */
inlineImages?: { [imageKey: string]: Base.BlobSource } | undefined;
/** the name of the sender of the email (default: the user's name) */
name?: string | undefined;
/** true if the email should be sent from a generic no-reply email address to discourage recipients from responding to emails; this option is only possible for G Suite accounts, not Gmail users */
noReply?: boolean | undefined;
/** an email address to use as the default reply-to address (default: the user's email address) */
replyTo?: string | undefined;
/** the subject of the email */
subject?: string | undefined;
/** the address of the recipient */
to?: string | undefined;
}
/**
* Sends email.
*
* This service allows users to send emails with complete control over the content of the email.
* Unlike GmailApp, MailApp's sole purpose is sending email. MailApp cannot access a user's Gmail
* inbox.
*
* Changes to scripts written using GmailApp are more likely to trigger a re-authorization
* request from a user than MailApp scripts.
*/
interface MailApp {
getRemainingDailyQuota(): Integer;
sendEmail(message: MailAdvancedParameters): void;
sendEmail(recipient: string, subject: string, body: string): void;
sendEmail(recipient: string, subject: string, body: string, options: MailAdvancedParameters): void;
sendEmail(to: string, replyTo: string, subject: string, body: string): void;
}
}
}
declare var MailApp: GoogleAppsScript.Mail.MailApp;

View File

@ -0,0 +1,332 @@
/// <reference path="google-apps-script.types.d.ts" />
/// <reference path="google-apps-script.base.d.ts" />
declare namespace GoogleAppsScript {
namespace Maps {
/**
* An enum representing the types of restrictions to avoid when finding directions.
*/
enum Avoid {
TOLLS,
HIGHWAYS,
}
/**
* An enum representing the named colors available to use in map images.
*/
enum Color {
BLACK,
BROWN,
GREEN,
PURPLE,
YELLOW,
BLUE,
GRAY,
ORANGE,
RED,
WHITE,
}
/**
* Allows for the retrieval of directions between locations.
* The example below shows how you can use this class to get the directions from Times Square to
* Central Park, stopping first at Lincoln Center, plot the locations and path on a map, and send
* the map in an email.
*
* // Get the directions.
* var directions = Maps.newDirectionFinder()
* .setOrigin('Times Square, New York, NY')
* .addWaypoint('Lincoln Center, New York, NY')
* .setDestination('Central Park, New York, NY')
* .setMode(Maps.DirectionFinder.Mode.DRIVING)
* .getDirections();
* var route = directions.routes[0];
*
* // Set up marker styles.
* var markerSize = Maps.StaticMap.MarkerSize.MID;
* var markerColor = Maps.StaticMap.Color.GREEN
* var markerLetterCode = 'A'.charCodeAt();
*
* // Add markers to the map.
* var map = Maps.newStaticMap();
* for (var i = 0; i < route.legs.length; i++) {
* var leg = route.legs[i];
* if (i == 0) {
* // Add a marker for the start location of the first leg only.
* map.setMarkerStyle(markerSize, markerColor, String.fromCharCode(markerLetterCode));
* map.addMarker(leg.start_location.lat, leg.start_location.lng);
* markerLetterCode++;
* }
* map.setMarkerStyle(markerSize, markerColor, String.fromCharCode(markerLetterCode));
* map.addMarker(leg.end_location.lat, leg.end_location.lng);
* markerLetterCode++;
* }
*
* // Add a path for the entire route.
* map.addPath(route.overview_polyline.points);
*
* // Send the map in an email.
* var toAddress = Session.getActiveUser().getEmail();
* MailApp.sendEmail(
* toAddress,
* 'Directions',
* 'Please open: ' + map.getMapUrl() + '&key=YOUR_API_KEY', {
* htmlBody: 'See below.<br/><img src="cid:mapImage">',
* inlineImages: {
* mapImage: Utilities.newBlob(map.getMapImage(), 'image/png')
* }
* }
* );
*
* See also
*
* Google Directions API
*/
interface DirectionFinder {
addWaypoint(latitude: number, longitude: number): DirectionFinder;
addWaypoint(address: string): DirectionFinder;
clearWaypoints(): DirectionFinder;
getDirections(): any;
setAlternatives(useAlternatives: boolean): DirectionFinder;
setArrive(time: Base.Date): DirectionFinder;
setAvoid(avoid: string): DirectionFinder;
setDepart(time: Base.Date): DirectionFinder;
setDestination(latitude: number, longitude: number): DirectionFinder;
setDestination(address: string): DirectionFinder;
setLanguage(language: string): DirectionFinder;
setMode(mode: Mode): DirectionFinder;
setOptimizeWaypoints(optimizeOrder: boolean): DirectionFinder;
setOrigin(latitude: number, longitude: number): DirectionFinder;
setOrigin(address: string): DirectionFinder;
setRegion(region: string): DirectionFinder;
}
/**
* A collection of enums used by DirectionFinder.
*/
interface DirectionFinderEnums {
Avoid: typeof Avoid;
Mode: typeof Mode;
}
/**
* Allows for the sampling of elevations at particular locations.
* The example below shows how you can use this class to determine the highest point along the route
* from Denver to Grand Junction in Colorado, plot it on a map, and save the map to Google Drive.
*
* // Get directions from Denver to Grand Junction.
* var directions = Maps.newDirectionFinder()
* .setOrigin('Denver, CO')
* .setDestination('Grand Junction, CO')
* .setMode(Maps.DirectionFinder.Mode.DRIVING)
* .getDirections();
* var route = directions.routes[0];
*
* // Get elevation samples along the route.
* var numberOfSamples = 30;
* var response = Maps.newElevationSampler()
* .samplePath(route.overview_polyline.points, numberOfSamples)
*
* // Determine highest point.
* var maxElevation = Number.MIN_VALUE;
* var highestPoint = null;
* for (var i = 0; i < response.results.length; i++) {
* var sample = response.results[i];
* if (sample.elevation > maxElevation) {
* maxElevation = sample.elevation;
* highestPoint = sample.location;
* }
* }
*
* // Add the path and marker to a map.
* var map = Maps.newStaticMap()
* .addPath(route.overview_polyline.points)
* .addMarker(highestPoint.lat, highestPoint.lng);
*
* // Save the map to your drive
* DocsList.createFile(Utilities.newBlob(map.getMapImage(), 'image/png', 'map.png'));
*
* See also
*
* Google Elevation API
*/
interface ElevationSampler {
sampleLocation(latitude: number, longitude: number): any;
sampleLocations(points: number[]): any;
sampleLocations(encodedPolyline: string): any;
samplePath(points: number[], numSamples: Integer): any;
samplePath(encodedPolyline: string, numSamples: Integer): any;
}
/**
* An enum representing the format of the map image.
* See also
*
* Google Static Maps API
*/
enum Format {
PNG,
PNG8,
PNG32,
GIF,
JPG,
JPG_BASELINE,
}
/**
* Allows for the conversion between an address and geographical coordinates.
* The example below shows how you can use this class find the top nine matches for the location
* "Main St" in Colorado, add them to a map, and then embed it in a new Google Doc.
*
* // Find the best matches for "Main St" in Colorado.
* var response = Maps.newGeocoder()
* // The latitudes and longitudes of southwest and northeast corners of Colorado, respectively.
* .setBounds(36.998166, -109.045486, 41.001666,-102.052002)
* .geocode('Main St');
*
* // Create a Google Doc and map.
* var doc = DocumentApp.create('My Map');
* var map = Maps.newStaticMap();
*
* // Add each result to the map and doc.
* for (var i = 0; i < response.results.length && i < 9; i++) {
* var result = response.results[i];
* map.setMarkerStyle(null, null, i + 1);
* map.addMarker(result.geometry.location.lat, result.geometry.location.lng);
* doc.appendListItem(result.formatted_address);
* }
*
* // Add the finished map to the doc.
* doc.appendImage(Utilities.newBlob(map.getMapImage(), 'image/png'));
*
* See also
*
* Google Geocoding API
*/
interface Geocoder {
geocode(address: string): any;
reverseGeocode(latitude: number, longitude: number): any;
reverseGeocode(swLatitude: number, swLongitude: number, neLatitude: number, neLongitude: number): any;
setBounds(swLatitude: number, swLongitude: number, neLatitude: number, neLongitude: number): Geocoder;
setLanguage(language: string): Geocoder;
setRegion(region: string): Geocoder;
}
/**
* Allows for direction finding, geocoding, elevation sampling and the creation of static map
* images.
*/
interface Maps {
DirectionFinder: DirectionFinderEnums;
StaticMap: StaticMapEnums;
decodePolyline(polyline: string): number[];
encodePolyline(points: number[]): string;
newDirectionFinder(): DirectionFinder;
newElevationSampler(): ElevationSampler;
newGeocoder(): Geocoder;
newStaticMap(): StaticMap;
setAuthentication(clientId: string, signingKey: string): void;
}
/**
* An enum representing the size of a marker added to a map.
* See also
*
* Google Static Maps API
*/
enum MarkerSize {
TINY,
MID,
SMALL,
}
/**
* An enum representing the mode of travel to use when finding directions.
*/
enum Mode {
DRIVING,
WALKING,
BICYCLING,
TRANSIT,
}
/**
* Allows for the creation and decoration of static map images.
*
* The example below shows how you can use this class to create a map of New York City's Theatre
* District, including nearby train stations, and display it in a simple web app.
*
* // Create a map centered on Times Square.
* var map = Maps.newStaticMap()
* .setSize(600, 600)
* .setCenter('Times Square, New York, NY');
*
* // Add markers for the nearbye train stations.
* map.setMarkerStyle(Maps.StaticMap.MarkerSize.MID, Maps.StaticMap.Color.RED, 'T');
* map.addMarker('Grand Central Station, New York, NY');
* map.addMarker('Penn Station, New York, NY');
*
* // Show the boundaries of the Theatre District.
* var corners = [
* '8th Ave & 53rd St, New York, NY',
* '6th Ave & 53rd St, New York, NY',
* '6th Ave & 40th St, New York, NY',
* '8th Ave & 40th St, New York, NY'
* ];
* map.setPathStyle(4, Maps.StaticMap.Color.BLACK, Maps.StaticMap.Color.BLUE);
* map.beginPath();
* for (var i = 0; i < corners.length; i++) {
* map.addAddress(corners[i]);
* }
* // All static map URLs require an API key.
* var url = map.getMapUrl() + "&key=YOUR_API_KEY";
*
* See also
*
* Google Static Maps API
*/
interface StaticMap {
addAddress(address: string): StaticMap;
addMarker(latitude: number, longitude: number): StaticMap;
addMarker(address: string): StaticMap;
addPath(points: number[]): StaticMap;
addPath(polyline: string): StaticMap;
addPoint(latitude: number, longitude: number): StaticMap;
addVisible(latitude: number, longitude: number): StaticMap;
addVisible(address: string): StaticMap;
beginPath(): StaticMap;
clearMarkers(): StaticMap;
clearPaths(): StaticMap;
clearVisibles(): StaticMap;
endPath(): StaticMap;
getAs(contentType: string): Base.Blob;
getBlob(): Base.Blob;
getMapImage(): Byte[];
getMapUrl(): string;
setCenter(latitude: number, longitude: number): StaticMap;
setCenter(address: string): StaticMap;
setCustomMarkerStyle(imageUrl: string, useShadow: boolean): StaticMap;
setFormat(format: string): StaticMap;
setLanguage(language: string): StaticMap;
setMapType(mapType: string): StaticMap;
setMarkerStyle(size: string, color: string, label: string): StaticMap;
setMobile(useMobileTiles: boolean): StaticMap;
setPathStyle(weight: Integer, color: string, fillColor: string): StaticMap;
setSize(width: Integer, height: Integer): StaticMap;
setZoom(zoom: Integer): StaticMap;
}
/**
* A collection of enums used by StaticMap.
*/
interface StaticMapEnums {
Color: typeof Color;
Format: typeof Format;
MarkerSize: typeof MarkerSize;
Type: typeof Type;
}
/**
* An enum representing the type of map to render.
* See also
*
* Google Static Maps API
*/
enum Type {
ROADMAP,
SATELLITE,
TERRAIN,
HYBRID,
}
}
}
declare var Maps: GoogleAppsScript.Maps.Maps;

View File

@ -0,0 +1,253 @@
/// <reference path="google-apps-script.types.d.ts" />
declare namespace GoogleAppsScript {
namespace Optimization {
/**
* Object storing a linear constraint of the form lowerBound ≤ Sum(a(i) x(i)) ≤ upperBound
* where lowerBound and upperBound are constants, a(i) are constant
* coefficients and x(i) are variables (unknowns).
*
* The example below creates one variable x with values between 0 and 5
* and creates the constraint 0 ≤ 2 * x ≤ 5. This is done by first creating a constraint
* with the lower bound 5 and upper bound 5. Then the coefficient for variable
* x in this constraint is set to 2.
*
* var engine = LinearOptimizationService.createEngine();
* // Create a variable so we can add it to the constraint
* engine.addVariable('x', 0, 5);
* // Create a linear constraint with the bounds 0 and 10
* var constraint = engine.addConstraint(0, 10);
* // Set the coefficient of the variable in the constraint. The constraint is now:
* // 0 <= 2 * x <= 5
* constraint.setCoefficient('x', 2);
*/
interface LinearOptimizationConstraint {
setCoefficient(variableName: string, coefficient: number): LinearOptimizationConstraint;
}
/**
* The engine used to model and solve a linear program. The example below solves the following
* linear program:
*
* Two variables, x and y:
*
* 0 ≤ x ≤ 10
*
* 0 ≤ y ≤ 5
*
* Constraints:
*
* 0 ≤ 2 * x + 5 * y ≤ 10
*
* 0 ≤ 10 * x + 3 * y ≤ 20
*
* Objective:
* Maximize x + y
*
* var engine = LinearOptimizationService.createEngine();
*
* // Add variables, constraints and define the objective with addVariable(), addConstraint(), etc
* // Add two variables, 0 <= x <= 10 and 0 <= y <= 5
* engine.addVariable('x', 0, 10);
* engine.addVariable('y', 0, 5);
*
* // Create the constraint: 0 <= 2 * x + 5 * y <= 10
* var constraint = engine.addConstraint(0, 10);
* constraint.setCoefficient('x', 2);
* constraint.setCoefficient('y', 5);
*
* // Create the constraint: 0 <= 10 * x + 3 * y <= 20
* var constraint = engine.addConstraint(0, 20);
* constraint.setCoefficient('x', 10);
* constraint.setCoefficient('y', 3);
*
* // Set the objective to be x + y
* engine.setObjectiveCoefficient('x', 1);
* engine.setObjectiveCoefficient('y', 1);
*
* // Engine should maximize the objective
* engine.setMaximization();
*
* // Solve the linear program
* var solution = engine.solve();
* if (!solution.isValid()) {
* Logger.log('No solution ' + solution.getStatus());
* } else {
* Logger.log('Value of x: ' + solution.getVariableValue('x'));
* Logger.log('Value of y: ' + solution.getVariableValue('y'));
* }
*/
interface LinearOptimizationEngine {
addConstraint(lowerBound: number, upperBound: number): LinearOptimizationConstraint;
addConstraints(
lowerBounds: number[],
upperBounds: number[],
variableNames: string[][],
coefficients: number[][],
): LinearOptimizationEngine;
addVariable(name: string, lowerBound: number, upperBound: number): LinearOptimizationEngine;
addVariable(
name: string,
lowerBound: number,
upperBound: number,
type: VariableType,
): LinearOptimizationEngine;
addVariable(
name: string,
lowerBound: number,
upperBound: number,
type: VariableType,
objectiveCoefficient: number,
): LinearOptimizationEngine;
addVariables(
names: string[],
lowerBounds: number[],
upperBounds: number[],
types: VariableType[],
objectiveCoefficients: number[],
): LinearOptimizationEngine;
setMaximization(): LinearOptimizationEngine;
setMinimization(): LinearOptimizationEngine;
setObjectiveCoefficient(variableName: string, coefficient: number): LinearOptimizationEngine;
solve(): LinearOptimizationSolution;
solve(seconds: number): LinearOptimizationSolution;
}
/**
* The linear optimization service, used to model and solve linear and mixed-integer linear
* programs. The example below solves the following linear program:
*
* Two variables, x and y:
*
* 0 ≤ x ≤ 10
*
* 0 ≤ y ≤ 5
*
* Constraints:
*
* 0 ≤ 2 * x + 5 * y ≤ 10
*
* 0 ≤ 10 * x + 3 * y ≤ 20
*
* Objective:
* Maximize x + y
*
* var engine = LinearOptimizationService.createEngine();
*
* // Add variables, constraints and define the objective using addVariable(), addConstraint(), etc.
* // Add two variables, 0 <= x <= 10 and 0 <= y <= 5
* engine.addVariable('x', 0, 10);
* engine.addVariable('y', 0, 5);
*
* // Create the constraint: 0 <= 2 * x + 5 * y <= 10
* var constraint = engine.addConstraint(0, 10);
* constraint.setCoefficient('x', 2);
* constraint.setCoefficient('y', 5);
*
* // Create the constraint: 0 <= 10 * x + 3 * y <= 20
* var constraint = engine.addConstraint(0, 20);
* constraint.setCoefficient('x', 10);
* constraint.setCoefficient('y', 3);
*
* // Set the objective to be x + y
* engine.setObjectiveCoefficient('x', 1);
* engine.setObjectiveCoefficient('y', 1);
*
* // Engine should maximize the objective.
* engine.setMaximization();
*
* // Solve the linear program
* var solution = engine.solve();
* if (!solution.isValid()) {
* Logger.log('No solution ' + solution.getStatus());
* } else {
* Logger.log('Value of x: ' + solution.getVariableValue('x'));
* Logger.log('Value of y: ' + solution.getVariableValue('y'));
* }
*/
interface LinearOptimizationService {
Status: typeof Status;
VariableType: typeof VariableType;
createEngine(): LinearOptimizationEngine;
}
/**
* The solution of a linear program. The example below solves the following linear program:
*
* Two variables, x and y:
*
* 0 ≤ x ≤ 10
*
* 0 ≤ y ≤ 5
*
* Constraints:
*
* 0 ≤ 2 * x + 5 * y ≤ 10
*
* 0 ≤ 10 * x + 3 * y ≤ 20
*
* Objective:
* Maximize x + y
*
* var engine = LinearOptimizationService.createEngine();
*
* // Add variables, constraints and define the objective with addVariable(), addConstraint(), etc.
* // Add two variables, 0 <= x <= 10 and 0 <= y <= 5
* engine.addVariable('x', 0, 10);
* engine.addVariable('y', 0, 5);
*
* // Create the constraint: 0 <= 2 * x + 5 * y <= 10
* var constraint = engine.addConstraint(0, 10);
* constraint.setCoefficient('x', 2);
* constraint.setCoefficient('y', 5);
*
* // Create the constraint: 0 <= 10 * x + 3 * y <= 20
* var constraint = engine.addConstraint(0, 20);
* constraint.setCoefficient('x', 10);
* constraint.setCoefficient('y', 3);
*
* // Set the objective to be x + y
* engine.setObjectiveCoefficient('x', 1);
* engine.setObjectiveCoefficient('y', 1);
*
* // Engine should maximize the objective
* engine.setMaximization();
*
* // Solve the linear program
* var solution = engine.solve();
* if (!solution.isValid()) {
* Logger.log('No solution ' + solution.getStatus());
* } else {
* Logger.log('Objective value: ' + solution.getObjectiveValue());
* Logger.log('Value of x: ' + solution.getVariableValue('x'));
* Logger.log('Value of y: ' + solution.getVariableValue('y'));
* }
*/
interface LinearOptimizationSolution {
getObjectiveValue(): number;
getStatus(): Status;
getVariableValue(variableName: string): number;
isValid(): boolean;
}
/**
* Status of the solution. Before solving a problem the status will be NOT_SOLVED;
* afterwards it will take any of the other values depending if it successfully found a solution and
* if the solution is optimal.
*/
enum Status {
OPTIMAL,
FEASIBLE,
INFEASIBLE,
UNBOUNDED,
ABNORMAL,
MODEL_INVALID,
NOT_SOLVED,
}
/**
* Type of variables created by the engine.
*/
enum VariableType {
INTEGER,
CONTINUOUS,
}
}
}
declare var LinearOptimizationService: GoogleAppsScript.Optimization.LinearOptimizationService;

View File

@ -0,0 +1,82 @@
/// <reference path="google-apps-script.types.d.ts" />
declare namespace GoogleAppsScript {
namespace Properties {
/**
* The properties object acts as the interface to access user, document, or script properties. The
* specific property type depends on which of the three methods of PropertiesService the
* script called: PropertiesService.getDocumentProperties(), PropertiesService.getUserProperties(), or PropertiesService.getScriptProperties().
* Properties cannot be shared between scripts. For more information about property types, see the
* guide to the Properties service.
*/
interface Properties {
deleteAllProperties(): Properties;
deleteProperty(key: string): Properties;
getKeys(): string[];
getProperties(): { [key: string]: string };
getProperty(key: string): string | null;
setProperties(properties: { [key: string]: string }): Properties;
setProperties(properties: { [key: string]: string }, deleteAllOthers: boolean): Properties;
setProperty(key: string, value: string): Properties;
}
/**
* Allows scripts to store simple data in key-value pairs scoped to one script, one user of a
* script, or one document in which an add-on is used. Properties cannot be shared between scripts.
* For more information about when to use each type of property, see the guide to the Properties service.
*
* // Sets three properties of different types.
* var documentProperties = PropertiesService.getDocumentProperties();
* var scriptProperties = PropertiesService.getScriptProperties();
* var userProperties = PropertiesService.getUserProperties();
*
* documentProperties.setProperty('DAYS_TO_FETCH', '5');
* scriptProperties.setProperty('SERVER_URL', 'http://www.example.com/MyWeatherService/');
* userProperties.setProperty('DISPLAY_UNITS', 'metric');
*/
interface PropertiesService {
getDocumentProperties(): Properties;
getScriptProperties(): Properties;
getUserProperties(): Properties;
}
/**
* Deprecated. This class is deprecated and should not be used in new scripts.
* Script Properties are key-value pairs stored by a script in a persistent store. Script Properties
* are scoped per script, regardless of which user runs the script.
*/
interface ScriptProperties {
/** @deprecated DO NOT USE */ deleteAllProperties(): ScriptProperties;
/** @deprecated DO NOT USE */ deleteProperty(key: string): ScriptProperties;
/** @deprecated DO NOT USE */ getKeys(): string[];
/** @deprecated DO NOT USE */ getProperties(): { [key: string]: string };
/** @deprecated DO NOT USE */ getProperty(key: string): string | null;
/** @deprecated DO NOT USE */ setProperties(properties: { [key: string]: string }): ScriptProperties;
/** @deprecated DO NOT USE */ setProperties(
properties: { [key: string]: string },
deleteAllOthers: boolean,
): ScriptProperties;
/** @deprecated DO NOT USE */ setProperty(key: string, value: string): ScriptProperties;
}
/**
* Deprecated. This class is deprecated and should not be used in new scripts.
* User Properties are key-value pairs unique to a user. User Properties are scoped per user; any
* script running under the identity of a user can access User Properties for that user only.
*/
interface UserProperties {
/** @deprecated DO NOT USE */ deleteAllProperties(): UserProperties;
/** @deprecated DO NOT USE */ deleteProperty(key: string): UserProperties;
/** @deprecated DO NOT USE */ getKeys(): string[];
/** @deprecated DO NOT USE */ getProperties(): { [key: string]: string };
/** @deprecated DO NOT USE */ getProperty(key: string): string | null;
/** @deprecated DO NOT USE */ setProperties(properties: { [key: string]: string }): UserProperties;
/** @deprecated DO NOT USE */ setProperties(
properties: { [key: string]: string },
deleteAllOthers: boolean,
): UserProperties;
/** @deprecated DO NOT USE */ setProperty(key: string, value: string): UserProperties;
}
}
}
declare var PropertiesService: GoogleAppsScript.Properties.PropertiesService;
declare var ScriptProperties: GoogleAppsScript.Properties.ScriptProperties;
declare var UserProperties: GoogleAppsScript.Properties.UserProperties;

View File

@ -0,0 +1,229 @@
/// <reference path="google-apps-script.types.d.ts" />
/// <reference path="google-apps-script.base.d.ts" />
/// <reference path="google-apps-script.document.d.ts" />
/// <reference path="google-apps-script.forms.d.ts" />
/// <reference path="google-apps-script.spreadsheet.d.ts" />
declare namespace GoogleAppsScript {
namespace Script {
/**
* An enumeration that identifies which categories of authorized services Apps Script is able to
* execute through a triggered function. These values are exposed in triggered functions as the authMode
* property of the event parameter, e. For
* more information, see the guide to the
* authorization lifecycle for add-ons.
*
* function onOpen(e) {
* var menu = SpreadsheetApp.getUi().createAddonMenu();
* if (e && e.authMode == ScriptApp.AuthMode.NONE) {
* // Add a normal menu item (works in all authorization modes).
* menu.addItem('Start workflow', 'startWorkflow');
* } else {
* // Add a menu item based on properties (doesn't work in AuthMode.NONE).
* var properties = PropertiesService.getDocumentProperties();
* var workflowStarted = properties.getProperty('workflowStarted');
* if (workflowStarted) {
* menu.addItem('Check workflow status', 'checkWorkflow');
* } else {
* menu.addItem('Start workflow', 'startWorkflow');
* }
* // Record analytics.
* UrlFetchApp.fetch('http://www.example.com/analytics?event=open');
* }
* menu.addToUi();
* }
*/
enum AuthMode {
NONE,
CUSTOM_FUNCTION,
LIMITED,
FULL,
}
/**
* An object used to determine whether the user needs to authorize this script to use one or more
* services, and to provide the URL for an authorization dialog. If the script is published as an add-on that uses installable triggers, this information can be used
* to control access to sections of code for which the user lacks the necessary authorization.
* Alternately, the add-on can ask the user to open the URL for the authorization dialog to resolve
* the problem.
*
* This object is returned by ScriptApp.getAuthorizationInfo(authMode). In almost
* all cases, scripts should call ScriptApp.getAuthorizationInfo(ScriptApp.AuthMode.FULL),
* since no other authorization mode requires that users grant authorization.
*/
interface AuthorizationInfo {
getAuthorizationStatus(): AuthorizationStatus;
getAuthorizationUrl(): string;
}
/**
* An enumeration denoting the authorization status of a script.
*/
enum AuthorizationStatus {
REQUIRED,
NOT_REQUIRED,
}
/**
* Builder for calendar triggers.
*/
interface CalendarTriggerBuilder {
create(): Trigger;
onEventUpdated(): CalendarTriggerBuilder;
}
/**
* A builder for clock triggers.
*/
interface ClockTriggerBuilder {
after(durationMilliseconds: Integer): ClockTriggerBuilder;
at(date: Base.Date): ClockTriggerBuilder;
atDate(year: Integer, month: Integer, day: Integer): ClockTriggerBuilder;
atHour(hour: Integer): ClockTriggerBuilder;
create(): Trigger;
everyDays(n: Integer): ClockTriggerBuilder;
everyHours(n: Integer): ClockTriggerBuilder;
everyMinutes(n: Integer): ClockTriggerBuilder;
everyWeeks(n: Integer): ClockTriggerBuilder;
inTimezone(timezone: string): ClockTriggerBuilder;
nearMinute(minute: Integer): ClockTriggerBuilder;
onMonthDay(day: Integer): ClockTriggerBuilder;
onWeekDay(day: Base.Weekday): ClockTriggerBuilder;
}
/**
* A builder for document triggers.
*/
interface DocumentTriggerBuilder {
create(): Trigger;
onOpen(): DocumentTriggerBuilder;
}
/**
* An enumeration denoting the type of triggered event.
*/
enum EventType {
CLOCK,
ON_OPEN,
ON_EDIT,
ON_FORM_SUBMIT,
ON_CHANGE,
ON_EVENT_UPDATED,
}
/**
* A builder for form triggers.
*/
interface FormTriggerBuilder {
create(): Trigger;
onFormSubmit(): FormTriggerBuilder;
onOpen(): FormTriggerBuilder;
}
/**
* An enumeration that indicates how the script came to be installed as an add-on for the current
* user.
*/
enum InstallationSource {
APPS_MARKETPLACE_DOMAIN_ADD_ON,
NONE,
WEB_STORE_ADD_ON,
}
/**
* Access and manipulate script publishing and triggers. This class allows users to create script
* triggers and control publishing the script as a service.
*/
interface ScriptApp {
AuthMode: typeof AuthMode;
AuthorizationStatus: typeof AuthorizationStatus;
EventType: typeof EventType;
InstallationSource: typeof InstallationSource;
TriggerSource: typeof TriggerSource;
WeekDay: typeof Base.Weekday;
deleteTrigger(trigger: Trigger): void;
getAuthorizationInfo(authMode: AuthMode): AuthorizationInfo;
getIdentityToken(): string;
getInstallationSource(): InstallationSource;
getOAuthToken(): string;
getProjectTriggers(): Trigger[];
getScriptId(): string;
getService(): Service;
getUserTriggers(document: Document.Document): Trigger[];
getUserTriggers(form: Forms.Form): Trigger[];
getUserTriggers(spreadsheet: Spreadsheet.Spreadsheet): Trigger[];
invalidateAuth(): void;
newStateToken(): StateTokenBuilder;
newTrigger(functionName: string): TriggerBuilder;
/** @deprecated DO NOT USE */ getProjectKey(): string;
/** @deprecated DO NOT USE */ getScriptTriggers(): Trigger[];
}
/**
* Access and manipulate script publishing.
*/
interface Service {
getUrl(): string;
isEnabled(): boolean;
/** @deprecated DO NOT USE */ disable(): void;
}
/**
* Builder for spreadsheet triggers.
*/
interface SpreadsheetTriggerBuilder {
create(): Trigger;
onChange(): SpreadsheetTriggerBuilder;
onEdit(): SpreadsheetTriggerBuilder;
onFormSubmit(): SpreadsheetTriggerBuilder;
onOpen(): SpreadsheetTriggerBuilder;
}
/**
* Allows scripts to create state tokens that can be used in callback APIs (like OAuth flows).
*
* // Reusable function to generate a callback URL, assuming the script has been published as a
* // web app (necessary to obtain the URL programmatically). If the script has not been published
* // as a web app, set `var url` in the first line to the URL of your script project (which
* // cannot be obtained programmatically).
* function getCallbackURL(callbackFunction){
* var url = ScriptApp.getService().getUrl(); // Ends in /exec (for a web app)
* url = url.slice(0, -4) + 'usercallback?state='; // Change /exec to /usercallback
* var stateToken = ScriptApp.newStateToken()
* .withMethod(callbackFunction)
* .withTimeout(120)
* .createToken();
* return url + stateToken;
* }
*/
interface StateTokenBuilder {
createToken(): string;
withArgument(name: string, value: string): StateTokenBuilder;
withMethod(method: string): StateTokenBuilder;
withTimeout(seconds: Integer): StateTokenBuilder;
}
/**
* A script trigger.
*/
interface Trigger {
getEventType(): EventType;
getHandlerFunction(): string;
getTriggerSource(): TriggerSource;
getTriggerSourceId(): string;
getUniqueId(): string;
}
/**
* A generic builder for script triggers.
*/
interface TriggerBuilder {
forDocument(document: Document.Document): DocumentTriggerBuilder;
forDocument(key: string): DocumentTriggerBuilder;
forForm(form: Forms.Form): FormTriggerBuilder;
forForm(key: string): FormTriggerBuilder;
forSpreadsheet(sheet: Spreadsheet.Spreadsheet): SpreadsheetTriggerBuilder;
forSpreadsheet(key: string): SpreadsheetTriggerBuilder;
forUserCalendar(emailId: string): CalendarTriggerBuilder;
timeBased(): ClockTriggerBuilder;
}
/**
* An enumeration denoting the source of the event that causes the trigger to fire.
*/
enum TriggerSource {
SPREADSHEETS,
CLOCK,
FORMS,
DOCUMENTS,
CALENDAR,
}
}
}
declare var ScriptApp: GoogleAppsScript.Script.ScriptApp;

View File

@ -0,0 +1,293 @@
/// <reference path="google-apps-script.types.d.ts" />
/// <reference path="google-apps-script.base.d.ts" />
declare namespace GoogleAppsScript {
namespace Sites {
/**
* A Sites Attachment such as a file attached to a page.
*
* Note that an Attachment is a Blob and can be used anywhere Blob input is expected.
* A rebuilt
* version of Sites was launched on November 22, 2016. Apps Script cannot currently access or
* modify Sites made with this version, but script can still access
* classic Sites.
*
* var filesPage = SitesApp.getSite('example.com', 'mysite').getChildByName("files");
* var attachments = filesPage.getAttachments();
*
* // DocsList.createFile accepts a blob input. Since an Attachment is just a blob, we can
* // just pass it directly to that method
* var file = DocsList.createFile(attachments[0]);
*/
interface Attachment {
deleteAttachment(): void;
getAs(contentType: string): Base.Blob;
getAttachmentType(): AttachmentType;
getBlob(): Base.Blob;
getContentType(): string;
getDatePublished(): Base.Date;
getDescription(): string;
getLastUpdated(): Base.Date;
getParent(): Page;
getTitle(): string;
getUrl(): string;
setContentType(contentType: string): Attachment;
setDescription(description: string): Attachment;
setFrom(blob: Base.BlobSource): Attachment;
setParent(parent: Page): Attachment;
setTitle(title: string): Attachment;
setUrl(url: string): Attachment;
}
/**
* A typesafe enum for sites attachment type.
* A rebuilt
* version of Sites was launched on November 22, 2016. Apps Script cannot currently access or
* modify Sites made with this version, but script can still access
* classic Sites.
*/
enum AttachmentType {
WEB,
HOSTED,
}
/**
* A Sites Column - a column from a Sites List page.
* A rebuilt
* version of Sites was launched on November 22, 2016. Apps Script cannot currently access or
* modify Sites made with this version, but script can still access
* classic Sites.
*/
interface Column {
deleteColumn(): void;
getName(): string;
getParent(): Page;
setName(name: string): Column;
}
/**
* A Comment attached to any Sites page.
* A rebuilt
* version of Sites was launched on November 22, 2016. Apps Script cannot currently access or
* modify Sites made with this version, but script can still access
* classic Sites.
*/
interface Comment {
deleteComment(): void;
getAuthorEmail(): string;
getAuthorName(): string;
getContent(): string;
getDatePublished(): Base.Date;
getLastUpdated(): Base.Date;
getParent(): Page;
setContent(content: string): Comment;
setParent(parent: Page): Comment;
}
/**
* A Sites ListItem - a list element from a Sites List page.
* A rebuilt
* version of Sites was launched on November 22, 2016. Apps Script cannot currently access or
* modify Sites made with this version, but script can still access
* classic Sites.
*/
interface ListItem {
deleteListItem(): void;
getDatePublished(): Base.Date;
getLastUpdated(): Base.Date;
getParent(): Page;
getValueByIndex(index: Integer): string;
getValueByName(name: string): string;
setParent(parent: Page): ListItem;
setValueByIndex(index: Integer, value: string): ListItem;
setValueByName(name: string, value: string): ListItem;
}
interface PageAdvancedParameters {
/** only get pages of this type */
type?: PageType[] | undefined;
/** start the results here */
start?: Integer | undefined;
/** the max number of results (default 200) */
max?: Integer | undefined;
/** whether to include draft pages (default false) */
includeDrafts?: boolean | undefined;
/** whether to include deleted pages (default false) */
includeDeleted?: boolean | undefined;
/** only return pages matching this query */
search?: string | undefined;
}
/**
* A Page on a Google Site.
* A rebuilt
* version of Sites was launched on November 22, 2016. Apps Script cannot currently access or
* modify Sites made with this version, but script can still access
* classic Sites.
*/
interface Page {
addColumn(name: string): Column;
addHostedAttachment(blob: Base.BlobSource): Attachment;
addHostedAttachment(blob: Base.BlobSource, description: string): Attachment;
addListItem(values: string[]): ListItem;
addWebAttachment(title: string, description: string, url: string): Attachment;
createAnnouncement(title: string, html: string): Page;
createAnnouncement(title: string, html: string, asDraft: boolean): Page;
createAnnouncementsPage(title: string, name: string, html: string): Page;
createFileCabinetPage(title: string, name: string, html: string): Page;
createListPage(title: string, name: string, html: string, columnNames: string[]): Page;
createPageFromTemplate(title: string, name: string, template: Page): Page;
createWebPage(title: string, name: string, html: string): Page;
deletePage(): void;
getAllDescendants(): Page[];
getAllDescendants(options: PageAdvancedParameters): Page[];
getAnnouncements(): Page[];
getAnnouncements(optOptions: PageAdvancedParameters): Page[];
getAttachments(): Attachment[];
getAttachments(optOptions: { start?: Integer | undefined; max?: Integer | undefined }): Attachment[];
getAuthors(): string[];
getChildByName(name: string): Page;
getChildren(): Page[];
getChildren(options: PageAdvancedParameters): Page[];
getColumns(): Column[];
getDatePublished(): Base.Date;
getHtmlContent(): string;
getIsDraft(): boolean;
getLastEdited(): Base.Date;
getLastUpdated(): Base.Date;
getListItems(): ListItem[];
getListItems(optOptions: { start?: Integer | undefined; max?: Integer | undefined }): ListItem[];
getName(): string;
getPageType(): PageType;
getParent(): Page;
getTextContent(): string;
getTitle(): string;
getUrl(): string;
isDeleted(): boolean;
isTemplate(): boolean;
publishAsTemplate(name: string): Page;
search(query: string): Page[];
search(query: string, options: PageAdvancedParameters): Page[];
setHtmlContent(html: string): Page;
setIsDraft(draft: boolean): Page;
setName(name: string): Page;
setParent(parent: Page): Page;
setTitle(title: string): Page;
/** @deprecated DO NOT USE */ addComment(content: string): Comment;
/** @deprecated DO NOT USE */ getComments(): Comment[];
/** @deprecated DO NOT USE */ getComments(
optOptions: { start?: Integer | undefined; max?: Integer | undefined },
): Comment[];
/** @deprecated DO NOT USE */ getPageName(): string;
/** @deprecated DO NOT USE */ getSelfLink(): string;
}
/**
* A typesafe enum for sites page type.
* A rebuilt
* version of Sites was launched on November 22, 2016. Apps Script cannot currently access or
* modify Sites made with this version, but script can still access
* classic Sites.
*/
enum PageType {
WEB_PAGE,
LIST_PAGE,
ANNOUNCEMENT,
ANNOUNCEMENTS_PAGE,
FILE_CABINET_PAGE,
}
/**
* An object representing a Google Site.
* A rebuilt
* version of Sites was launched on November 22, 2016. Apps Script cannot currently access or
* modify Sites made with this version, but script can still access
* classic Sites.
*/
interface Site {
addEditor(emailAddress: string): Site;
addEditor(user: Base.User): Site;
addEditors(emailAddresses: string[]): Site;
addOwner(email: string): Site;
addOwner(user: Base.User): Site;
addViewer(emailAddress: string): Site;
addViewer(user: Base.User): Site;
addViewers(emailAddresses: string[]): Site;
createAnnouncementsPage(title: string, name: string, html: string): Page;
createFileCabinetPage(title: string, name: string, html: string): Page;
createListPage(title: string, name: string, html: string, columnNames: string[]): Page;
createPageFromTemplate(title: string, name: string, template: Page): Page;
createWebPage(title: string, name: string, html: string): Page;
getAllDescendants(): Page[];
getAllDescendants(options: PageAdvancedParameters): Page[];
getChildByName(name: string): Page;
getChildren(): Page[];
getChildren(options: PageAdvancedParameters): Page[];
getEditors(): Base.User[];
getName(): string;
getOwners(): Base.User[];
getSummary(): string;
getTemplates(): Page[];
getTheme(): string;
getTitle(): string;
getUrl(): string;
getViewers(): Base.User[];
removeEditor(emailAddress: string): Site;
removeEditor(user: Base.User): Site;
removeOwner(email: string): Site;
removeOwner(user: Base.User): Site;
removeViewer(emailAddress: string): Site;
removeViewer(user: Base.User): Site;
search(query: string): Page[];
search(query: string, options: PageAdvancedParameters): Page[];
setSummary(summary: string): Site;
setTheme(theme: string): Site;
setTitle(title: string): Site;
/** @deprecated DO NOT USE */ addCollaborator(email: string): Site;
/** @deprecated DO NOT USE */ addCollaborator(user: Base.User): Site;
/** @deprecated DO NOT USE */ createAnnouncement(title: string, html: string, parent: Page): Page;
/** @deprecated DO NOT USE */ createComment(inReplyTo: string, html: string, parent: Page): Comment;
/** @deprecated DO NOT USE */ createListItem(
html: string,
columnNames: string[],
values: string[],
parent: Page,
): ListItem;
/** @deprecated DO NOT USE */ createWebAttachment(title: string, url: string, parent: Page): Attachment;
/** @deprecated DO NOT USE */ deleteSite(): void;
/** @deprecated DO NOT USE */ getAnnouncements(): Page[];
/** @deprecated DO NOT USE */ getAnnouncementsPages(): Page[];
/** @deprecated DO NOT USE */ getAttachments(): Attachment[];
/** @deprecated DO NOT USE */ getCollaborators(): Base.User[];
/** @deprecated DO NOT USE */ getComments(): Comment[];
/** @deprecated DO NOT USE */ getFileCabinetPages(): Page[];
/** @deprecated DO NOT USE */ getListItems(): ListItem[];
/** @deprecated DO NOT USE */ getListPages(): Page[];
/** @deprecated DO NOT USE */ getSelfLink(): string;
/** @deprecated DO NOT USE */ getSiteName(): string;
/** @deprecated DO NOT USE */ getWebAttachments(): Attachment[];
/** @deprecated DO NOT USE */ getWebPages(): Page[];
/** @deprecated DO NOT USE */ removeCollaborator(email: string): Site;
/** @deprecated DO NOT USE */ removeCollaborator(user: Base.User): Site;
}
/**
* Create and access Google Sites.
* A rebuilt
* version of Sites was launched on November 22, 2016. Apps Script cannot currently access or
* modify Sites made with this version, but script can still access
* classic Sites.
*/
interface SitesApp {
AttachmentType: typeof AttachmentType;
PageType: typeof PageType;
copySite(domain: string, name: string, title: string, summary: string, site: Site): Site;
createSite(domain: string, name: string, title: string, summary: string): Site;
getActivePage(): Page;
getActiveSite(): Site;
getAllSites(domain: string): Site[];
getAllSites(domain: string, start: Integer, max: Integer): Site[];
getPageByUrl(url: string): Page;
getSite(name: string): Site;
getSite(domain: string, name: string): Site;
getSiteByUrl(url: string): Site;
getSites(): Site[];
getSites(start: Integer, max: Integer): Site[];
getSites(domain: string): Site[];
getSites(domain: string, start: Integer, max: Integer): Site[];
}
}
}
declare var SitesApp: GoogleAppsScript.Sites.SitesApp;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
declare namespace GoogleAppsScript {
type BigNumber = any;
type Byte = number;
type Integer = number;
type Char = string;
type JdbcSQL_XML = any;
}

View File

@ -0,0 +1,106 @@
/// <reference path="google-apps-script.types.d.ts" />
/// <reference path="google-apps-script.base.d.ts" />
declare namespace GoogleAppsScript {
namespace URL_Fetch {
/**
* This class allows users to access specific information on HTTP responses.
* See also
*
* UrlFetchApp
*/
interface HTTPResponse {
getAllHeaders(): object;
getAs(contentType: string): Base.Blob;
getBlob(): Base.Blob;
getContent(): Byte[];
getContentText(): string;
getContentText(charset: string): string;
getHeaders(): object;
getResponseCode(): Integer;
}
interface URLFetchRequest extends URLFetchRequestOptions {
url: string;
}
interface URLFetchRequestOptions {
/**
* the content type (defaults to 'application/x-www-form-urlencoded'). Another example of content
* type is 'application/xml; charset=utf-8'.
*/
contentType?: string | undefined;
/**
* a JavaScript key/value map of HTTP headers for the request
*/
headers?: HttpHeaders | undefined;
/**
* the HTTP method for the request: get, delete, patch, post, or put. The default is get.
*/
method?: HttpMethod | undefined;
/**
* the payload (e.g. POST body) for the request. Certain HTTP methods (e.g. GET) do not accept a
* payload. It can be a string, a byte array, or a JavaScript object. A JavaScript object will be
* interpretted as a map of form field names to values, where the values can be either strings or blobs.
*/
payload?: Payload | undefined;
/**
* Deprecated. This instructs fetch to resolve the specified URL within the intranet linked to your
* domain through (deprecated) SDC
*/
useIntranet?: boolean | undefined;
/**
* if this is set to false, the fetch will ignore any invalid certificates for HTTPS requests.
* The default is true.
*/
validateHttpsCertificates?: boolean | undefined;
/**
* if this is set to false, the fetch not automatically follow HTTP redirects; it will return
* the original HTTP response. The default is true.
*/
followRedirects?: boolean | undefined;
/**
* if this is set to true, the fetch will not throw an exception if the response code indicates
* failure, and will instead return the HTTPResponse (default: false)
*/
muteHttpExceptions?: boolean | undefined;
/**
* if this is set to false, reserved characters in the URL will not be escaped (default: true)
*/
escaping?: boolean | undefined;
}
/**
* Fetch resources and communicate with other hosts over the Internet.
*
* This service allows scripts to communicate with other applications or access other resources
* on the web by fetching URLs. A script can use the URL Fetch service to issue HTTP and HTTPS
* requests and receive responses. The URL Fetch service uses Google's network infrastructure for
* efficiency and scaling purposes.
*
* Requests made using this service originate from a set pool of IP ranges. You can look up the full list of IP addresses
* if you need to whitelist or approve these requests.
*
* This service requires the https://www.googleapis.com/auth/script.external_request
* scope. In most cases Apps Script automatically detects and includes the scopes a script needs,
* but if you are setting your scopes
* explicitly you must manually add this scope to use UrlFetchApp.
* See also
*
* HTTPResponse
*
* Setting explicit scopes
*/
interface UrlFetchApp {
fetch(url: string): HTTPResponse;
fetch(url: string, params: URLFetchRequestOptions): HTTPResponse;
fetchAll(requests: Array<URLFetchRequest | string>): HTTPResponse[];
getRequest(url: string): URLFetchRequest;
getRequest(url: string, params: URLFetchRequestOptions): URLFetchRequest;
}
interface HttpHeaders {
[key: string]: string;
}
type HttpMethod = "get" | "delete" | "patch" | "post" | "put";
type Payload = string | { [key: string]: any } | Base.Blob;
}
}
declare var UrlFetchApp: GoogleAppsScript.URL_Fetch.UrlFetchApp;

View File

@ -0,0 +1,104 @@
/// <reference path="google-apps-script.types.d.ts" />
/// <reference path="google-apps-script.base.d.ts" />
declare namespace GoogleAppsScript {
namespace Utilities {
/**
* A typesafe enum for character sets.
*/
enum Charset {
US_ASCII,
UTF_8,
}
/**
* Selector of Digest algorithm.
*/
enum DigestAlgorithm {
MD2,
MD5,
SHA_1,
SHA_256,
SHA_384,
SHA_512,
}
/**
* Selector of MAC algorithm
*/
enum MacAlgorithm {
HMAC_MD5,
HMAC_SHA_1,
HMAC_SHA_256,
HMAC_SHA_384,
HMAC_SHA_512,
}
/**
* Selector of RSA algorithm
*/
enum RsaAlgorithm {
RSA_SHA_1,
RSA_SHA_256,
}
/**
* This service provides utilities for string encoding/decoding, date formatting, JSON manipulation,
* and other miscellaneous tasks.
*/
interface Utilities {
Charset: typeof Charset;
DigestAlgorithm: typeof DigestAlgorithm;
MacAlgorithm: typeof MacAlgorithm;
RsaAlgorithm: typeof RsaAlgorithm;
base64Decode(encoded: string): Byte[];
base64Decode(encoded: string, charset: Charset): Byte[];
base64DecodeWebSafe(encoded: string): Byte[];
base64DecodeWebSafe(encoded: string, charset: Charset): Byte[];
base64Encode(data: Byte[]): string;
base64Encode(data: string): string;
base64Encode(data: string, charset: Charset): string;
base64EncodeWebSafe(data: Byte[]): string;
base64EncodeWebSafe(data: string): string;
base64EncodeWebSafe(data: string, charset: Charset): string;
computeDigest(algorithm: DigestAlgorithm, value: Byte[]): Byte[];
computeDigest(algorithm: DigestAlgorithm, value: string): Byte[];
computeDigest(algorithm: DigestAlgorithm, value: string, charset: Charset): Byte[];
computeHmacSha256Signature(value: Byte[], key: Byte[]): Byte[];
computeHmacSha256Signature(value: string, key: string): Byte[];
computeHmacSha256Signature(value: string, key: string, charset: Charset): Byte[];
computeHmacSignature(algorithm: MacAlgorithm, value: Byte[], key: Byte[]): Byte[];
computeHmacSignature(algorithm: MacAlgorithm, value: string, key: string): Byte[];
computeHmacSignature(algorithm: MacAlgorithm, value: string, key: string, charset: Charset): Byte[];
computeRsaSha1Signature(value: string, key: string): Byte[];
computeRsaSha1Signature(value: string, key: string, charset: Charset): Byte[];
computeRsaSha256Signature(value: string, key: string): Byte[];
computeRsaSha256Signature(value: string, key: string, charset: Charset): Byte[];
computeRsaSignature(algorithm: RsaAlgorithm, value: string, key: string): Byte[];
computeRsaSignature(algorithm: RsaAlgorithm, value: string, key: string, charset: Charset): Byte[];
formatDate(date: Base.Date, timeZone: string, format: string): string;
formatString(template: string, ...args: any[]): string;
getUuid(): string;
gzip(blob: Base.BlobSource): Base.Blob;
gzip(blob: Base.BlobSource, name: string): Base.Blob;
newBlob(data: Byte[]): Base.Blob;
newBlob(data: Byte[], contentType: string): Base.Blob;
newBlob(data: Byte[], contentType: string, name: string): Base.Blob;
newBlob(data: string): Base.Blob;
newBlob(data: string, contentType: string): Base.Blob;
newBlob(data: string, contentType: string, name: string): Base.Blob;
parseCsv(csv: string): string[][];
parseCsv(csv: string, delimiter: Char): string[][];
parseDate(date: string, timeZone: string, format: string): Date;
sleep(milliseconds: Integer): void;
ungzip(blob: Base.BlobSource): Base.Blob;
unzip(blob: Base.BlobSource): Base.Blob[];
zip(blobs: Base.BlobSource[]): Base.Blob;
zip(blobs: Base.BlobSource[], name: string): Base.Blob;
/** @deprecated DO NOT USE */ jsonParse(jsonString: string): any;
/** @deprecated DO NOT USE */ jsonStringify(obj: any): string;
}
}
}
declare var Charset: GoogleAppsScript.Utilities.Charset;
declare var DigestAlgorithm: GoogleAppsScript.Utilities.DigestAlgorithm;
declare var MacAlgorithm: GoogleAppsScript.Utilities.MacAlgorithm;
declare var RsaAlgorithm: GoogleAppsScript.Utilities.RsaAlgorithm;
declare var Utilities: GoogleAppsScript.Utilities.Utilities;

View File

@ -0,0 +1,336 @@
/// <reference path="google-apps-script.types.d.ts" />
declare namespace GoogleAppsScript {
namespace XML_Service {
/**
* A representation of an XML attribute.
*
* // Reads the first and last name of each person and adds a new attribute with the full name.
* var xml = '<roster>'
* + '<person first="John" last="Doe"/>'
* + '<person first="Mary" last="Smith"/>'
* + '</roster>';
* var document = XmlService.parse(xml);
* var people = document.getRootElement().getChildren('person');
* for (var i = 0; i < people.length; i++) {
* var person = people[i];
* var firstName = person.getAttribute('first').getValue();
* var lastName = person.getAttribute('last').getValue();
* person.setAttribute('full', firstName + ' ' + lastName);
* }
* xml = XmlService.getPrettyFormat().format(document);
* Logger.log(xml);
*/
interface Attribute {
getName(): string;
getNamespace(): Namespace;
getValue(): string;
setName(name: string): Attribute;
setNamespace(namespace: Namespace): Attribute;
setValue(value: string): Attribute;
}
/**
* A representation of an XML CDATASection node.
*
* // Create and log an XML document that shows how special characters like '<', '>', and '&' are
* // stored in a CDATASection node as compared to in a Text node.
* var illegalCharacters = '<em>The Amazing Adventures of Kavalier & Clay</em>';
* var cdata = XmlService.createCdata(illegalCharacters);
* var text = XmlService.createText(illegalCharacters);
* var root = XmlService.createElement('root').addContent(cdata).addContent(text);
* var document = XmlService.createDocument(root);
* var xml = XmlService.getPrettyFormat().format(document);
* Logger.log(xml);
*/
interface Cdata extends Content {
append(text: string): Text;
detach(): Content;
getParentElement(): Element;
getText(): string;
getValue(): string;
setText(text: string): Text;
}
/**
* A representation of an XML Comment node.
*/
interface Comment extends Content {
detach(): Content;
getParentElement(): Element;
getText(): string;
getValue(): string;
setText(text: string): Comment;
}
/**
* A representation of a generic XML node.
* Implementing classes
*
* NameBrief description
*
* CdataA representation of an XML CDATASection node.
*
* CommentA representation of an XML Comment node.
*
* DocTypeA representation of an XML DocumentType node.
*
* ElementA representation of an XML Element node.
*
* EntityRefA representation of an XML EntityReference node.
*
* ProcessingInstructionA representation of an XML ProcessingInstruction node.
*
* TextA representation of an XML Text node.
*/
interface Content {
asCdata(): Cdata;
asComment(): Comment;
asDocType(): DocType;
asElement(): Element;
asEntityRef(): EntityRef;
asProcessingInstruction(): ProcessingInstruction;
asText(): Text;
detach(): Content;
getParentElement(): Element;
getType(): ContentType;
getValue(): string;
}
/**
* An enumeration representing the types of XML content nodes.
*/
enum ContentType {
CDATA,
COMMENT,
DOCTYPE,
ELEMENT,
ENTITYREF,
PROCESSINGINSTRUCTION,
TEXT,
}
/**
* A representation of an XML DocumentType node.
*/
interface DocType extends Content {
detach(): Content;
getElementName(): string;
getInternalSubset(): string;
getParentElement(): Element;
getPublicId(): string;
getSystemId(): string;
getValue(): string;
setElementName(name: string): DocType;
setInternalSubset(data: string): DocType;
setPublicId(id: string): DocType;
setSystemId(id: string): DocType;
}
/**
* A representation of an XML document.
*/
interface Document {
addContent(content: Content): Document;
addContent(index: Integer, content: Content): Document;
cloneContent(): Content[];
detachRootElement(): Element;
getAllContent(): Content[];
getContent(index: Integer): Content;
getContentSize(): Integer;
getDescendants(): Content[];
getDocType(): DocType;
getRootElement(): Element;
hasRootElement(): boolean;
removeContent(): Content[];
removeContent(content: Content): boolean;
removeContent(index: Integer): Content;
setDocType(docType: DocType): Document;
setRootElement(element: Element): Document;
}
/**
* A representation of an XML Element node.
*
* // Adds up the values listed in a sample XML document and adds a new element with the total.
* var xml = '<things>'
* + '<plates>12</plates>'
* + '<bowls>18</bowls>'
* + '<cups>25</cups>'
* + '</things>';
* var document = XmlService.parse(xml);
* var root = document.getRootElement();
* var items = root.getChildren();
* var total = 0;
* for (var i = 0; i < items.length; i++) {
* total += Number(items[i].getText());
* }
* var totalElement = XmlService.createElement('total').setText(total);
* root.addContent(totalElement);
* xml = XmlService.getPrettyFormat().format(document);
* Logger.log(xml);
*/
interface Element extends Content {
addContent(content: Content): Element;
addContent(index: Integer, content: Content): Element;
cloneContent(): Content[];
detach(): Content;
getAllContent(): Content[];
getAttribute(name: string): Attribute;
getAttribute(name: string, namespace: Namespace): Attribute;
getAttributes(): Attribute[];
getChild(name: string): Element;
getChild(name: string, namespace: Namespace): Element;
getChildText(name: string): string;
getChildText(name: string, namespace: Namespace): string;
getChildren(): Element[];
getChildren(name: string): Element[];
getChildren(name: string, namespace: Namespace): Element[];
getContent(index: Integer): Content;
getContentSize(): Integer;
getDescendants(): Content[];
getDocument(): Document;
getName(): string;
getNamespace(): Namespace;
getNamespace(prefix: string): Namespace;
getParentElement(): Element;
getQualifiedName(): string;
getText(): string;
getValue(): string;
isAncestorOf(other: Element): boolean;
isRootElement(): boolean;
removeAttribute(attribute: Attribute): boolean;
removeAttribute(attributeName: string): boolean;
removeAttribute(attributeName: string, namespace: Namespace): boolean;
removeContent(): Content[];
removeContent(content: Content): boolean;
removeContent(index: Integer): Content;
setAttribute(attribute: Attribute): Element;
setAttribute(name: string, value: string): Element;
setAttribute(name: string, value: string, namespace: Namespace): Element;
setName(name: string): Element;
setNamespace(namespace: Namespace): Element;
setText(text: string): Element;
}
/**
* A representation of an XML EntityReference node.
*/
interface EntityRef extends Content {
detach(): Content;
getName(): string;
getParentElement(): Element;
getPublicId(): string;
getSystemId(): string;
getValue(): string;
setName(name: string): EntityRef;
setPublicId(id: string): EntityRef;
setSystemId(id: string): EntityRef;
}
/**
* A formatter for outputting an XML document, with three pre-defined formats that can be further
* customized.
*
* // Log an XML document with specified formatting options.
* var xml = '<root><a><b>Text!</b><b>More text!</b></a></root>';
* var document = XmlService.parse(xml);
* var output = XmlService.getCompactFormat()
* .setLineSeparator('\n')
* .setEncoding('UTF-8')
* .setIndent(' ')
* .format(document);
* Logger.log(output);
*/
interface Format {
format(document: Document): string;
format(element: Element): string;
setEncoding(encoding: string): Format;
setIndent(indent: string): Format;
setLineSeparator(separator: string): Format;
setOmitDeclaration(omitDeclaration: boolean): Format;
setOmitEncoding(omitEncoding: boolean): Format;
}
/**
* A representation of an XML namespace.
*/
interface Namespace {
getPrefix(): string;
getURI(): string;
}
/**
* A representation of an XML ProcessingInstruction node.
*/
interface ProcessingInstruction extends Content {
detach(): Content;
getData(): string;
getParentElement(): Element;
getTarget(): string;
getValue(): string;
}
/**
* A representation of an XML Text node.
*/
interface Text extends Content {
append(text: string): Text;
detach(): Content;
getParentElement(): Element;
getText(): string;
getValue(): string;
setText(text: string): Text;
}
/**
* This service allows scripts to parse, navigate, and programmatically create XML documents.
*
* // Log the title and labels for the first page of blog posts on the G Suite Developer blog.
* function parseXml() {
* var url = 'https://gsuite-developers.googleblog.com/atom.xml';
* var xml = UrlFetchApp.fetch(url).getContentText();
* var document = XmlService.parse(xml);
* var root = document.getRootElement();
* var atom = XmlService.getNamespace('http://www.w3.org/2005/Atom');
*
* var entries = root.getChildren('entry', atom);
* for (var i = 0; i < entries.length; i++) {
* var title = entries[i].getChild('title', atom).getText();
* var categoryElements = entries[i].getChildren('category', atom);
* var labels = [];
* for (var j = 0; j < categoryElements.length; j++) {
* labels.push(categoryElements[j].getAttribute('term').getValue());
* }
* Logger.log('%s (%s)', title, labels.join(', '));
* }
* }
*
* // Create and log an XML representation of the threads in your Gmail inbox.
* function createXml() {
* var root = XmlService.createElement('threads');
* var threads = GmailApp.getInboxThreads();
* for (var i = 0; i < threads.length; i++) {
* var child = XmlService.createElement('thread')
* .setAttribute('messageCount', threads[i].getMessageCount())
* .setAttribute('isUnread', threads[i].isUnread())
* .setText(threads[i].getFirstMessageSubject());
* root.addContent(child);
* }
* var document = XmlService.createDocument(root);
* var xml = XmlService.getPrettyFormat().format(document);
* Logger.log(xml);
* }
*/
interface XmlService {
ContentTypes: typeof ContentType;
createCdata(text: string): Cdata;
createComment(text: string): Comment;
createDocType(elementName: string): DocType;
createDocType(elementName: string, systemId: string): DocType;
createDocType(elementName: string, publicId: string, systemId: string): DocType;
createDocument(): Document;
createDocument(rootElement: Element): Document;
createElement(name: string): Element;
createElement(name: string, namespace: Namespace): Element;
createText(text: string): Text;
getCompactFormat(): Format;
getNamespace(uri: string): Namespace;
getNamespace(prefix: string, uri: string): Namespace;
getNoNamespace(): Namespace;
getPrettyFormat(): Format;
getRawFormat(): Format;
getXmlNamespace(): Namespace;
parse(xml: string): Document;
}
}
}
declare var XmlService: GoogleAppsScript.XML_Service.XmlService;

68
node_modules/@types/google-apps-script/index.d.ts generated vendored Normal file
View File

@ -0,0 +1,68 @@
// Base Types
/// <reference path="google-apps-script.base.d.ts"/>
/// <reference path="google-apps-script.cache.d.ts"/>
/// <reference path="google-apps-script.types.d.ts"/>
// Google Services (Google APIs)
/// <reference path="google-apps-script.calendar.d.ts"/>
/// <reference path="google-apps-script.contacts.d.ts"/>
/// <reference path="google-apps-script.data-studio.d.ts"/>
/// <reference path="google-apps-script.document.d.ts"/>
/// <reference path="google-apps-script.drive.d.ts"/>
/// <reference path="google-apps-script.forms.d.ts"/>
/// <reference path="google-apps-script.gmail.d.ts"/>
/// <reference path="google-apps-script.groups.d.ts"/>
/// <reference path="google-apps-script.language.d.ts"/>
/// <reference path="google-apps-script.maps.d.ts"/>
/// <reference path="google-apps-script.sites.d.ts"/>
/// <reference path="google-apps-script.slides.d.ts"/>
/// <reference path="google-apps-script.spreadsheet.d.ts"/>
// Script Services (Other *App / *Service)
/// <reference path="google-apps-script.card-service.d.ts"/>
/// <reference path="google-apps-script.charts.d.ts"/>
/// <reference path="google-apps-script.content.d.ts"/>
/// <reference path="google-apps-script.html.d.ts"/>
/// <reference path="google-apps-script.jdbc.d.ts"/>
/// <reference path="google-apps-script.lock.d.ts"/>
/// <reference path="google-apps-script.mail.d.ts"/>
/// <reference path="google-apps-script.optimization.d.ts"/>
/// <reference path="google-apps-script.properties.d.ts"/>
/// <reference path="google-apps-script.script.d.ts"/>
/// <reference path="google-apps-script.url-fetch.d.ts"/>
/// <reference path="google-apps-script.utilities.d.ts"/>
/// <reference path="google-apps-script.xml-service.d.ts"/>
// Events
/// <reference path="google-apps-script-events.d.ts"/>
/// <reference path="addons/google-apps-script.addon-event-objects.d.ts" />
// API Types (Advanced Google Services)
/// <reference path="apis/adsense_v1_4.d.ts"/>
/// <reference path="apis/analytics_v3.d.ts"/>
/// <reference path="apis/analyticsreporting_v4.d.ts"/>
/// <reference path="apis/appsactivity_v1.d.ts"/>
/// <reference path="apis/bigquery_v2.d.ts"/>
/// <reference path="apis/calendar_v3.d.ts"/>
/// <reference path="apis/classroom_v1.d.ts"/>
/// <reference path="apis/content_v2.d.ts"/>
/// <reference path="apis/dfareporting_v3_3.d.ts"/>
/// <reference path="apis/directory_v1.d.ts"/>
/// <reference path="apis/docs_v1.d.ts"/>
/// <reference path="apis/drive_v2.d.ts"/>
/// <reference path="apis/driveactivity_v2.d.ts"/>
/// <reference path="apis/gmail_v1.d.ts"/>
/// <reference path="apis/groupsmigration_v1.d.ts"/>
/// <reference path="apis/groupssettings_v1.d.ts"/>
/// <reference path="apis/licensing_v1.d.ts"/>
/// <reference path="apis/mirror_v1.d.ts"/>
/// <reference path="apis/peopleapi_v1.d.ts"/>
/// <reference path="apis/reports_v1.d.ts"/>
/// <reference path="apis/reseller_v1.d.ts"/>
/// <reference path="apis/sheets_v4.d.ts"/>
/// <reference path="apis/slides_v1.d.ts"/>
/// <reference path="apis/tagmanager_v2.d.ts"/>
/// <reference path="apis/tasks_v1.d.ts"/>
/// <reference path="apis/youtube_v3.d.ts"/>
/// <reference path="apis/youtubeanalytics_v2.d.ts"/>
/// <reference path="apis/youtubepartner_v1.d.ts"/>

40
node_modules/@types/google-apps-script/package.json generated vendored Normal file
View File

@ -0,0 +1,40 @@
{
"name": "@types/google-apps-script",
"version": "1.0.84",
"description": "TypeScript definitions for google-apps-script",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/google-apps-script",
"license": "MIT",
"contributors": [
{
"name": "PopGoesTheWza",
"githubUsername": "PopGoesTheWza",
"url": "https://github.com/PopGoesTheWza"
},
{
"name": "motemen",
"githubUsername": "motemen",
"url": "https://github.com/motemen"
},
{
"name": "pierluigi-montagna",
"githubUsername": "pierluigi-montagna",
"url": "https://github.com/pierluigi-montagna"
},
{
"name": "mtgto",
"githubUsername": "mtgto",
"url": "https://github.com/mtgto"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/google-apps-script"
},
"scripts": {},
"dependencies": {},
"typesPublisherContentHash": "bd92fac46d3824a3ac42292c2668faf5dad2fed8bdfbbbe5187dde06cac8974a",
"typeScriptVersion": "4.8"
}

19
package-lock.json generated Normal file
View File

@ -0,0 +1,19 @@
{
"name": "product_inventory",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"devDependencies": {
"@types/google-apps-script": "^1.0.84"
}
},
"node_modules/@types/google-apps-script": {
"version": "1.0.84",
"resolved": "https://registry.npmjs.org/@types/google-apps-script/-/google-apps-script-1.0.84.tgz",
"integrity": "sha512-qZBeCyk3vJBGEiWtBSRrV89KVovdo9qruw1rQH8OZAQUgXS8RNbMKnnPI5dW+PuJwM8rMiYZpvl6LeaW9IS+WA==",
"dev": true,
"license": "MIT"
}
}
}

5
package.json Normal file
View File

@ -0,0 +1,5 @@
{
"devDependencies": {
"@types/google-apps-script": "^1.0.84"
}
}

View File

@ -4,5 +4,7 @@
"path": "." "path": "."
} }
], ],
"settings": {} "settings": {
"prettier.semi": false
}
} }

View File

@ -1,3 +0,0 @@
function myFunction() {
}

42
src/newSku.ts Normal file
View File

@ -0,0 +1,42 @@
function newSku(e: GoogleAppsScript.Events.SheetsOnEdit) {
var sheet = SpreadsheetApp.getActive().getActiveSheet()
if (sheet.getName() !== "product_inventory") {
console.log("skipping edit on sheet " + sheet.getName())
return
}
var row = e.range.getRow()
var idCell = sheet.getRange(row, 16).getCell(1, 1)
var idCellValue = idCell.getValue()
var skuPrefixCell = sheet.getRange(row, 15).getCell(1, 1)
var skuPrefixCellValue = skuPrefixCell.getValue()
console.log("skuPrefixCellValue = '" + skuPrefixCellValue + "'")
console.log("idCellValue = '" + idCellValue + "'")
if (idCellValue != "?" && idCellValue != "n") {
console.log("new ID was not requested, returning")
return
}
var idArray = sheet.getRange(2, 9, sheet.getLastRow(), 1).getValues()
var regExp = new RegExp(`^` + skuPrefixCellValue + `-0*(\\d+)$`)
console.log("regExp: " + regExp.toString())
var maxId = 0
for (let i = 0; i < idArray.length; i++) {
console.log("checking row " + (i + 1))
if (null == idArray[i] || String(idArray[i]) == "") {
console.log("ID cell looks null")
continue
}
console.log("ID cell: '" + idArray[i] + "'")
var match = regExp.exec(String(idArray[i]))
if (null === match) {
console.log("ID cell did not match")
continue
}
let numId = Number(match[1])
console.log("match: '" + match + "', numId: " + numId)
maxId = Math.max(numId, maxId)
console.log("numId: " + numId + ", maxId: " + maxId)
}
let newId = maxId + 1
console.log("newId: " + newId)
idCell.setValue(newId)
}

5
src/onEdit.ts Normal file
View File

@ -0,0 +1,5 @@
/// <reference types="@types/google-apps-script" />
function onEdit(e: GoogleAppsScript.Events.SheetsOnEdit) {
newSku(e)
}

8
src/tsconfig.json Normal file
View File

@ -0,0 +1,8 @@
{
"compilerOptions": {
"lib": [
"esnext"
],
"experimentalDecorators": true
}
}