From ac331df94f856a6c353de171a01bddc9dcbb463b Mon Sep 17 00:00:00 2001 From: Justin Poehnelt Date: Mon, 24 Nov 2025 12:11:13 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#74133=20fix(google?= =?UTF-8?q?-apps-script):=20advanced=20service=20variables=20optional=20bu?= =?UTF-8?q?t=20properties=20and=20methods=20required=20by=20@jpoehnelt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../google-apps-script/apis/adsense_v1_4.d.ts | 57 ++-- .../google-apps-script/apis/analytics_v3.d.ts | 65 ++-- .../apis/analyticsreporting_v4.d.ts | 9 +- .../apis/appsactivity_v1.d.ts | 7 +- .../google-apps-script/apis/bigquery_v2.d.ts | 15 +- .../google-apps-script/apis/calendar_v3.d.ts | 21 +- .../google-apps-script/apis/classroom_v1.d.ts | 31 +- types/google-apps-script/apis/content_v2.d.ts | 37 +-- .../apis/dfareporting_v3_3.d.ts | 129 ++++---- .../google-apps-script/apis/directory_v1.d.ts | 57 ++-- types/google-apps-script/apis/docs_v1.d.ts | 7 +- types/google-apps-script/apis/drive_v2.d.ts | 35 ++- types/google-apps-script/apis/drive_v3.d.ts | 5 +- .../apis/driveactivity_v2.d.ts | 7 +- types/google-apps-script/apis/gmail_v1.d.ts | 31 +- .../apis/groupsmigration_v1.d.ts | 7 +- .../apis/groupssettings_v1.d.ts | 7 +- .../google-apps-script/apis/licensing_v1.d.ts | 7 +- types/google-apps-script/apis/mirror_v1.d.ts | 19 +- .../google-apps-script/apis/peopleapi_v1.d.ts | 15 +- types/google-apps-script/apis/reports_v1.d.ts | 15 +- .../google-apps-script/apis/reseller_v1.d.ts | 11 +- types/google-apps-script/apis/sheets_v4.d.ts | 13 +- types/google-apps-script/apis/slides_v1.d.ts | 9 +- .../apis/tagmanager_v2.d.ts | 27 +- types/google-apps-script/apis/tasks_v1.d.ts | 9 +- types/google-apps-script/apis/youtube_v3.d.ts | 57 ++-- .../apis/youtubeanalytics_v2.d.ts | 11 +- .../apis/youtubepartner_v1.d.ts | 59 ++-- .../test/google-apps-script-apis-tests.ts | 285 ++++++++++++++++++ .../test/google-apps-script-tests.ts | 30 +- types/google-apps-script/tsconfig.json | 3 +- 32 files changed, 740 insertions(+), 357 deletions(-) create mode 100644 types/google-apps-script/test/google-apps-script-apis-tests.ts diff --git a/types/google-apps-script/apis/adsense_v1_4.d.ts b/types/google-apps-script/apis/adsense_v1_4.d.ts index 4d0e1298426346..0e425effc4d1c1 100644 --- a/types/google-apps-script/apis/adsense_v1_4.d.ts +++ b/types/google-apps-script/apis/adsense_v1_4.d.ts @@ -56,7 +56,7 @@ declare namespace GoogleAppsScript { list(accountId: string, optionalArgs: object): Adsense.Schema.AdClients; } interface AdunitsCollection { - Customchannels?: Adsense.Collection.Accounts.Adunits.CustomchannelsCollection | undefined; + Customchannels: Adsense.Collection.Accounts.Adunits.CustomchannelsCollection; // 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. @@ -75,7 +75,7 @@ declare namespace GoogleAppsScript { remove(accountId: string, alertId: string): void; } interface CustomchannelsCollection { - Adunits?: Adsense.Collection.Accounts.Customchannels.AdunitsCollection | undefined; + Adunits: Adsense.Collection.Accounts.Customchannels.AdunitsCollection; // 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. @@ -88,7 +88,7 @@ declare namespace GoogleAppsScript { list(accountId: string): Adsense.Schema.Payments; } interface ReportsCollection { - Saved?: Adsense.Collection.Accounts.Reports.SavedCollection | undefined; + Saved: Adsense.Collection.Accounts.Reports.SavedCollection; // 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, @@ -160,14 +160,14 @@ declare namespace GoogleAppsScript { } } 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; + Adclients: Adsense.Collection.Accounts.AdclientsCollection; + Adunits: Adsense.Collection.Accounts.AdunitsCollection; + Alerts: Adsense.Collection.Accounts.AlertsCollection; + Customchannels: Adsense.Collection.Accounts.CustomchannelsCollection; + Payments: Adsense.Collection.Accounts.PaymentsCollection; + Reports: Adsense.Collection.Accounts.ReportsCollection; + Savedadstyles: Adsense.Collection.Accounts.SavedadstylesCollection; + Urlchannels: Adsense.Collection.Accounts.UrlchannelsCollection; // Get information about the selected AdSense account. get(accountId: string): Adsense.Schema.Account; // Get information about the selected AdSense account. @@ -184,7 +184,7 @@ declare namespace GoogleAppsScript { list(optionalArgs: object): Adsense.Schema.AdClients; } interface AdunitsCollection { - Customchannels?: Adsense.Collection.Adunits.CustomchannelsCollection | undefined; + Customchannels: Adsense.Collection.Adunits.CustomchannelsCollection; // 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. @@ -203,7 +203,7 @@ declare namespace GoogleAppsScript { remove(alertId: string): void; } interface CustomchannelsCollection { - Adunits?: Adsense.Collection.Customchannels.AdunitsCollection | undefined; + Adunits: Adsense.Collection.Customchannels.AdunitsCollection; // 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. @@ -212,15 +212,15 @@ declare namespace GoogleAppsScript { list(adClientId: string, optionalArgs: object): Adsense.Schema.CustomChannels; } interface MetadataCollection { - Dimensions?: Adsense.Collection.Metadata.DimensionsCollection | undefined; - Metrics?: Adsense.Collection.Metadata.MetricsCollection | undefined; + Dimensions: Adsense.Collection.Metadata.DimensionsCollection; + Metrics: Adsense.Collection.Metadata.MetricsCollection; } interface PaymentsCollection { // List the payments for this AdSense account. list(): Adsense.Schema.Payments; } interface ReportsCollection { - Saved?: Adsense.Collection.Reports.SavedCollection | undefined; + Saved: Adsense.Collection.Reports.SavedCollection; // 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. @@ -445,17 +445,20 @@ declare namespace GoogleAppsScript { } } 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; + Accounts: Adsense.Collection.AccountsCollection; + Adclients: Adsense.Collection.AdclientsCollection; + Adunits: Adsense.Collection.AdunitsCollection; + Alerts: Adsense.Collection.AlertsCollection; + Customchannels: Adsense.Collection.CustomchannelsCollection; + Metadata: Adsense.Collection.MetadataCollection; + Payments: Adsense.Collection.PaymentsCollection; + Reports: Adsense.Collection.ReportsCollection; + Savedadstyles: Adsense.Collection.SavedadstylesCollection; + Urlchannels: Adsense.Collection.UrlchannelsCollection; } } -declare var Adsense: GoogleAppsScript.Adsense; +/** + * The `Adsense` advanced service must be enabled. + */ +declare var Adsense: GoogleAppsScript.Adsense | undefined; diff --git a/types/google-apps-script/apis/analytics_v3.d.ts b/types/google-apps-script/apis/analytics_v3.d.ts index a75fc02b171053..d0807493456adf 100644 --- a/types/google-apps-script/apis/analytics_v3.d.ts +++ b/types/google-apps-script/apis/analytics_v3.d.ts @@ -592,34 +592,34 @@ declare namespace GoogleAppsScript { } } interface DataCollection { - Ga?: Analytics.Collection.Data.GaCollection | undefined; - Mcf?: Analytics.Collection.Data.McfCollection | undefined; - Realtime?: Analytics.Collection.Data.RealtimeCollection | undefined; + Ga: Analytics.Collection.Data.GaCollection; + Mcf: Analytics.Collection.Data.McfCollection; + Realtime: Analytics.Collection.Data.RealtimeCollection; } interface ManagementCollection { - AccountSummaries?: Analytics.Collection.Management.AccountSummariesCollection | undefined; - AccountUserLinks?: Analytics.Collection.Management.AccountUserLinksCollection | undefined; - Accounts?: Analytics.Collection.Management.AccountsCollection | undefined; - ClientId?: Analytics.Collection.Management.ClientIdCollection | undefined; - CustomDataSources?: Analytics.Collection.Management.CustomDataSourcesCollection | undefined; - CustomDimensions?: Analytics.Collection.Management.CustomDimensionsCollection | undefined; - CustomMetrics?: Analytics.Collection.Management.CustomMetricsCollection | undefined; - Experiments?: Analytics.Collection.Management.ExperimentsCollection | undefined; - Filters?: Analytics.Collection.Management.FiltersCollection | undefined; - Goals?: Analytics.Collection.Management.GoalsCollection | undefined; - ProfileFilterLinks?: Analytics.Collection.Management.ProfileFilterLinksCollection | undefined; - ProfileUserLinks?: Analytics.Collection.Management.ProfileUserLinksCollection | undefined; - Profiles?: Analytics.Collection.Management.ProfilesCollection | undefined; - RemarketingAudience?: Analytics.Collection.Management.RemarketingAudienceCollection | undefined; - Segments?: Analytics.Collection.Management.SegmentsCollection | undefined; - UnsampledReports?: Analytics.Collection.Management.UnsampledReportsCollection | undefined; - Uploads?: Analytics.Collection.Management.UploadsCollection | undefined; - WebPropertyAdWordsLinks?: Analytics.Collection.Management.WebPropertyAdWordsLinksCollection | undefined; - Webproperties?: Analytics.Collection.Management.WebpropertiesCollection | undefined; - WebpropertyUserLinks?: Analytics.Collection.Management.WebpropertyUserLinksCollection | undefined; + AccountSummaries: Analytics.Collection.Management.AccountSummariesCollection; + AccountUserLinks: Analytics.Collection.Management.AccountUserLinksCollection; + Accounts: Analytics.Collection.Management.AccountsCollection; + ClientId: Analytics.Collection.Management.ClientIdCollection; + CustomDataSources: Analytics.Collection.Management.CustomDataSourcesCollection; + CustomDimensions: Analytics.Collection.Management.CustomDimensionsCollection; + CustomMetrics: Analytics.Collection.Management.CustomMetricsCollection; + Experiments: Analytics.Collection.Management.ExperimentsCollection; + Filters: Analytics.Collection.Management.FiltersCollection; + Goals: Analytics.Collection.Management.GoalsCollection; + ProfileFilterLinks: Analytics.Collection.Management.ProfileFilterLinksCollection; + ProfileUserLinks: Analytics.Collection.Management.ProfileUserLinksCollection; + Profiles: Analytics.Collection.Management.ProfilesCollection; + RemarketingAudience: Analytics.Collection.Management.RemarketingAudienceCollection; + Segments: Analytics.Collection.Management.SegmentsCollection; + UnsampledReports: Analytics.Collection.Management.UnsampledReportsCollection; + Uploads: Analytics.Collection.Management.UploadsCollection; + WebPropertyAdWordsLinks: Analytics.Collection.Management.WebPropertyAdWordsLinksCollection; + Webproperties: Analytics.Collection.Management.WebpropertiesCollection; + WebpropertyUserLinks: Analytics.Collection.Management.WebpropertyUserLinksCollection; } interface MetadataCollection { - Columns?: Analytics.Collection.Metadata.ColumnsCollection | undefined; + Columns: Analytics.Collection.Metadata.ColumnsCollection; } interface ProvisioningCollection { // Creates an account ticket. @@ -628,7 +628,7 @@ declare namespace GoogleAppsScript { createAccountTree(resource: Schema.AccountTreeRequest): Analytics.Schema.AccountTreeResponse; } interface UserDeletionCollection { - UserDeletionRequest?: Analytics.Collection.UserDeletion.UserDeletionRequestCollection | undefined; + UserDeletionRequest: Analytics.Collection.UserDeletion.UserDeletionRequestCollection; } } namespace Schema { @@ -1524,11 +1524,11 @@ declare namespace GoogleAppsScript { } } interface Analytics { - Data?: Analytics.Collection.DataCollection | undefined; - Management?: Analytics.Collection.ManagementCollection | undefined; - Metadata?: Analytics.Collection.MetadataCollection | undefined; - Provisioning?: Analytics.Collection.ProvisioningCollection | undefined; - UserDeletion?: Analytics.Collection.UserDeletionCollection | undefined; + Data: Analytics.Collection.DataCollection; + Management: Analytics.Collection.ManagementCollection; + Metadata: Analytics.Collection.MetadataCollection; + Provisioning: Analytics.Collection.ProvisioningCollection; + UserDeletion: Analytics.Collection.UserDeletionCollection; // Create a new instance of Account newAccount(): Analytics.Schema.Account; // Create a new instance of AccountChildLink @@ -1652,4 +1652,7 @@ declare namespace GoogleAppsScript { } } -declare var Analytics: GoogleAppsScript.Analytics; +/** + * The `Analytics` advanced service must be enabled. + */ +declare var Analytics: GoogleAppsScript.Analytics | undefined; diff --git a/types/google-apps-script/apis/analyticsreporting_v4.d.ts b/types/google-apps-script/apis/analyticsreporting_v4.d.ts index 4edd806ed77430..42bd828d10dde9 100644 --- a/types/google-apps-script/apis/analyticsreporting_v4.d.ts +++ b/types/google-apps-script/apis/analyticsreporting_v4.d.ts @@ -297,8 +297,8 @@ declare namespace GoogleAppsScript { } } interface AnalyticsReporting { - Reports?: AnalyticsReporting.Collection.ReportsCollection | undefined; - UserActivity?: AnalyticsReporting.Collection.UserActivityCollection | undefined; + Reports: AnalyticsReporting.Collection.ReportsCollection; + UserActivity: AnalyticsReporting.Collection.UserActivityCollection; // Create a new instance of Cohort newCohort(): AnalyticsReporting.Schema.Cohort; // Create a new instance of CohortGroup @@ -354,4 +354,7 @@ declare namespace GoogleAppsScript { } } -declare var AnalyticsReporting: GoogleAppsScript.AnalyticsReporting; +/** + * The `AnalyticsReporting` advanced service must be enabled. + */ +declare var AnalyticsReporting: GoogleAppsScript.AnalyticsReporting | undefined; diff --git a/types/google-apps-script/apis/appsactivity_v1.d.ts b/types/google-apps-script/apis/appsactivity_v1.d.ts index cedcd41ecdb1ff..201abc9bc5d063 100644 --- a/types/google-apps-script/apis/appsactivity_v1.d.ts +++ b/types/google-apps-script/apis/appsactivity_v1.d.ts @@ -71,8 +71,11 @@ declare namespace GoogleAppsScript { } } interface Appsactivity { - Activities?: Appsactivity.Collection.ActivitiesCollection | undefined; + Activities: Appsactivity.Collection.ActivitiesCollection; } } -declare var Appsactivity: GoogleAppsScript.Appsactivity; +/** + * The `Appsactivity` advanced service must be enabled. + */ +declare var Appsactivity: GoogleAppsScript.Appsactivity | undefined; diff --git a/types/google-apps-script/apis/bigquery_v2.d.ts b/types/google-apps-script/apis/bigquery_v2.d.ts index 66b49f81c6d7eb..7abf2c526c6f2c 100644 --- a/types/google-apps-script/apis/bigquery_v2.d.ts +++ b/types/google-apps-script/apis/bigquery_v2.d.ts @@ -698,11 +698,11 @@ declare namespace GoogleAppsScript { } } 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; + Datasets: BigQuery.Collection.DatasetsCollection; + Jobs: BigQuery.Collection.JobsCollection; + Projects: BigQuery.Collection.ProjectsCollection; + Tabledata: BigQuery.Collection.TabledataCollection; + Tables: BigQuery.Collection.TablesCollection; // Create a new instance of BigQueryModelTraining newBigQueryModelTraining(): BigQuery.Schema.BigQueryModelTraining; // Create a new instance of BigtableColumn @@ -818,4 +818,7 @@ declare namespace GoogleAppsScript { } } -declare var BigQuery: GoogleAppsScript.BigQuery; +/** + * The `BigQuery` advanced service must be enabled. + */ +declare var BigQuery: GoogleAppsScript.BigQuery | undefined; diff --git a/types/google-apps-script/apis/calendar_v3.d.ts b/types/google-apps-script/apis/calendar_v3.d.ts index 141b833c9a1e60..bac501dfa663eb 100644 --- a/types/google-apps-script/apis/calendar_v3.d.ts +++ b/types/google-apps-script/apis/calendar_v3.d.ts @@ -653,14 +653,14 @@ declare namespace GoogleAppsScript { } } 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; + Acl: Calendar.Collection.AclCollection; + CalendarList: Calendar.Collection.CalendarListCollection; + Calendars: Calendar.Collection.CalendarsCollection; + Channels: Calendar.Collection.ChannelsCollection; + Colors: Calendar.Collection.ColorsCollection; + Events: Calendar.Collection.EventsCollection; + Freebusy: Calendar.Collection.FreebusyCollection; + Settings: Calendar.Collection.SettingsCollection; // Create a new instance of AclRule newAclRule(): Calendar.Schema.AclRule; // Create a new instance of AclRuleScope @@ -728,4 +728,7 @@ declare namespace GoogleAppsScript { } } -declare var Calendar: GoogleAppsScript.Calendar; +/** + * The `Calendar` advanced service must be enabled. + */ +declare var Calendar: GoogleAppsScript.Calendar | undefined; diff --git a/types/google-apps-script/apis/classroom_v1.d.ts b/types/google-apps-script/apis/classroom_v1.d.ts index 78cbdde57de816..b7d283e9a2705b 100644 --- a/types/google-apps-script/apis/classroom_v1.d.ts +++ b/types/google-apps-script/apis/classroom_v1.d.ts @@ -421,13 +421,13 @@ declare namespace GoogleAppsScript { } } 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; + Aliases: Classroom.Collection.Courses.AliasesCollection; + Announcements: Classroom.Collection.Courses.AnnouncementsCollection; + CourseWork: Classroom.Collection.Courses.CourseWorkCollection; + CourseWorkMaterials: Classroom.Collection.Courses.CourseWorkMaterialsCollection; + Students: Classroom.Collection.Courses.StudentsCollection; + Teachers: Classroom.Collection.Courses.TeachersCollection; + Topics: Classroom.Collection.Courses.TopicsCollection; // 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. @@ -507,8 +507,8 @@ declare namespace GoogleAppsScript { remove(registrationId: string): void; } interface UserProfilesCollection { - GuardianInvitations?: Classroom.Collection.UserProfiles.GuardianInvitationsCollection | undefined; - Guardians?: Classroom.Collection.UserProfiles.GuardiansCollection | undefined; + GuardianInvitations: Classroom.Collection.UserProfiles.GuardianInvitationsCollection; + Guardians: Classroom.Collection.UserProfiles.GuardiansCollection; // 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; @@ -848,10 +848,10 @@ declare namespace GoogleAppsScript { } } interface Classroom { - Courses?: Classroom.Collection.CoursesCollection | undefined; - Invitations?: Classroom.Collection.InvitationsCollection | undefined; - Registrations?: Classroom.Collection.RegistrationsCollection | undefined; - UserProfiles?: Classroom.Collection.UserProfilesCollection | undefined; + Courses: Classroom.Collection.CoursesCollection; + Invitations: Classroom.Collection.InvitationsCollection; + Registrations: Classroom.Collection.RegistrationsCollection; + UserProfiles: Classroom.Collection.UserProfilesCollection; // Create a new instance of Announcement newAnnouncement(): Classroom.Schema.Announcement; // Create a new instance of Assignment @@ -943,4 +943,7 @@ declare namespace GoogleAppsScript { } } -declare var Classroom: GoogleAppsScript.Classroom; +/** + * The `Classroom` advanced service must be enabled. + */ +declare var Classroom: GoogleAppsScript.Classroom | undefined; diff --git a/types/google-apps-script/apis/content_v2.d.ts b/types/google-apps-script/apis/content_v2.d.ts index 3afceab8bc1621..82b22370bf5b07 100644 --- a/types/google-apps-script/apis/content_v2.d.ts +++ b/types/google-apps-script/apis/content_v2.d.ts @@ -2337,22 +2337,22 @@ declare namespace GoogleAppsScript { } } interface Content { - Accounts?: Content.Collection.AccountsCollection | undefined; - Accountstatuses?: Content.Collection.AccountstatusesCollection | undefined; - Accounttax?: Content.Collection.AccounttaxCollection | undefined; - Datafeeds?: Content.Collection.DatafeedsCollection | undefined; - Datafeedstatuses?: Content.Collection.DatafeedstatusesCollection | undefined; - Inventory?: Content.Collection.InventoryCollection | undefined; - Liasettings?: Content.Collection.LiasettingsCollection | undefined; - Orderinvoices?: Content.Collection.OrderinvoicesCollection | undefined; - Orderpayments?: Content.Collection.OrderpaymentsCollection | undefined; - Orderreports?: Content.Collection.OrderreportsCollection | undefined; - Orderreturns?: Content.Collection.OrderreturnsCollection | undefined; - Orders?: Content.Collection.OrdersCollection | undefined; - Pos?: Content.Collection.PosCollection | undefined; - Products?: Content.Collection.ProductsCollection | undefined; - Productstatuses?: Content.Collection.ProductstatusesCollection | undefined; - Shippingsettings?: Content.Collection.ShippingsettingsCollection | undefined; + Accounts: Content.Collection.AccountsCollection; + Accountstatuses: Content.Collection.AccountstatusesCollection; + Accounttax: Content.Collection.AccounttaxCollection; + Datafeeds: Content.Collection.DatafeedsCollection; + Datafeedstatuses: Content.Collection.DatafeedstatusesCollection; + Inventory: Content.Collection.InventoryCollection; + Liasettings: Content.Collection.LiasettingsCollection; + Orderinvoices: Content.Collection.OrderinvoicesCollection; + Orderpayments: Content.Collection.OrderpaymentsCollection; + Orderreports: Content.Collection.OrderreportsCollection; + Orderreturns: Content.Collection.OrderreturnsCollection; + Orders: Content.Collection.OrdersCollection; + Pos: Content.Collection.PosCollection; + Products: Content.Collection.ProductsCollection; + Productstatuses: Content.Collection.ProductstatusesCollection; + Shippingsettings: Content.Collection.ShippingsettingsCollection; // Create a new instance of Account newAccount(): Content.Schema.Account; // Create a new instance of AccountAddress @@ -2650,4 +2650,7 @@ declare namespace GoogleAppsScript { } } -declare var Content: GoogleAppsScript.Content; +/** + * The `Content` advanced service must be enabled. + */ +declare var Content: GoogleAppsScript.Content | undefined; diff --git a/types/google-apps-script/apis/dfareporting_v3_3.d.ts b/types/google-apps-script/apis/dfareporting_v3_3.d.ts index 045d84d92099af..cccdb24f816ff6 100644 --- a/types/google-apps-script/apis/dfareporting_v3_3.d.ts +++ b/types/google-apps-script/apis/dfareporting_v3_3.d.ts @@ -631,8 +631,8 @@ declare namespace GoogleAppsScript { update(resource: Schema.RemarketingList, profileId: string): Dfareporting.Schema.RemarketingList; } interface ReportsCollection { - CompatibleFields?: Dfareporting.Collection.Reports.CompatibleFieldsCollection | undefined; - Files?: Dfareporting.Collection.Reports.FilesCollection | undefined; + CompatibleFields: Dfareporting.Collection.Reports.CompatibleFieldsCollection; + Files: Dfareporting.Collection.Reports.FilesCollection; // Retrieves a report by its ID. get(profileId: string, reportId: string): Dfareporting.Schema.Report; // Creates a report. @@ -2565,66 +2565,66 @@ declare namespace GoogleAppsScript { } } interface Dfareporting { - AccountActiveAdSummaries?: Dfareporting.Collection.AccountActiveAdSummariesCollection | undefined; - AccountPermissionGroups?: Dfareporting.Collection.AccountPermissionGroupsCollection | undefined; - AccountPermissions?: Dfareporting.Collection.AccountPermissionsCollection | undefined; - AccountUserProfiles?: Dfareporting.Collection.AccountUserProfilesCollection | undefined; - Accounts?: Dfareporting.Collection.AccountsCollection | undefined; - Ads?: Dfareporting.Collection.AdsCollection | undefined; - AdvertiserGroups?: Dfareporting.Collection.AdvertiserGroupsCollection | undefined; - AdvertiserLandingPages?: Dfareporting.Collection.AdvertiserLandingPagesCollection | undefined; - Advertisers?: Dfareporting.Collection.AdvertisersCollection | undefined; - Browsers?: Dfareporting.Collection.BrowsersCollection | undefined; - CampaignCreativeAssociations?: Dfareporting.Collection.CampaignCreativeAssociationsCollection | undefined; - Campaigns?: Dfareporting.Collection.CampaignsCollection | undefined; - ChangeLogs?: Dfareporting.Collection.ChangeLogsCollection | undefined; - Cities?: Dfareporting.Collection.CitiesCollection | undefined; - ConnectionTypes?: Dfareporting.Collection.ConnectionTypesCollection | undefined; - ContentCategories?: Dfareporting.Collection.ContentCategoriesCollection | undefined; - Conversions?: Dfareporting.Collection.ConversionsCollection | undefined; - Countries?: Dfareporting.Collection.CountriesCollection | undefined; - CreativeAssets?: Dfareporting.Collection.CreativeAssetsCollection | undefined; - CreativeFieldValues?: Dfareporting.Collection.CreativeFieldValuesCollection | undefined; - CreativeFields?: Dfareporting.Collection.CreativeFieldsCollection | undefined; - CreativeGroups?: Dfareporting.Collection.CreativeGroupsCollection | undefined; - Creatives?: Dfareporting.Collection.CreativesCollection | undefined; - DimensionValues?: Dfareporting.Collection.DimensionValuesCollection | undefined; - DirectorySites?: Dfareporting.Collection.DirectorySitesCollection | undefined; - DynamicTargetingKeys?: Dfareporting.Collection.DynamicTargetingKeysCollection | undefined; - EventTags?: Dfareporting.Collection.EventTagsCollection | undefined; - Files?: Dfareporting.Collection.FilesCollection | undefined; - FloodlightActivities?: Dfareporting.Collection.FloodlightActivitiesCollection | undefined; - FloodlightActivityGroups?: Dfareporting.Collection.FloodlightActivityGroupsCollection | undefined; - FloodlightConfigurations?: Dfareporting.Collection.FloodlightConfigurationsCollection | undefined; - InventoryItems?: Dfareporting.Collection.InventoryItemsCollection | undefined; - Languages?: Dfareporting.Collection.LanguagesCollection | undefined; - Metros?: Dfareporting.Collection.MetrosCollection | undefined; - MobileApps?: Dfareporting.Collection.MobileAppsCollection | undefined; - MobileCarriers?: Dfareporting.Collection.MobileCarriersCollection | undefined; - OperatingSystemVersions?: Dfareporting.Collection.OperatingSystemVersionsCollection | undefined; - OperatingSystems?: Dfareporting.Collection.OperatingSystemsCollection | undefined; - OrderDocuments?: Dfareporting.Collection.OrderDocumentsCollection | undefined; - Orders?: Dfareporting.Collection.OrdersCollection | undefined; - PlacementGroups?: Dfareporting.Collection.PlacementGroupsCollection | undefined; - PlacementStrategies?: Dfareporting.Collection.PlacementStrategiesCollection | undefined; - Placements?: Dfareporting.Collection.PlacementsCollection | undefined; - PlatformTypes?: Dfareporting.Collection.PlatformTypesCollection | undefined; - PostalCodes?: Dfareporting.Collection.PostalCodesCollection | undefined; - Projects?: Dfareporting.Collection.ProjectsCollection | undefined; - Regions?: Dfareporting.Collection.RegionsCollection | undefined; - RemarketingListShares?: Dfareporting.Collection.RemarketingListSharesCollection | undefined; - RemarketingLists?: Dfareporting.Collection.RemarketingListsCollection | undefined; - Reports?: Dfareporting.Collection.ReportsCollection | undefined; - Sites?: Dfareporting.Collection.SitesCollection | undefined; - Sizes?: Dfareporting.Collection.SizesCollection | undefined; - Subaccounts?: Dfareporting.Collection.SubaccountsCollection | undefined; - TargetableRemarketingLists?: Dfareporting.Collection.TargetableRemarketingListsCollection | undefined; - TargetingTemplates?: Dfareporting.Collection.TargetingTemplatesCollection | undefined; - UserProfiles?: Dfareporting.Collection.UserProfilesCollection | undefined; - UserRolePermissionGroups?: Dfareporting.Collection.UserRolePermissionGroupsCollection | undefined; - UserRolePermissions?: Dfareporting.Collection.UserRolePermissionsCollection | undefined; - UserRoles?: Dfareporting.Collection.UserRolesCollection | undefined; - VideoFormats?: Dfareporting.Collection.VideoFormatsCollection | undefined; + AccountActiveAdSummaries: Dfareporting.Collection.AccountActiveAdSummariesCollection; + AccountPermissionGroups: Dfareporting.Collection.AccountPermissionGroupsCollection; + AccountPermissions: Dfareporting.Collection.AccountPermissionsCollection; + AccountUserProfiles: Dfareporting.Collection.AccountUserProfilesCollection; + Accounts: Dfareporting.Collection.AccountsCollection; + Ads: Dfareporting.Collection.AdsCollection; + AdvertiserGroups: Dfareporting.Collection.AdvertiserGroupsCollection; + AdvertiserLandingPages: Dfareporting.Collection.AdvertiserLandingPagesCollection; + Advertisers: Dfareporting.Collection.AdvertisersCollection; + Browsers: Dfareporting.Collection.BrowsersCollection; + CampaignCreativeAssociations: Dfareporting.Collection.CampaignCreativeAssociationsCollection; + Campaigns: Dfareporting.Collection.CampaignsCollection; + ChangeLogs: Dfareporting.Collection.ChangeLogsCollection; + Cities: Dfareporting.Collection.CitiesCollection; + ConnectionTypes: Dfareporting.Collection.ConnectionTypesCollection; + ContentCategories: Dfareporting.Collection.ContentCategoriesCollection; + Conversions: Dfareporting.Collection.ConversionsCollection; + Countries: Dfareporting.Collection.CountriesCollection; + CreativeAssets: Dfareporting.Collection.CreativeAssetsCollection; + CreativeFieldValues: Dfareporting.Collection.CreativeFieldValuesCollection; + CreativeFields: Dfareporting.Collection.CreativeFieldsCollection; + CreativeGroups: Dfareporting.Collection.CreativeGroupsCollection; + Creatives: Dfareporting.Collection.CreativesCollection; + DimensionValues: Dfareporting.Collection.DimensionValuesCollection; + DirectorySites: Dfareporting.Collection.DirectorySitesCollection; + DynamicTargetingKeys: Dfareporting.Collection.DynamicTargetingKeysCollection; + EventTags: Dfareporting.Collection.EventTagsCollection; + Files: Dfareporting.Collection.FilesCollection; + FloodlightActivities: Dfareporting.Collection.FloodlightActivitiesCollection; + FloodlightActivityGroups: Dfareporting.Collection.FloodlightActivityGroupsCollection; + FloodlightConfigurations: Dfareporting.Collection.FloodlightConfigurationsCollection; + InventoryItems: Dfareporting.Collection.InventoryItemsCollection; + Languages: Dfareporting.Collection.LanguagesCollection; + Metros: Dfareporting.Collection.MetrosCollection; + MobileApps: Dfareporting.Collection.MobileAppsCollection; + MobileCarriers: Dfareporting.Collection.MobileCarriersCollection; + OperatingSystemVersions: Dfareporting.Collection.OperatingSystemVersionsCollection; + OperatingSystems: Dfareporting.Collection.OperatingSystemsCollection; + OrderDocuments: Dfareporting.Collection.OrderDocumentsCollection; + Orders: Dfareporting.Collection.OrdersCollection; + PlacementGroups: Dfareporting.Collection.PlacementGroupsCollection; + PlacementStrategies: Dfareporting.Collection.PlacementStrategiesCollection; + Placements: Dfareporting.Collection.PlacementsCollection; + PlatformTypes: Dfareporting.Collection.PlatformTypesCollection; + PostalCodes: Dfareporting.Collection.PostalCodesCollection; + Projects: Dfareporting.Collection.ProjectsCollection; + Regions: Dfareporting.Collection.RegionsCollection; + RemarketingListShares: Dfareporting.Collection.RemarketingListSharesCollection; + RemarketingLists: Dfareporting.Collection.RemarketingListsCollection; + Reports: Dfareporting.Collection.ReportsCollection; + Sites: Dfareporting.Collection.SitesCollection; + Sizes: Dfareporting.Collection.SizesCollection; + Subaccounts: Dfareporting.Collection.SubaccountsCollection; + TargetableRemarketingLists: Dfareporting.Collection.TargetableRemarketingListsCollection; + TargetingTemplates: Dfareporting.Collection.TargetingTemplatesCollection; + UserProfiles: Dfareporting.Collection.UserProfilesCollection; + UserRolePermissionGroups: Dfareporting.Collection.UserRolePermissionGroupsCollection; + UserRolePermissions: Dfareporting.Collection.UserRolePermissionsCollection; + UserRoles: Dfareporting.Collection.UserRolesCollection; + VideoFormats: Dfareporting.Collection.VideoFormatsCollection; // Create a new instance of Account newAccount(): Dfareporting.Schema.Account; // Create a new instance of AccountUserProfile @@ -2900,4 +2900,7 @@ declare namespace GoogleAppsScript { } } -declare var Dfareporting: GoogleAppsScript.Dfareporting; +/** + * The `Dfareporting` advanced service must be enabled. + */ +declare var Dfareporting: GoogleAppsScript.Dfareporting | undefined; diff --git a/types/google-apps-script/apis/directory_v1.d.ts b/types/google-apps-script/apis/directory_v1.d.ts index b851c36e1e26c1..488f3298a570a5 100644 --- a/types/google-apps-script/apis/directory_v1.d.ts +++ b/types/google-apps-script/apis/directory_v1.d.ts @@ -226,7 +226,7 @@ declare namespace GoogleAppsScript { remove(customer: string, domainName: string): void; } interface GroupsCollection { - Aliases?: AdminDirectory.Collection.Groups.AliasesCollection | undefined; + Aliases: AdminDirectory.Collection.Groups.AliasesCollection; // Retrieve Group get(groupKey: string): AdminDirectory.Schema.Group; // Create Group @@ -331,9 +331,9 @@ declare namespace GoogleAppsScript { ListTrustedApps(): AdminDirectory.Schema.TrustedApps; } interface ResourcesCollection { - Buildings?: AdminDirectory.Collection.Resources.BuildingsCollection | undefined; - Calendars?: AdminDirectory.Collection.Resources.CalendarsCollection | undefined; - Features?: AdminDirectory.Collection.Resources.FeaturesCollection | undefined; + Buildings: AdminDirectory.Collection.Resources.BuildingsCollection; + Calendars: AdminDirectory.Collection.Resources.CalendarsCollection; + Features: AdminDirectory.Collection.Resources.FeaturesCollection; } interface RoleAssignmentsCollection { // Retrieve a role assignment. @@ -386,8 +386,8 @@ declare namespace GoogleAppsScript { remove(userKey: string, clientId: string): void; } interface UsersCollection { - Aliases?: AdminDirectory.Collection.Users.AliasesCollection | undefined; - Photos?: AdminDirectory.Collection.Users.PhotosCollection | undefined; + Aliases: AdminDirectory.Collection.Users.AliasesCollection; + Photos: AdminDirectory.Collection.Users.PhotosCollection; // retrieve user get(userKey: string): AdminDirectory.Schema.User; // retrieve user @@ -1114,26 +1114,26 @@ declare namespace GoogleAppsScript { } } interface AdminDirectory { - Asps?: AdminDirectory.Collection.AspsCollection | undefined; - Channels?: AdminDirectory.Collection.ChannelsCollection | undefined; - Chromeosdevices?: AdminDirectory.Collection.ChromeosdevicesCollection | undefined; - Customers?: AdminDirectory.Collection.CustomersCollection | undefined; - DomainAliases?: AdminDirectory.Collection.DomainAliasesCollection | undefined; - Domains?: AdminDirectory.Collection.DomainsCollection | undefined; - Groups?: AdminDirectory.Collection.GroupsCollection | undefined; - Members?: AdminDirectory.Collection.MembersCollection | undefined; - Mobiledevices?: AdminDirectory.Collection.MobiledevicesCollection | undefined; - Notifications?: AdminDirectory.Collection.NotificationsCollection | undefined; - Orgunits?: AdminDirectory.Collection.OrgunitsCollection | undefined; - Privileges?: AdminDirectory.Collection.PrivilegesCollection | undefined; - ResolvedAppAccessSettings?: AdminDirectory.Collection.ResolvedAppAccessSettingsCollection | undefined; - Resources?: AdminDirectory.Collection.ResourcesCollection | undefined; - RoleAssignments?: AdminDirectory.Collection.RoleAssignmentsCollection | undefined; - Roles?: AdminDirectory.Collection.RolesCollection | undefined; - Schemas?: AdminDirectory.Collection.SchemasCollection | undefined; - Tokens?: AdminDirectory.Collection.TokensCollection | undefined; - Users?: AdminDirectory.Collection.UsersCollection | undefined; - VerificationCodes?: AdminDirectory.Collection.VerificationCodesCollection | undefined; + Asps: AdminDirectory.Collection.AspsCollection; + Channels: AdminDirectory.Collection.ChannelsCollection; + Chromeosdevices: AdminDirectory.Collection.ChromeosdevicesCollection; + Customers: AdminDirectory.Collection.CustomersCollection; + DomainAliases: AdminDirectory.Collection.DomainAliasesCollection; + Domains: AdminDirectory.Collection.DomainsCollection; + Groups: AdminDirectory.Collection.GroupsCollection; + Members: AdminDirectory.Collection.MembersCollection; + Mobiledevices: AdminDirectory.Collection.MobiledevicesCollection; + Notifications: AdminDirectory.Collection.NotificationsCollection; + Orgunits: AdminDirectory.Collection.OrgunitsCollection; + Privileges: AdminDirectory.Collection.PrivilegesCollection; + ResolvedAppAccessSettings: AdminDirectory.Collection.ResolvedAppAccessSettingsCollection; + Resources: AdminDirectory.Collection.ResourcesCollection; + RoleAssignments: AdminDirectory.Collection.RoleAssignmentsCollection; + Roles: AdminDirectory.Collection.RolesCollection; + Schemas: AdminDirectory.Collection.SchemasCollection; + Tokens: AdminDirectory.Collection.TokensCollection; + Users: AdminDirectory.Collection.UsersCollection; + VerificationCodes: AdminDirectory.Collection.VerificationCodesCollection; // Create a new instance of Alias newAlias(): AdminDirectory.Schema.Alias; // Create a new instance of Building @@ -1217,4 +1217,7 @@ declare namespace GoogleAppsScript { } } -declare var AdminDirectory: GoogleAppsScript.AdminDirectory; +/** + * The `AdminDirectory` advanced service must be enabled. + */ +declare var AdminDirectory: GoogleAppsScript.AdminDirectory | undefined; diff --git a/types/google-apps-script/apis/docs_v1.d.ts b/types/google-apps-script/apis/docs_v1.d.ts index 6e728febb1fe78..e5b4c81387e2ca 100644 --- a/types/google-apps-script/apis/docs_v1.d.ts +++ b/types/google-apps-script/apis/docs_v1.d.ts @@ -770,7 +770,7 @@ declare namespace GoogleAppsScript { } } interface Docs { - Documents?: Docs.Collection.DocumentsCollection | undefined; + Documents: Docs.Collection.DocumentsCollection; // Create a new instance of AutoText newAutoText(): Docs.Schema.AutoText; // Create a new instance of Background @@ -906,4 +906,7 @@ declare namespace GoogleAppsScript { } } -declare var Docs: GoogleAppsScript.Docs; +/** + * The `Docs` advanced service must be enabled. + */ +declare var Docs: GoogleAppsScript.Docs | undefined; diff --git a/types/google-apps-script/apis/drive_v2.d.ts b/types/google-apps-script/apis/drive_v2.d.ts index d93421a4ecbe9d..17587351178f7a 100644 --- a/types/google-apps-script/apis/drive_v2.d.ts +++ b/types/google-apps-script/apis/drive_v2.d.ts @@ -928,21 +928,21 @@ declare namespace GoogleAppsScript { } } interface Drive_v2 { - 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; + About: Drive.Collection.AboutCollection; + Apps: Drive.Collection.AppsCollection; + Changes: Drive.Collection.ChangesCollection; + Channels: Drive.Collection.ChannelsCollection; + Children: Drive.Collection.ChildrenCollection; + Comments: Drive.Collection.CommentsCollection; + Drives: Drive.Collection.DrivesCollection; + Files: Drive.Collection.FilesCollection; + Parents: Drive.Collection.ParentsCollection; + Permissions: Drive.Collection.PermissionsCollection; + Properties: Drive.Collection.PropertiesCollection; + Realtime: Drive.Collection.RealtimeCollection; + Replies: Drive.Collection.RepliesCollection; + Revisions: Drive.Collection.RevisionsCollection; + Teamdrives: Drive.Collection.TeamdrivesCollection; // Create a new instance of Channel newChannel(): Drive.Schema.Channel; // Create a new instance of ChildReference @@ -1004,4 +1004,7 @@ declare namespace GoogleAppsScript { } } -declare var Drive_v2: GoogleAppsScript.Drive_v2; +/** + * The `Drive_v2` advanced service must be enabled. + */ +declare var Drive_v2: GoogleAppsScript.Drive_v2 | undefined; diff --git a/types/google-apps-script/apis/drive_v3.d.ts b/types/google-apps-script/apis/drive_v3.d.ts index 25df8a416cd0ae..1854914eeca2fb 100644 --- a/types/google-apps-script/apis/drive_v3.d.ts +++ b/types/google-apps-script/apis/drive_v3.d.ts @@ -1665,4 +1665,7 @@ declare namespace GoogleAppsScript { } } -declare var Drive: GoogleAppsScript.Drive; +/** + * The `Drive` advanced service must be enabled. + */ +declare var Drive: GoogleAppsScript.Drive | undefined; diff --git a/types/google-apps-script/apis/driveactivity_v2.d.ts b/types/google-apps-script/apis/driveactivity_v2.d.ts index 2c8b0cb8955e9c..a59ec620a029b1 100644 --- a/types/google-apps-script/apis/driveactivity_v2.d.ts +++ b/types/google-apps-script/apis/driveactivity_v2.d.ts @@ -204,7 +204,7 @@ declare namespace GoogleAppsScript { } } interface DriveActivity { - Activity?: DriveActivity.Collection.ActivityCollection | undefined; + Activity: DriveActivity.Collection.ActivityCollection; // Create a new instance of ConsolidationStrategy newConsolidationStrategy(): DriveActivity.Schema.ConsolidationStrategy; // Create a new instance of Legacy @@ -216,4 +216,7 @@ declare namespace GoogleAppsScript { } } -declare var DriveActivity: GoogleAppsScript.DriveActivity; +/** + * The `DriveActivity` advanced service must be enabled. + */ +declare var DriveActivity: GoogleAppsScript.DriveActivity | undefined; diff --git a/types/google-apps-script/apis/gmail_v1.d.ts b/types/google-apps-script/apis/gmail_v1.d.ts index 87c769606ab2f6..e3aff6acbb9f22 100644 --- a/types/google-apps-script/apis/gmail_v1.d.ts +++ b/types/google-apps-script/apis/gmail_v1.d.ts @@ -69,7 +69,7 @@ declare namespace GoogleAppsScript { remove(userId: string, forwardingEmail: string): void; } interface SendAsCollection { - SmimeInfo?: Gmail.Collection.Users.Settings.SendAs.SmimeInfoCollection | undefined; + SmimeInfo: Gmail.Collection.Users.Settings.SendAs.SmimeInfoCollection; // 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; @@ -136,7 +136,7 @@ declare namespace GoogleAppsScript { update(resource: Schema.Label, userId: string, id: string): Gmail.Schema.Label; } interface MessagesCollection { - Attachments?: Gmail.Collection.Users.Messages.AttachmentsCollection | undefined; + Attachments: Gmail.Collection.Users.Messages.AttachmentsCollection; // 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. @@ -185,10 +185,10 @@ declare namespace GoogleAppsScript { 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; + Delegates: Gmail.Collection.Users.Settings.DelegatesCollection; + Filters: Gmail.Collection.Users.Settings.FiltersCollection; + ForwardingAddresses: Gmail.Collection.Users.Settings.ForwardingAddressesCollection; + SendAs: Gmail.Collection.Users.Settings.SendAsCollection; // Gets the auto-forwarding setting for the specified account. getAutoForwarding(userId: string): Gmail.Schema.AutoForwarding; // Gets IMAP settings. @@ -227,12 +227,12 @@ declare namespace GoogleAppsScript { } } 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; + Drafts: Gmail.Collection.Users.DraftsCollection; + History: Gmail.Collection.Users.HistoryCollection; + Labels: Gmail.Collection.Users.LabelsCollection; + Messages: Gmail.Collection.Users.MessagesCollection; + Settings: Gmail.Collection.Users.SettingsCollection; + Threads: Gmail.Collection.Users.ThreadsCollection; // Gets the current user's Gmail profile. getProfile(userId: string): Gmail.Schema.Profile; // Stop receiving push notifications for the given user mailbox. @@ -471,7 +471,7 @@ declare namespace GoogleAppsScript { } } interface Gmail { - Users?: Gmail.Collection.UsersCollection | undefined; + Users: Gmail.Collection.UsersCollection; // Create a new instance of AutoForwarding newAutoForwarding(): Gmail.Schema.AutoForwarding; // Create a new instance of BatchDeleteMessagesRequest @@ -523,4 +523,7 @@ declare namespace GoogleAppsScript { } } -declare var Gmail: GoogleAppsScript.Gmail; +/** + * The `Gmail` advanced service must be enabled. + */ +declare var Gmail: GoogleAppsScript.Gmail | undefined; diff --git a/types/google-apps-script/apis/groupsmigration_v1.d.ts b/types/google-apps-script/apis/groupsmigration_v1.d.ts index 5be73c9a201ed1..b23ac0cdda3aba 100644 --- a/types/google-apps-script/apis/groupsmigration_v1.d.ts +++ b/types/google-apps-script/apis/groupsmigration_v1.d.ts @@ -16,8 +16,11 @@ declare namespace GoogleAppsScript { } } interface AdminGroupsMigration { - Archive?: AdminGroupsMigration.Collection.ArchiveCollection | undefined; + Archive: AdminGroupsMigration.Collection.ArchiveCollection; } } -declare var AdminGroupsMigration: GoogleAppsScript.AdminGroupsMigration; +/** + * The `AdminGroupsMigration` advanced service must be enabled. + */ +declare var AdminGroupsMigration: GoogleAppsScript.AdminGroupsMigration | undefined; diff --git a/types/google-apps-script/apis/groupssettings_v1.d.ts b/types/google-apps-script/apis/groupssettings_v1.d.ts index 841d6ca9ce9845..421c5ca68f4e7c 100644 --- a/types/google-apps-script/apis/groupssettings_v1.d.ts +++ b/types/google-apps-script/apis/groupssettings_v1.d.ts @@ -77,10 +77,13 @@ declare namespace GoogleAppsScript { } } interface AdminGroupsSettings { - Groups?: AdminGroupsSettings.Collection.GroupsCollection | undefined; + Groups: AdminGroupsSettings.Collection.GroupsCollection; // Create a new instance of Groups newGroups(): AdminGroupsSettings.Schema.Groups; } } -declare var AdminGroupsSettings: GoogleAppsScript.AdminGroupsSettings; +/** + * The `AdminGroupsSettings` advanced service must be enabled. + */ +declare var AdminGroupsSettings: GoogleAppsScript.AdminGroupsSettings | undefined; diff --git a/types/google-apps-script/apis/licensing_v1.d.ts b/types/google-apps-script/apis/licensing_v1.d.ts index 430814056619e2..163c8ec7f195aa 100644 --- a/types/google-apps-script/apis/licensing_v1.d.ts +++ b/types/google-apps-script/apis/licensing_v1.d.ts @@ -72,7 +72,7 @@ declare namespace GoogleAppsScript { } } interface AdminLicenseManager { - LicenseAssignments?: AdminLicenseManager.Collection.LicenseAssignmentsCollection | undefined; + LicenseAssignments: AdminLicenseManager.Collection.LicenseAssignmentsCollection; // Create a new instance of LicenseAssignment newLicenseAssignment(): AdminLicenseManager.Schema.LicenseAssignment; // Create a new instance of LicenseAssignmentInsert @@ -80,4 +80,7 @@ declare namespace GoogleAppsScript { } } -declare var AdminLicenseManager: GoogleAppsScript.AdminLicenseManager; +/** + * The `AdminLicenseManager` advanced service must be enabled. + */ +declare var AdminLicenseManager: GoogleAppsScript.AdminLicenseManager | undefined; diff --git a/types/google-apps-script/apis/mirror_v1.d.ts b/types/google-apps-script/apis/mirror_v1.d.ts index 3f0f1805f56d68..a9c3dd0909ff03 100644 --- a/types/google-apps-script/apis/mirror_v1.d.ts +++ b/types/google-apps-script/apis/mirror_v1.d.ts @@ -59,7 +59,7 @@ declare namespace GoogleAppsScript { update(resource: Schema.Subscription, id: string): Mirror.Schema.Subscription; } interface TimelineCollection { - Attachments?: Mirror.Collection.Timeline.AttachmentsCollection | undefined; + Attachments: Mirror.Collection.Timeline.AttachmentsCollection; // Gets a single timeline item by ID. get(id: string): Mirror.Schema.TimelineItem; // Inserts a new item into the timeline. @@ -225,12 +225,12 @@ declare namespace GoogleAppsScript { } } 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; + Accounts: Mirror.Collection.AccountsCollection; + Contacts: Mirror.Collection.ContactsCollection; + Locations: Mirror.Collection.LocationsCollection; + Settings: Mirror.Collection.SettingsCollection; + Subscriptions: Mirror.Collection.SubscriptionsCollection; + Timeline: Mirror.Collection.TimelineCollection; // Create a new instance of Account newAccount(): Mirror.Schema.Account; // Create a new instance of Attachment @@ -262,4 +262,7 @@ declare namespace GoogleAppsScript { } } -declare var Mirror: GoogleAppsScript.Mirror; +/** + * The `Mirror` advanced service must be enabled. + */ +declare var Mirror: GoogleAppsScript.Mirror | undefined; diff --git a/types/google-apps-script/apis/peopleapi_v1.d.ts b/types/google-apps-script/apis/peopleapi_v1.d.ts index 2901e955ac159d..6c8c2607d4b726 100644 --- a/types/google-apps-script/apis/peopleapi_v1.d.ts +++ b/types/google-apps-script/apis/peopleapi_v1.d.ts @@ -29,7 +29,7 @@ declare namespace GoogleAppsScript { } } interface ContactGroupsCollection { - Members?: Collection.ContactGroups.MembersCollection | undefined; + Members: Collection.ContactGroups.MembersCollection; // Get a list of contact groups owned by the authenticated user by specifying // a list of contact group resource names. batchGet(): Schema.BatchGetContactGroupsResponse; @@ -80,7 +80,7 @@ declare namespace GoogleAppsScript { search(optionalArgs: object): Schema.SearchDirectoryPeopleResponse; } interface PeopleCollection { - Connections?: Collection.People.ConnectionsCollection | undefined; + Connections: Collection.People.ConnectionsCollection; // 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. @@ -589,9 +589,9 @@ declare namespace GoogleAppsScript { } } interface People { - ContactGroups?: People.Collection.ContactGroupsCollection | undefined; - OtherContacts?: People.Collection.OtherContactsCollection | undefined; - People?: People.Collection.PeopleCollection | undefined; + ContactGroups: People.Collection.ContactGroupsCollection; + OtherContacts: People.Collection.OtherContactsCollection; + People: People.Collection.PeopleCollection; // Create a new instance of Address newAddress(): People.Schema.Address; // Create a new instance of AgeRangeType @@ -703,4 +703,7 @@ declare namespace GoogleAppsScript { } } -declare var People: GoogleAppsScript.People; +/** + * The `People` advanced service must be enabled. + */ +declare var People: GoogleAppsScript.People | undefined; diff --git a/types/google-apps-script/apis/reports_v1.d.ts b/types/google-apps-script/apis/reports_v1.d.ts index 77aa13c5b0130d..f7413992548033 100644 --- a/types/google-apps-script/apis/reports_v1.d.ts +++ b/types/google-apps-script/apis/reports_v1.d.ts @@ -138,14 +138,17 @@ declare namespace GoogleAppsScript { } } 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; + Activities: AdminReports.Collection.ActivitiesCollection; + Channels: AdminReports.Collection.ChannelsCollection; + CustomerUsageReports: AdminReports.Collection.CustomerUsageReportsCollection; + EntityUsageReports: AdminReports.Collection.EntityUsageReportsCollection; + UserUsageReport: AdminReports.Collection.UserUsageReportCollection; // Create a new instance of Channel newChannel(): AdminReports.Schema.Channel; } } -declare var AdminReports: GoogleAppsScript.AdminReports; +/** + * The `AdminReports` advanced service must be enabled. + */ +declare var AdminReports: GoogleAppsScript.AdminReports | undefined; diff --git a/types/google-apps-script/apis/reseller_v1.d.ts b/types/google-apps-script/apis/reseller_v1.d.ts index c9dcf7914d5828..f45f87809c2df6 100644 --- a/types/google-apps-script/apis/reseller_v1.d.ts +++ b/types/google-apps-script/apis/reseller_v1.d.ts @@ -160,9 +160,9 @@ declare namespace GoogleAppsScript { } } interface AdminReseller { - Customers?: AdminReseller.Collection.CustomersCollection | undefined; - Resellernotify?: AdminReseller.Collection.ResellernotifyCollection | undefined; - Subscriptions?: AdminReseller.Collection.SubscriptionsCollection | undefined; + Customers: AdminReseller.Collection.CustomersCollection; + Resellernotify: AdminReseller.Collection.ResellernotifyCollection; + Subscriptions: AdminReseller.Collection.SubscriptionsCollection; // Create a new instance of Address newAddress(): AdminReseller.Schema.Address; // Create a new instance of ChangePlanRequest @@ -186,4 +186,7 @@ declare namespace GoogleAppsScript { } } -declare var AdminReseller: GoogleAppsScript.AdminReseller; +/** + * The `AdminReseller` advanced service must be enabled. + */ +declare var AdminReseller: GoogleAppsScript.AdminReseller | undefined; diff --git a/types/google-apps-script/apis/sheets_v4.d.ts b/types/google-apps-script/apis/sheets_v4.d.ts index a1ed29b0c2602b..794b7fc5d39eca 100644 --- a/types/google-apps-script/apis/sheets_v4.d.ts +++ b/types/google-apps-script/apis/sheets_v4.d.ts @@ -146,9 +146,9 @@ declare namespace GoogleAppsScript { } } interface SpreadsheetsCollection { - DeveloperMetadata?: Sheets.Collection.Spreadsheets.DeveloperMetadataCollection | undefined; - Sheets?: Sheets.Collection.Spreadsheets.SheetsCollection | undefined; - Values?: Sheets.Collection.Spreadsheets.ValuesCollection | undefined; + DeveloperMetadata: Sheets.Collection.Spreadsheets.DeveloperMetadataCollection; + Sheets: Sheets.Collection.Spreadsheets.SheetsCollection; + Values: Sheets.Collection.Spreadsheets.ValuesCollection; // Applies one or more updates to the spreadsheet. // Each request is validated before // being applied. If any request is not valid then the entire request will @@ -1261,7 +1261,7 @@ declare namespace GoogleAppsScript { } } interface Sheets { - Spreadsheets?: Sheets.Collection.SpreadsheetsCollection | undefined; + Spreadsheets: Sheets.Collection.SpreadsheetsCollection; // Create a new instance of AddBandingRequest newAddBandingRequest(): Sheets.Schema.AddBandingRequest; // Create a new instance of AddChartRequest @@ -1569,4 +1569,7 @@ declare namespace GoogleAppsScript { } } -declare var Sheets: GoogleAppsScript.Sheets; +/** + * The `Sheets` advanced service must be enabled. + */ +declare var Sheets: GoogleAppsScript.Sheets | undefined; diff --git a/types/google-apps-script/apis/slides_v1.d.ts b/types/google-apps-script/apis/slides_v1.d.ts index 2e3e85d5e82345..00c928f91d50b3 100644 --- a/types/google-apps-script/apis/slides_v1.d.ts +++ b/types/google-apps-script/apis/slides_v1.d.ts @@ -22,7 +22,7 @@ declare namespace GoogleAppsScript { } } interface PresentationsCollection { - Pages?: Slides.Collection.Presentations.PagesCollection | undefined; + Pages: Slides.Collection.Presentations.PagesCollection; // Applies one or more updates to the presentation. // Each request is validated before // being applied. If any request is not valid, then the entire request will @@ -772,7 +772,7 @@ declare namespace GoogleAppsScript { } } interface Slides { - Presentations?: Slides.Collection.PresentationsCollection | undefined; + Presentations: Slides.Collection.PresentationsCollection; // Create a new instance of AffineTransform newAffineTransform(): Slides.Schema.AffineTransform; // Create a new instance of AutoText @@ -1006,4 +1006,7 @@ declare namespace GoogleAppsScript { } } -declare var Slides: GoogleAppsScript.Slides; +/** + * The `Slides` advanced service must be enabled. + */ +declare var Slides: GoogleAppsScript.Slides | undefined; diff --git a/types/google-apps-script/apis/tagmanager_v2.d.ts b/types/google-apps-script/apis/tagmanager_v2.d.ts index adadb3573239f0..8f10df5b9c7d44 100644 --- a/types/google-apps-script/apis/tagmanager_v2.d.ts +++ b/types/google-apps-script/apis/tagmanager_v2.d.ts @@ -209,13 +209,13 @@ declare namespace GoogleAppsScript { 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; + Folders: TagManager.Collection.Accounts.Containers.Workspaces.FoldersCollection; + Tags: TagManager.Collection.Accounts.Containers.Workspaces.TagsCollection; + Triggers: TagManager.Collection.Accounts.Containers.Workspaces.TriggersCollection; Variables?: | TagManager.Collection.Accounts.Containers.Workspaces.VariablesCollection | undefined; - Zones?: TagManager.Collection.Accounts.Containers.Workspaces.ZonesCollection | undefined; + Zones: TagManager.Collection.Accounts.Containers.Workspaces.ZonesCollection; // 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. @@ -252,10 +252,10 @@ declare namespace GoogleAppsScript { } } 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; + Environments: TagManager.Collection.Accounts.Containers.EnvironmentsCollection; + Version_headers: TagManager.Collection.Accounts.Containers.Version_headersCollection; + Versions: TagManager.Collection.Accounts.Containers.VersionsCollection; + Workspaces: TagManager.Collection.Accounts.Containers.WorkspacesCollection; // Creates a Container. create(resource: Schema.Container, parent: string): TagManager.Schema.Container; // Gets a Container. @@ -287,8 +287,8 @@ declare namespace GoogleAppsScript { } } interface AccountsCollection { - Containers?: TagManager.Collection.Accounts.ContainersCollection | undefined; - User_permissions?: TagManager.Collection.Accounts.User_permissionsCollection | undefined; + Containers: TagManager.Collection.Accounts.ContainersCollection; + User_permissions: TagManager.Collection.Accounts.User_permissionsCollection; // Gets a GTM Account. get(path: string): TagManager.Schema.Account; // Lists all GTM Accounts that a user has access to. @@ -682,7 +682,7 @@ declare namespace GoogleAppsScript { } } interface TagManager { - Accounts?: TagManager.Collection.AccountsCollection | undefined; + Accounts: TagManager.Collection.AccountsCollection; // Create a new instance of Account newAccount(): TagManager.Schema.Account; // Create a new instance of AccountAccess @@ -738,4 +738,7 @@ declare namespace GoogleAppsScript { } } -declare var TagManager: GoogleAppsScript.TagManager; +/** + * The `TagManager` advanced service must be enabled. + */ +declare var TagManager: GoogleAppsScript.TagManager | undefined; diff --git a/types/google-apps-script/apis/tasks_v1.d.ts b/types/google-apps-script/apis/tasks_v1.d.ts index 6e397bb28dc148..42daa62a7b68ec 100644 --- a/types/google-apps-script/apis/tasks_v1.d.ts +++ b/types/google-apps-script/apis/tasks_v1.d.ts @@ -88,8 +88,8 @@ declare namespace GoogleAppsScript { } } interface Tasks { - Tasklists?: Tasks.Collection.TasklistsCollection | undefined; - Tasks?: Tasks.Collection.TasksCollection | undefined; + Tasklists: Tasks.Collection.TasklistsCollection; + Tasks: Tasks.Collection.TasksCollection; // Create a new instance of Task newTask(): Tasks.Schema.Task; // Create a new instance of TaskLinks @@ -99,4 +99,7 @@ declare namespace GoogleAppsScript { } } -declare var Tasks: GoogleAppsScript.Tasks; +/** + * The `Tasks` advanced service must be enabled. + */ +declare var Tasks: GoogleAppsScript.Tasks | undefined; diff --git a/types/google-apps-script/apis/youtube_v3.d.ts b/types/google-apps-script/apis/youtube_v3.d.ts index 620950ca87a1e6..ae0b92f19bff6f 100644 --- a/types/google-apps-script/apis/youtube_v3.d.ts +++ b/types/google-apps-script/apis/youtube_v3.d.ts @@ -1661,32 +1661,32 @@ declare namespace GoogleAppsScript { } } interface YouTube { - Activities?: YouTube.Collection.ActivitiesCollection | undefined; - Captions?: YouTube.Collection.CaptionsCollection | undefined; - ChannelBanners?: YouTube.Collection.ChannelBannersCollection | undefined; - ChannelSections?: YouTube.Collection.ChannelSectionsCollection | undefined; - Channels?: YouTube.Collection.ChannelsCollection | undefined; - CommentThreads?: YouTube.Collection.CommentThreadsCollection | undefined; - Comments?: YouTube.Collection.CommentsCollection | undefined; - GuideCategories?: YouTube.Collection.GuideCategoriesCollection | undefined; - I18nLanguages?: YouTube.Collection.I18nLanguagesCollection | undefined; - I18nRegions?: YouTube.Collection.I18nRegionsCollection | undefined; - LiveBroadcasts?: YouTube.Collection.LiveBroadcastsCollection | undefined; - LiveChatBans?: YouTube.Collection.LiveChatBansCollection | undefined; - LiveChatMessages?: YouTube.Collection.LiveChatMessagesCollection | undefined; - LiveChatModerators?: YouTube.Collection.LiveChatModeratorsCollection | undefined; - LiveStreams?: YouTube.Collection.LiveStreamsCollection | undefined; - PlaylistItems?: YouTube.Collection.PlaylistItemsCollection | undefined; - Playlists?: YouTube.Collection.PlaylistsCollection | undefined; - Search?: YouTube.Collection.SearchCollection | undefined; - Sponsors?: YouTube.Collection.SponsorsCollection | undefined; - Subscriptions?: YouTube.Collection.SubscriptionsCollection | undefined; - SuperChatEvents?: YouTube.Collection.SuperChatEventsCollection | undefined; - Thumbnails?: YouTube.Collection.ThumbnailsCollection | undefined; - VideoAbuseReportReasons?: YouTube.Collection.VideoAbuseReportReasonsCollection | undefined; - VideoCategories?: YouTube.Collection.VideoCategoriesCollection | undefined; - Videos?: YouTube.Collection.VideosCollection | undefined; - Watermarks?: YouTube.Collection.WatermarksCollection | undefined; + Activities: YouTube.Collection.ActivitiesCollection; + Captions: YouTube.Collection.CaptionsCollection; + ChannelBanners: YouTube.Collection.ChannelBannersCollection; + ChannelSections: YouTube.Collection.ChannelSectionsCollection; + Channels: YouTube.Collection.ChannelsCollection; + CommentThreads: YouTube.Collection.CommentThreadsCollection; + Comments: YouTube.Collection.CommentsCollection; + GuideCategories: YouTube.Collection.GuideCategoriesCollection; + I18nLanguages: YouTube.Collection.I18nLanguagesCollection; + I18nRegions: YouTube.Collection.I18nRegionsCollection; + LiveBroadcasts: YouTube.Collection.LiveBroadcastsCollection; + LiveChatBans: YouTube.Collection.LiveChatBansCollection; + LiveChatMessages: YouTube.Collection.LiveChatMessagesCollection; + LiveChatModerators: YouTube.Collection.LiveChatModeratorsCollection; + LiveStreams: YouTube.Collection.LiveStreamsCollection; + PlaylistItems: YouTube.Collection.PlaylistItemsCollection; + Playlists: YouTube.Collection.PlaylistsCollection; + Search: YouTube.Collection.SearchCollection; + Sponsors: YouTube.Collection.SponsorsCollection; + Subscriptions: YouTube.Collection.SubscriptionsCollection; + SuperChatEvents: YouTube.Collection.SuperChatEventsCollection; + Thumbnails: YouTube.Collection.ThumbnailsCollection; + VideoAbuseReportReasons: YouTube.Collection.VideoAbuseReportReasonsCollection; + VideoCategories: YouTube.Collection.VideoCategoriesCollection; + Videos: YouTube.Collection.VideosCollection; + Watermarks: YouTube.Collection.WatermarksCollection; // Create a new instance of AccessPolicy newAccessPolicy(): YouTube.Schema.AccessPolicy; // Create a new instance of Activity @@ -1950,4 +1950,7 @@ declare namespace GoogleAppsScript { } } -declare var YouTube: GoogleAppsScript.YouTube; +/** + * The `YouTube` advanced service must be enabled. + */ +declare var YouTube: GoogleAppsScript.YouTube | undefined; diff --git a/types/google-apps-script/apis/youtubeanalytics_v2.d.ts b/types/google-apps-script/apis/youtubeanalytics_v2.d.ts index 63d2523e1384bf..4aac6399b42d10 100644 --- a/types/google-apps-script/apis/youtubeanalytics_v2.d.ts +++ b/types/google-apps-script/apis/youtubeanalytics_v2.d.ts @@ -117,9 +117,9 @@ declare namespace GoogleAppsScript { } } interface YouTubeAnalytics { - GroupItems?: YouTubeAnalytics.Collection.GroupItemsCollection | undefined; - Groups?: YouTubeAnalytics.Collection.GroupsCollection | undefined; - Reports?: YouTubeAnalytics.Collection.ReportsCollection | undefined; + GroupItems: YouTubeAnalytics.Collection.GroupItemsCollection; + Groups: YouTubeAnalytics.Collection.GroupsCollection; + Reports: YouTubeAnalytics.Collection.ReportsCollection; // Create a new instance of ErrorProto newErrorProto(): YouTubeAnalytics.Schema.ErrorProto; // Create a new instance of Errors @@ -137,4 +137,7 @@ declare namespace GoogleAppsScript { } } -declare var YouTubeAnalytics: GoogleAppsScript.YouTubeAnalytics; +/** + * The `YouTubeAnalytics` advanced service must be enabled. + */ +declare var YouTubeAnalytics: GoogleAppsScript.YouTubeAnalytics | undefined; diff --git a/types/google-apps-script/apis/youtubepartner_v1.d.ts b/types/google-apps-script/apis/youtubepartner_v1.d.ts index 0e439ae58d922b..f26ae05a6d7fcd 100644 --- a/types/google-apps-script/apis/youtubepartner_v1.d.ts +++ b/types/google-apps-script/apis/youtubepartner_v1.d.ts @@ -1082,33 +1082,33 @@ declare namespace GoogleAppsScript { } } interface YoutubePartner { - AssetLabels?: YoutubePartner.Collection.AssetLabelsCollection | undefined; - AssetMatchPolicy?: YoutubePartner.Collection.AssetMatchPolicyCollection | undefined; - AssetRelationships?: YoutubePartner.Collection.AssetRelationshipsCollection | undefined; - AssetSearch?: YoutubePartner.Collection.AssetSearchCollection | undefined; - AssetShares?: YoutubePartner.Collection.AssetSharesCollection | undefined; - Assets?: YoutubePartner.Collection.AssetsCollection | undefined; - Campaigns?: YoutubePartner.Collection.CampaignsCollection | undefined; - ClaimHistory?: YoutubePartner.Collection.ClaimHistoryCollection | undefined; - ClaimSearch?: YoutubePartner.Collection.ClaimSearchCollection | undefined; - Claims?: YoutubePartner.Collection.ClaimsCollection | undefined; - ContentOwnerAdvertisingOptions?: YoutubePartner.Collection.ContentOwnerAdvertisingOptionsCollection | undefined; - ContentOwners?: YoutubePartner.Collection.ContentOwnersCollection | undefined; - LiveCuepoints?: YoutubePartner.Collection.LiveCuepointsCollection | undefined; - MetadataHistory?: YoutubePartner.Collection.MetadataHistoryCollection | undefined; - Orders?: YoutubePartner.Collection.OrdersCollection | undefined; - Ownership?: YoutubePartner.Collection.OwnershipCollection | undefined; - OwnershipHistory?: YoutubePartner.Collection.OwnershipHistoryCollection | undefined; - Package?: YoutubePartner.Collection.PackageCollection | undefined; - Policies?: YoutubePartner.Collection.PoliciesCollection | undefined; - Publishers?: YoutubePartner.Collection.PublishersCollection | undefined; - ReferenceConflicts?: YoutubePartner.Collection.ReferenceConflictsCollection | undefined; - References?: YoutubePartner.Collection.ReferencesCollection | undefined; - SpreadsheetTemplate?: YoutubePartner.Collection.SpreadsheetTemplateCollection | undefined; - Uploader?: YoutubePartner.Collection.UploaderCollection | undefined; - Validator?: YoutubePartner.Collection.ValidatorCollection | undefined; - VideoAdvertisingOptions?: YoutubePartner.Collection.VideoAdvertisingOptionsCollection | undefined; - Whitelists?: YoutubePartner.Collection.WhitelistsCollection | undefined; + AssetLabels: YoutubePartner.Collection.AssetLabelsCollection; + AssetMatchPolicy: YoutubePartner.Collection.AssetMatchPolicyCollection; + AssetRelationships: YoutubePartner.Collection.AssetRelationshipsCollection; + AssetSearch: YoutubePartner.Collection.AssetSearchCollection; + AssetShares: YoutubePartner.Collection.AssetSharesCollection; + Assets: YoutubePartner.Collection.AssetsCollection; + Campaigns: YoutubePartner.Collection.CampaignsCollection; + ClaimHistory: YoutubePartner.Collection.ClaimHistoryCollection; + ClaimSearch: YoutubePartner.Collection.ClaimSearchCollection; + Claims: YoutubePartner.Collection.ClaimsCollection; + ContentOwnerAdvertisingOptions: YoutubePartner.Collection.ContentOwnerAdvertisingOptionsCollection; + ContentOwners: YoutubePartner.Collection.ContentOwnersCollection; + LiveCuepoints: YoutubePartner.Collection.LiveCuepointsCollection; + MetadataHistory: YoutubePartner.Collection.MetadataHistoryCollection; + Orders: YoutubePartner.Collection.OrdersCollection; + Ownership: YoutubePartner.Collection.OwnershipCollection; + OwnershipHistory: YoutubePartner.Collection.OwnershipHistoryCollection; + Package: YoutubePartner.Collection.PackageCollection; + Policies: YoutubePartner.Collection.PoliciesCollection; + Publishers: YoutubePartner.Collection.PublishersCollection; + ReferenceConflicts: YoutubePartner.Collection.ReferenceConflictsCollection; + References: YoutubePartner.Collection.ReferencesCollection; + SpreadsheetTemplate: YoutubePartner.Collection.SpreadsheetTemplateCollection; + Uploader: YoutubePartner.Collection.UploaderCollection; + Validator: YoutubePartner.Collection.ValidatorCollection; + VideoAdvertisingOptions: YoutubePartner.Collection.VideoAdvertisingOptionsCollection; + Whitelists: YoutubePartner.Collection.WhitelistsCollection; // Create a new instance of AdBreak newAdBreak(): YoutubePartner.Schema.AdBreak; // Create a new instance of AdSlot @@ -1214,4 +1214,7 @@ declare namespace GoogleAppsScript { } } -declare var YoutubePartner: GoogleAppsScript.YoutubePartner; +/** + * The `YoutubePartner` advanced service must be enabled. + */ +declare var YoutubePartner: GoogleAppsScript.YoutubePartner | undefined; diff --git a/types/google-apps-script/test/google-apps-script-apis-tests.ts b/types/google-apps-script/test/google-apps-script-apis-tests.ts new file mode 100644 index 00000000000000..024f123e351815 --- /dev/null +++ b/types/google-apps-script/test/google-apps-script-apis-tests.ts @@ -0,0 +1,285 @@ +// Tests for Google Apps Script Advanced Services APIs +// These tests verify that the global service variables are optional +// and that their properties are required when the service is defined. + +function testAdsense() { + if (!Adsense) return; + // $ExpectType Adsense + const adsense = Adsense; + // $ExpectType AccountsCollection + const accounts = adsense.Accounts; + // $ExpectType Accounts + const list = accounts.list(); +} + +function testCalendar() { + if (!Calendar) return; + // $ExpectType Calendar + const calendar = Calendar; + // $ExpectType AclCollection + const acl = calendar.Acl; + // $ExpectType Acl + const list = acl.list("primary"); +} + +function testDriveV2() { + if (!Drive_v2) return; // Drive v2 global is Drive_v2 + // $ExpectType Drive_v2 + const drive = Drive_v2; + // $ExpectType FilesCollection + const files = drive.Files; + // $ExpectType FileList + const list = files.list(); +} + +function testDriveV3() { + if (!Drive) return; // Drive v3 global is Drive + // $ExpectType Drive + const drive = Drive; + // $ExpectType FilesCollection + const files = drive.Files; + // $ExpectType FileList + const list = files.list(); +} + +function testAdminDirectory() { + if (!AdminDirectory) return; + // $ExpectType AdminDirectory + const admin = AdminDirectory; + // $ExpectType UsersCollection + const users = admin.Users; + // $ExpectType Users + const list = users.list(); +} + +function testSheets() { + if (!Sheets) return; + // $ExpectType Sheets + const sheets = Sheets; + // $ExpectType SpreadsheetsCollection + const spreadsheets = sheets.Spreadsheets; + // $ExpectType Spreadsheet + const create = spreadsheets.create({}); +} + +function testSlides() { + if (!Slides) return; + // $ExpectType Slides + const slides = Slides; + // $ExpectType PresentationsCollection + const presentations = slides.Presentations; + // $ExpectType Presentation + const create = presentations.create({}); +} + +function testGmail() { + if (!Gmail) return; + // $ExpectType Gmail + const gmail = Gmail; + // $ExpectType UsersCollection + const users = gmail.Users; + // $ExpectType Profile + const profile = users.getProfile("me"); +} + +function testTasks() { + if (!Tasks) return; + // $ExpectType Tasks + const tasks = Tasks; + // $ExpectType TasklistsCollection + const tasklists = tasks.Tasklists; + // $ExpectType TaskLists + const list = tasklists.list(); +} + +function testYouTube() { + if (!YouTube) return; + // $ExpectType YouTube + const youtube = YouTube; + // $ExpectType VideosCollection + const videos = youtube.Videos; + // $ExpectType VideoListResponse + const list = videos.list("snippet"); +} + +function testAnalytics() { + if (!Analytics) return; + // $ExpectType Analytics + const analytics = Analytics; + // $ExpectType ManagementCollection + const management = analytics.Management; + // $ExpectType AccountsCollection + const accounts = management.Accounts; + // $ExpectType Accounts + const list = accounts.list(); +} + +function testAnalyticsReporting() { + if (!AnalyticsReporting) return; + // $ExpectType AnalyticsReporting + const analyticsreporting = AnalyticsReporting; + // $ExpectType ReportsCollection + const reports = analyticsreporting.Reports; + // $ExpectType GetReportsResponse + const batchGet = reports.batchGet({}); +} + +function testAppsactivity() { + if (!Appsactivity) return; + // $ExpectType Appsactivity + const appsactivity = Appsactivity; + // $ExpectType ActivitiesCollection + const activities = appsactivity.Activities; + // $ExpectType ListActivitiesResponse + const list = activities.list(); +} + +function testBigQuery() { + if (!BigQuery) return; + // $ExpectType BigQuery + const bigquery = BigQuery; + // $ExpectType JobsCollection + const jobs = bigquery.Jobs; + // $ExpectType JobList + const list = jobs.list("project-id"); +} + +function testClassroom() { + if (!Classroom) return; + // $ExpectType Classroom + const classroom = Classroom; + // $ExpectType CoursesCollection + const courses = classroom.Courses; + // $ExpectType ListCoursesResponse + const list = courses.list(); +} + +function testDfareporting() { + if (!Dfareporting) return; + // $ExpectType Dfareporting + const dfareporting = Dfareporting; + // $ExpectType AccountUserProfilesCollection + const accountUserProfiles = dfareporting.AccountUserProfiles; + // $ExpectType AccountUserProfilesListResponse + const list = accountUserProfiles.list("profile-id"); +} + +function testDocs() { + if (!Docs) return; + // $ExpectType Docs + const docs = Docs; + // $ExpectType DocumentsCollection + const documents = docs.Documents; + // $ExpectType Document + const create = documents.create({ title: "title" }); +} + +function testDriveActivity() { + if (!DriveActivity) return; + // $ExpectType DriveActivity + const driveactivity = DriveActivity; + // $ExpectType ActivityCollection + const activity = driveactivity.Activity; + // $ExpectType QueryDriveActivityResponse + const query = activity.query({ consolidationStrategy: { legacy: {} } }); +} + +function testAdminGroupsMigration() { + if (!AdminGroupsMigration) return; + // $ExpectType AdminGroupsMigration + const adminGroupsMigration = AdminGroupsMigration; + // $ExpectType ArchiveCollection + const archive = adminGroupsMigration.Archive; + // $ExpectType Groups + const insert = archive.insert("groupId"); +} + +function testAdminGroupsSettings() { + if (!AdminGroupsSettings) return; + // $ExpectType AdminGroupsSettings + const adminGroupsSettings = AdminGroupsSettings; + // $ExpectType GroupsCollection + const groups = adminGroupsSettings.Groups; + // $ExpectType Groups + const get = groups.get("groupUniqueId"); +} + +function testAdminLicenseManager() { + if (!AdminLicenseManager) return; + // $ExpectType AdminLicenseManager + const adminLicenseManager = AdminLicenseManager; + // $ExpectType LicenseAssignmentsCollection + const licenseAssignments = adminLicenseManager.LicenseAssignments; + // $ExpectType LicenseAssignmentList + const list = licenseAssignments.listForProduct("productId", "customerId"); +} + +function testMirror() { + if (!Mirror) return; + // $ExpectType Mirror + const mirror = Mirror; + // $ExpectType TimelineCollection + const timeline = mirror.Timeline; + // $ExpectType TimelineListResponse + const list = timeline.list(); +} + +function testPeopleApi() { + if (!People) return; + // $ExpectType People + const people = People; + // $ExpectType PeopleCollection + const peopleCollection = people.People; + // $ExpectType ListConnectionsResponse + const list = peopleCollection.Connections.list("people/me"); +} + +function testAdminReports() { + if (!AdminReports) return; + // $ExpectType AdminReports + const adminReports = AdminReports; + // $ExpectType ActivitiesCollection + const activities = adminReports.Activities; + // $ExpectType Activities + const list = activities.list("userKey", "applicationName"); +} + +function testAdminReseller() { + if (!AdminReseller) return; + // $ExpectType AdminReseller + const adminReseller = AdminReseller; + // $ExpectType CustomersCollection + const customers = adminReseller.Customers; + // $ExpectType Customer + const get = customers.get("customerId"); +} + +function testTagManager() { + if (!TagManager) return; + // $ExpectType TagManager + const tagManager = TagManager; + // $ExpectType AccountsCollection + const accounts = tagManager.Accounts; + // $ExpectType ListAccountsResponse + const list = accounts.list(); +} + +function testYouTubeAnalytics() { + if (!YouTubeAnalytics) return; + // $ExpectType YouTubeAnalytics + const youTubeAnalytics = YouTubeAnalytics; + // $ExpectType ReportsCollection + const reports = youTubeAnalytics.Reports; + // $ExpectType QueryResponse + const query = reports.query(); +} + +function testYoutubePartner() { + if (!YoutubePartner) return; + // $ExpectType YoutubePartner + const youtubePartner = YoutubePartner; + // $ExpectType AssetsCollection + const assets = youtubePartner.Assets; + // $ExpectType AssetListResponse + const list = assets.list("id"); +} diff --git a/types/google-apps-script/test/google-apps-script-tests.ts b/types/google-apps-script/test/google-apps-script-tests.ts index bcd1d38e7c76e4..4894d847c6a1dd 100644 --- a/types/google-apps-script/test/google-apps-script-tests.ts +++ b/types/google-apps-script/test/google-apps-script-tests.ts @@ -178,11 +178,13 @@ function testOAuthScopes() { } // Advanced Services -Slides.Presentations?.Pages?.getThumbnail("presentationId", "pageId"); +if (Slides) { + Slides.Presentations.Pages.getThumbnail("presentationId", "pageId"); +} // Calendar (Advanced service) const createEvent = (): GoogleAppsScript.Calendar.Schema.Event => { - if (!Calendar.Events) throw new Error("Calendar.Events is not available"); + if (!Calendar) throw new Error("Calendar is not available"); const calendarId = "primary"; const start = new Date(); const end = new Date(); @@ -211,7 +213,7 @@ const createEvent = (): GoogleAppsScript.Calendar.Schema.Event => { // Calendar Working Locations (Advanced Service) const createWorkingLocationEvent = (): void => { - if (!Calendar.Events) return; + if (!Calendar) return; const calendarId = "primary"; const start = new Date(); const end = new Date(); @@ -248,7 +250,7 @@ const createWorkingLocationEvent = (): void => { // Admin Directory (Advanced service) const listAllUsers = () => { let pageToken: string | undefined = undefined; - if (!AdminDirectory.Users) return; + if (!AdminDirectory) return; do { const page: GoogleAppsScript.AdminDirectory.Schema.Users = AdminDirectory.Users.list({ domain: "example.com", @@ -271,7 +273,7 @@ const listAllUsers = () => { // Admin Directory - User Organization const listAllUserOrganizations = () => { let pageToken: string | undefined = undefined; - if (!AdminDirectory.Users) return; + if (!AdminDirectory) return; do { const page: GoogleAppsScript.AdminDirectory.Schema.Users = AdminDirectory.Users.list({ domain: "example.com", @@ -1031,7 +1033,7 @@ const handleScopeAction = () => { // Analytics Test const requestAnalyticsData = (): string => { - if (!Analytics.Data?.Ga) throw new Error(); + if (!Analytics) throw new Error(); const gaData = Analytics.Data.Ga.get("An Id", "2022-01-18", "2022-01-18", "Some metrics", { dimensions: "Some dimensions", }); @@ -1094,7 +1096,8 @@ const mimeTypes: string[] = [MimeType.GOOGLE_APPS_SCRIPT]; // analytics reporting test const analyticsReporting = () => { - const gaData = AnalyticsReporting.Reports?.batchGet({ + if (!AnalyticsReporting) return; + const gaData = AnalyticsReporting.Reports.batchGet({ reportRequests: [ { viewId: "", @@ -1231,7 +1234,8 @@ const sheetDataSource = () => { // Drive Activity (Advanced service) const driveActivity = () => { - const response = DriveActivity.Activity?.query({ pageSize: 10, filter: "time > 1452409200000" }); + if (!DriveActivity) return; + const response = DriveActivity.Activity.query({ pageSize: 10, filter: "time > 1452409200000" }); for (const activity of response?.activities ?? []) { const originalObject = activity.primaryActionDetail?.create?.copy?.originalObject; if (originalObject && originalObject.driveItem) { @@ -1253,7 +1257,7 @@ const driveActivity = () => { // People_v1 (Advanced Service) const people = () => { - if (!People.People) return; + if (!People) return; // contacts batch methods const batchCreateContactsResponse = People.People.batchCreateContacts({ readMask: "names,emailAddresses", @@ -1305,7 +1309,6 @@ const people = () => { }); console.log(listDirectoryPeopleResponse.people?.[0].names); - if (!People.OtherContacts) return; // other contacts methods const otherContactsListResponse = People.OtherContacts.list({ readMask: "names,emailAddresses", @@ -1394,6 +1397,7 @@ const sheetRange = () => { function driveFileOperations() { // Create a new file + if (!Drive) return; const createdFile = Drive.Files.create({ name: "test_create", description: "This is a description for a test file.", @@ -1459,6 +1463,7 @@ function driveFileOperations() { // Example showing how to create a folder function createFolder() { + if (!Drive) return; const folder = Drive.Files.create({ name: "Test Folder", mimeType: MimeType.FOLDER, @@ -1467,17 +1472,20 @@ function createFolder() { } function getFile() { + if (!Drive) return; const file = Drive.Files.get("FileID"); console.log(file.name); } function getRawFile() { + if (!Drive) return; const fileBlob: string = Drive.Files.get("FileID", { alt: "media" }); console.log(fileBlob); } // Example showing how to create a folder function createDrive() { + if (!Drive) return; const drive = Drive.Drives.create({ name: "Test Folder", }, "request-id"); @@ -1486,6 +1494,7 @@ function createDrive() { // Example: List Drives (Shared Drives) function listDrives() { + if (!Drive) return; const driveList = Drive.Drives.list(); if (driveList && driveList.drives && driveList.drives.length > 0) { console.log("Drives found:"); @@ -1499,6 +1508,7 @@ function listDrives() { // Example: Create a comment and a reply function commentAndReply() { + if (!Drive) return; const comment = Drive.Comments.create({ content: "Comment text" }, "FileID", { fields: "id" }); if (!comment.id) return; const reply = Drive.Replies.create({ content: "Reply text" }, "FileID", comment.id, { fields: "id" }); diff --git a/types/google-apps-script/tsconfig.json b/types/google-apps-script/tsconfig.json index 0a462cdede15cb..e35a4cf8205583 100644 --- a/types/google-apps-script/tsconfig.json +++ b/types/google-apps-script/tsconfig.json @@ -15,6 +15,7 @@ "files": [ "index.d.ts", "test/google-apps-script-tests.ts", - "test/google-apps-script-tests.with-node.ts" + "test/google-apps-script-tests.with-node.ts", + "test/google-apps-script-apis-tests.ts" ] }