From e721b1e1e9ca96420e1c0a01aef9f7134ab07630 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 21 Sep 2023 17:59:23 +0000 Subject: [PATCH 1/3] chore(python): Add google/apps/script/type as a proto-plus dependency for google/cloud/gsuiteaddons/v1 PiperOrigin-RevId: 567294499 Source-Link: https://github.com/googleapis/googleapis/commit/0e046326f7c65f250609e6ef4db95a89ee169d6f Source-Link: https://github.com/googleapis/googleapis-gen/commit/720fd1d977a54e12bfcd8e2fe103b7dfda9e767f Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWFwcHMtc2NyaXB0LXR5cGUvLk93bEJvdC55YW1sIiwiaCI6IjcyMGZkMWQ5NzdhNTRlMTJiZmNkOGUyZmUxMDNiN2RmZGE5ZTc2N2YifQ== --- .../type-py/.coveragerc | 13 + .../google-apps-script-type/type-py/.flake8 | 33 ++ .../type-py/MANIFEST.in | 2 + .../type-py/README.rst | 49 +++ .../type-py/docs/_static/custom.css | 3 + .../type-py/docs/calendar/services.rst | 4 + .../type-py/docs/calendar/types.rst | 6 + .../type-py/docs/conf.py | 376 ++++++++++++++++++ .../type-py/docs/docs/services.rst | 4 + .../type-py/docs/docs/types.rst | 6 + .../type-py/docs/drive/services.rst | 4 + .../type-py/docs/drive/types.rst | 6 + .../type-py/docs/gmail/services.rst | 4 + .../type-py/docs/gmail/types.rst | 6 + .../type-py/docs/index.rst | 7 + .../type-py/docs/sheets/services.rst | 4 + .../type-py/docs/sheets/types.rst | 6 + .../type-py/docs/slides/services.rst | 4 + .../type-py/docs/slides/types.rst | 6 + .../type-py/docs/type/services.rst | 4 + .../type-py/docs/type/types.rst | 6 + .../google/apps/script/type/__init__.py | 40 ++ .../apps/script/type/calendar/__init__.py | 30 ++ .../script/type/calendar/gapic_metadata.json | 7 + .../script/type/calendar/gapic_version.py | 16 + .../google/apps/script/type/calendar/py.typed | 2 + .../script/type/calendar/services/__init__.py | 15 + .../script/type/calendar/types/__init__.py | 26 ++ .../calendar/types/calendar_addon_manifest.py | 184 +++++++++ .../google/apps/script/type/docs/__init__.py | 28 ++ .../apps/script/type/docs/gapic_metadata.json | 7 + .../apps/script/type/docs/gapic_version.py | 16 + .../google/apps/script/type/docs/py.typed | 2 + .../script/type/docs/services/__init__.py | 15 + .../apps/script/type/docs/types/__init__.py | 24 ++ .../type/docs/types/docs_addon_manifest.py | 74 ++++ .../google/apps/script/type/drive/__init__.py | 28 ++ .../script/type/drive/gapic_metadata.json | 7 + .../apps/script/type/drive/gapic_version.py | 16 + .../google/apps/script/type/drive/py.typed | 2 + .../script/type/drive/services/__init__.py | 15 + .../apps/script/type/drive/types/__init__.py | 24 ++ .../type/drive/types/drive_addon_manifest.py | 76 ++++ .../apps/script/type/gapic_metadata.json | 7 + .../google/apps/script/type/gapic_version.py | 16 + .../google/apps/script/type/gmail/__init__.py | 34 ++ .../script/type/gmail/gapic_metadata.json | 7 + .../apps/script/type/gmail/gapic_version.py | 16 + .../google/apps/script/type/gmail/py.typed | 2 + .../script/type/gmail/services/__init__.py | 15 + .../apps/script/type/gmail/types/__init__.py | 30 ++ .../type/gmail/types/gmail_addon_manifest.py | 232 +++++++++++ .../type-py/google/apps/script/type/py.typed | 2 + .../apps/script/type/services/__init__.py | 15 + .../apps/script/type/sheets/__init__.py | 28 ++ .../script/type/sheets/gapic_metadata.json | 7 + .../apps/script/type/sheets/gapic_version.py | 16 + .../google/apps/script/type/sheets/py.typed | 2 + .../script/type/sheets/services/__init__.py | 15 + .../apps/script/type/sheets/types/__init__.py | 24 ++ .../sheets/types/sheets_addon_manifest.py | 74 ++++ .../apps/script/type/slides/__init__.py | 28 ++ .../script/type/slides/gapic_metadata.json | 7 + .../apps/script/type/slides/gapic_version.py | 16 + .../google/apps/script/type/slides/py.typed | 2 + .../script/type/slides/services/__init__.py | 15 + .../apps/script/type/slides/types/__init__.py | 24 ++ .../slides/types/slides_addon_manifest.py | 74 ++++ .../google/apps/script/type/types/__init__.py | 40 ++ .../script/type/types/addon_widget_set.py | 78 ++++ .../apps/script/type/types/extension_point.py | 139 +++++++ .../apps/script/type/types/script_manifest.py | 186 +++++++++ .../google-apps-script-type/type-py/mypy.ini | 3 + .../type-py/noxfile.py | 184 +++++++++ .../scripts/fixup_calendar_keywords.py | 175 ++++++++ .../type-py/scripts/fixup_docs_keywords.py | 175 ++++++++ .../type-py/scripts/fixup_drive_keywords.py | 175 ++++++++ .../type-py/scripts/fixup_gmail_keywords.py | 175 ++++++++ .../type-py/scripts/fixup_sheets_keywords.py | 175 ++++++++ .../type-py/scripts/fixup_slides_keywords.py | 175 ++++++++ .../type-py/scripts/fixup_type_keywords.py | 175 ++++++++ .../google-apps-script-type/type-py/setup.py | 91 +++++ .../type-py/testing/constraints-3.10.txt | 7 + .../type-py/testing/constraints-3.11.txt | 7 + .../type-py/testing/constraints-3.12.txt | 7 + .../type-py/testing/constraints-3.7.txt | 10 + .../type-py/testing/constraints-3.8.txt | 7 + .../type-py/testing/constraints-3.9.txt | 7 + .../type-py/tests/__init__.py | 16 + .../type-py/tests/unit/__init__.py | 16 + .../type-py/tests/unit/gapic/__init__.py | 16 + .../tests/unit/gapic/calendar/__init__.py | 16 + .../type-py/tests/unit/gapic/docs/__init__.py | 16 + .../tests/unit/gapic/drive/__init__.py | 16 + .../tests/unit/gapic/gmail/__init__.py | 16 + .../tests/unit/gapic/sheets/__init__.py | 16 + .../tests/unit/gapic/slides/__init__.py | 16 + .../type-py/tests/unit/gapic/type/__init__.py | 16 + 98 files changed, 4066 insertions(+) create mode 100644 owl-bot-staging/google-apps-script-type/type-py/.coveragerc create mode 100644 owl-bot-staging/google-apps-script-type/type-py/.flake8 create mode 100644 owl-bot-staging/google-apps-script-type/type-py/MANIFEST.in create mode 100644 owl-bot-staging/google-apps-script-type/type-py/README.rst create mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/_static/custom.css create mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/calendar/services.rst create mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/calendar/types.rst create mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/conf.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/docs/services.rst create mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/docs/types.rst create mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/drive/services.rst create mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/drive/types.rst create mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/gmail/services.rst create mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/gmail/types.rst create mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/index.rst create mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/sheets/services.rst create mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/sheets/types.rst create mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/slides/services.rst create mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/slides/types.rst create mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/type/services.rst create mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/type/types.rst create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/gapic_metadata.json create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/gapic_version.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/py.typed create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/services/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/types/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/types/calendar_addon_manifest.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/gapic_metadata.json create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/gapic_version.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/py.typed create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/services/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/types/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/types/docs_addon_manifest.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/gapic_metadata.json create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/gapic_version.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/py.typed create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/services/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/types/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/types/drive_addon_manifest.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_metadata.json create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_version.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/gapic_metadata.json create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/gapic_version.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/py.typed create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/services/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/types/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/types/gmail_addon_manifest.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/py.typed create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/services/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/gapic_metadata.json create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/gapic_version.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/py.typed create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/services/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/types/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/types/sheets_addon_manifest.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/gapic_metadata.json create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/gapic_version.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/py.typed create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/services/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/types/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/types/slides_addon_manifest.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/addon_widget_set.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/extension_point.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/script_manifest.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/mypy.ini create mode 100644 owl-bot-staging/google-apps-script-type/type-py/noxfile.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_calendar_keywords.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_docs_keywords.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_drive_keywords.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_gmail_keywords.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_sheets_keywords.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_slides_keywords.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_type_keywords.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/setup.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.10.txt create mode 100644 owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.11.txt create mode 100644 owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.12.txt create mode 100644 owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.7.txt create mode 100644 owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.8.txt create mode 100644 owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.9.txt create mode 100644 owl-bot-staging/google-apps-script-type/type-py/tests/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/tests/unit/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/calendar/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/docs/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/drive/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/gmail/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/sheets/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/slides/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/type/__init__.py diff --git a/owl-bot-staging/google-apps-script-type/type-py/.coveragerc b/owl-bot-staging/google-apps-script-type/type-py/.coveragerc new file mode 100644 index 000000000000..5b06ae94a652 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/.coveragerc @@ -0,0 +1,13 @@ +[run] +branch = True + +[report] +show_missing = True +omit = + google/apps/script/type/slides/__init__.py + google/apps/script/type/slides/gapic_version.py +exclude_lines = + # Re-enable the standard pragma + pragma: NO COVER + # Ignore debug-only repr + def __repr__ diff --git a/owl-bot-staging/google-apps-script-type/type-py/.flake8 b/owl-bot-staging/google-apps-script-type/type-py/.flake8 new file mode 100644 index 000000000000..29227d4cf419 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/.flake8 @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Generated by synthtool. DO NOT EDIT! +[flake8] +ignore = E203, E266, E501, W503 +exclude = + # Exclude generated code. + **/proto/** + **/gapic/** + **/services/** + **/types/** + *_pb2.py + + # Standard linting exemptions. + **/.nox/** + __pycache__, + .git, + *.pyc, + conf.py diff --git a/owl-bot-staging/google-apps-script-type/type-py/MANIFEST.in b/owl-bot-staging/google-apps-script-type/type-py/MANIFEST.in new file mode 100644 index 000000000000..017124b78953 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/MANIFEST.in @@ -0,0 +1,2 @@ +recursive-include google/apps/script/type/slides *.py +recursive-include google/apps/script/type/slides *.py diff --git a/owl-bot-staging/google-apps-script-type/type-py/README.rst b/owl-bot-staging/google-apps-script-type/type-py/README.rst new file mode 100644 index 000000000000..8baf4a9e8a16 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/README.rst @@ -0,0 +1,49 @@ +Python Client for Google Apps Script Type Slides API +================================================= + +Quick Start +----------- + +In order to use this library, you first need to go through the following steps: + +1. `Select or create a Cloud Platform project.`_ +2. `Enable billing for your project.`_ +3. Enable the Google Apps Script Type Slides API. +4. `Setup Authentication.`_ + +.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project +.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project +.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html + +Installation +~~~~~~~~~~~~ + +Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to +create isolated Python environments. The basic problem it addresses is one of +dependencies and versions, and indirectly permissions. + +With `virtualenv`_, it's possible to install this library without needing system +install permissions, and without clashing with the installed system +dependencies. + +.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ + + +Mac/Linux +^^^^^^^^^ + +.. code-block:: console + + python3 -m venv + source /bin/activate + /bin/pip install /path/to/library + + +Windows +^^^^^^^ + +.. code-block:: console + + python3 -m venv + \Scripts\activate + \Scripts\pip.exe install \path\to\library diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/_static/custom.css b/owl-bot-staging/google-apps-script-type/type-py/docs/_static/custom.css new file mode 100644 index 000000000000..06423be0b592 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/docs/_static/custom.css @@ -0,0 +1,3 @@ +dl.field-list > dt { + min-width: 100px +} diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/calendar/services.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/calendar/services.rst new file mode 100644 index 000000000000..3f8cdc1e081a --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/docs/calendar/services.rst @@ -0,0 +1,4 @@ +Services for Google Apps Script Type Calendar API +================================================== +.. toctree:: + :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/calendar/types.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/calendar/types.rst new file mode 100644 index 000000000000..5d78802c53ab --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/docs/calendar/types.rst @@ -0,0 +1,6 @@ +Types for Google Apps Script Type Calendar API +=============================================== + +.. automodule:: google.apps.script.type.calendar.types + :members: + :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/conf.py b/owl-bot-staging/google-apps-script-type/type-py/docs/conf.py new file mode 100644 index 000000000000..04f250485165 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/docs/conf.py @@ -0,0 +1,376 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# google-apps-script-type-slides documentation build configuration file +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys +import os +import shlex + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +sys.path.insert(0, os.path.abspath("..")) + +__version__ = "0.1.0" + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +needs_sphinx = "4.0.1" + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.intersphinx", + "sphinx.ext.coverage", + "sphinx.ext.napoleon", + "sphinx.ext.todo", + "sphinx.ext.viewcode", +] + +# autodoc/autosummary flags +autoclass_content = "both" +autodoc_default_flags = ["members"] +autosummary_generate = True + + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# Allow markdown includes (so releases.md can include CHANGLEOG.md) +# http://www.sphinx-doc.org/en/master/markdown.html +source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +source_suffix = [".rst", ".md"] + +# The encoding of source files. +# source_encoding = 'utf-8-sig' + +# The root toctree document. +root_doc = "index" + +# General information about the project. +project = u"google-apps-script-type-slides" +copyright = u"2023, Google, LLC" +author = u"Google APIs" # TODO: autogenerate this bit + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The full version, including alpha/beta/rc tags. +release = __version__ +# The short X.Y version. +version = ".".join(release.split(".")[0:2]) + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = 'en' + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +# today = '' +# Else, today_fmt is used as the format for a strftime call. +# today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ["_build"] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +# default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +# add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +# add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +# show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = "sphinx" + +# A list of ignored prefixes for module index sorting. +# modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +# keep_warnings = False + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = True + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = "alabaster" + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +html_theme_options = { + "description": "Google Apps Script Type Client Libraries for Python", + "github_user": "googleapis", + "github_repo": "google-cloud-python", + "github_banner": True, + "font_family": "'Roboto', Georgia, sans", + "head_font_family": "'Roboto', Georgia, serif", + "code_font_family": "'Roboto Mono', 'Consolas', monospace", +} + +# Add any paths that contain custom themes here, relative to this directory. +# html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +# html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +# html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +# html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +# html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ["_static"] + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +# html_extra_path = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +# html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +# html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +# html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +# html_additional_pages = {} + +# If false, no module index is generated. +# html_domain_indices = True + +# If false, no index is generated. +# html_use_index = True + +# If true, the index is split into individual pages for each letter. +# html_split_index = False + +# If true, links to the reST sources are added to the pages. +# html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +# html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +# html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +# html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +# html_file_suffix = None + +# Language to be used for generating the HTML full-text search index. +# Sphinx supports the following languages: +# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' +# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' +# html_search_language = 'en' + +# A dictionary with options for the search language support, empty by default. +# Now only 'ja' uses this config value +# html_search_options = {'type': 'default'} + +# The name of a javascript file (relative to the configuration directory) that +# implements a search results scorer. If empty, the default will be used. +# html_search_scorer = 'scorer.js' + +# Output file base name for HTML help builder. +htmlhelp_basename = "google-apps-script-type-slides-doc" + +# -- Options for warnings ------------------------------------------------------ + + +suppress_warnings = [ + # Temporarily suppress this to avoid "more than one target found for + # cross-reference" warning, which are intractable for us to avoid while in + # a mono-repo. + # See https://github.com/sphinx-doc/sphinx/blob + # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 + "ref.python" +] + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # 'papersize': 'letterpaper', + # The font size ('10pt', '11pt' or '12pt'). + # 'pointsize': '10pt', + # Additional stuff for the LaTeX preamble. + # 'preamble': '', + # Latex figure (float) alignment + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + ( + root_doc, + "google-apps-script-type-slides.tex", + u"google-apps-script-type-slides Documentation", + author, + "manual", + ) +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +# latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +# latex_use_parts = False + +# If true, show page references after internal links. +# latex_show_pagerefs = False + +# If true, show URL addresses after external links. +# latex_show_urls = False + +# Documents to append as an appendix to all manuals. +# latex_appendices = [] + +# If false, no module index is generated. +# latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ( + root_doc, + "google-apps-script-type-slides", + u"Google Apps Script Type Slides Documentation", + [author], + 1, + ) +] + +# If true, show URL addresses after external links. +# man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ( + root_doc, + "google-apps-script-type-slides", + u"google-apps-script-type-slides Documentation", + author, + "google-apps-script-type-slides", + "GAPIC library for Google Apps Script Type Slides API", + "APIs", + ) +] + +# Documents to append as an appendix to all manuals. +# texinfo_appendices = [] + +# If false, no module index is generated. +# texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +# texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +# texinfo_no_detailmenu = False + + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = { + "python": ("http://python.readthedocs.org/en/latest/", None), + "gax": ("https://gax-python.readthedocs.org/en/latest/", None), + "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), + "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), + "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None), + "grpc": ("https://grpc.io/grpc/python/", None), + "requests": ("http://requests.kennethreitz.org/en/stable/", None), + "proto": ("https://proto-plus-python.readthedocs.io/en/stable", None), + "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), +} + + +# Napoleon settings +napoleon_google_docstring = True +napoleon_numpy_docstring = True +napoleon_include_private_with_doc = False +napoleon_include_special_with_doc = True +napoleon_use_admonition_for_examples = False +napoleon_use_admonition_for_notes = False +napoleon_use_admonition_for_references = False +napoleon_use_ivar = False +napoleon_use_param = True +napoleon_use_rtype = True diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/docs/services.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/docs/services.rst new file mode 100644 index 000000000000..4af412e533c2 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/docs/docs/services.rst @@ -0,0 +1,4 @@ +Services for Google Apps Script Type Docs API +============================================== +.. toctree:: + :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/docs/types.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/docs/types.rst new file mode 100644 index 000000000000..3f47df031446 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/docs/docs/types.rst @@ -0,0 +1,6 @@ +Types for Google Apps Script Type Docs API +=========================================== + +.. automodule:: google.apps.script.type.docs.types + :members: + :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/drive/services.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/drive/services.rst new file mode 100644 index 000000000000..8ff18c898331 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/docs/drive/services.rst @@ -0,0 +1,4 @@ +Services for Google Apps Script Type Drive API +=============================================== +.. toctree:: + :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/drive/types.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/drive/types.rst new file mode 100644 index 000000000000..b7b1423eb9ea --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/docs/drive/types.rst @@ -0,0 +1,6 @@ +Types for Google Apps Script Type Drive API +============================================ + +.. automodule:: google.apps.script.type.drive.types + :members: + :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/gmail/services.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/gmail/services.rst new file mode 100644 index 000000000000..7df066840e3f --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/docs/gmail/services.rst @@ -0,0 +1,4 @@ +Services for Google Apps Script Type Gmail API +=============================================== +.. toctree:: + :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/gmail/types.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/gmail/types.rst new file mode 100644 index 000000000000..bc0bef9f5807 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/docs/gmail/types.rst @@ -0,0 +1,6 @@ +Types for Google Apps Script Type Gmail API +============================================ + +.. automodule:: google.apps.script.type.gmail.types + :members: + :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/index.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/index.rst new file mode 100644 index 000000000000..71c050be8d28 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/docs/index.rst @@ -0,0 +1,7 @@ +API Reference +------------- +.. toctree:: + :maxdepth: 2 + + slides/services + slides/types diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/sheets/services.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/sheets/services.rst new file mode 100644 index 000000000000..8015dea9d07c --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/docs/sheets/services.rst @@ -0,0 +1,4 @@ +Services for Google Apps Script Type Sheets API +================================================ +.. toctree:: + :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/sheets/types.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/sheets/types.rst new file mode 100644 index 000000000000..299268839314 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/docs/sheets/types.rst @@ -0,0 +1,6 @@ +Types for Google Apps Script Type Sheets API +============================================= + +.. automodule:: google.apps.script.type.sheets.types + :members: + :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/slides/services.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/slides/services.rst new file mode 100644 index 000000000000..ab06ee6547e5 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/docs/slides/services.rst @@ -0,0 +1,4 @@ +Services for Google Apps Script Type Slides API +================================================ +.. toctree:: + :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/slides/types.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/slides/types.rst new file mode 100644 index 000000000000..8d074bd3c493 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/docs/slides/types.rst @@ -0,0 +1,6 @@ +Types for Google Apps Script Type Slides API +============================================= + +.. automodule:: google.apps.script.type.slides.types + :members: + :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/type/services.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/type/services.rst new file mode 100644 index 000000000000..2d0581ddccc7 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/docs/type/services.rst @@ -0,0 +1,4 @@ +Services for Google Apps Script Type API +========================================= +.. toctree:: + :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/type/types.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/type/types.rst new file mode 100644 index 000000000000..1076ae59ac52 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/docs/type/types.rst @@ -0,0 +1,6 @@ +Types for Google Apps Script Type API +====================================== + +.. automodule:: google.apps.script.type.types + :members: + :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/__init__.py new file mode 100644 index 000000000000..392f67a89e6b --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/__init__.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from google.apps.script.type import gapic_version as package_version + +__version__ = package_version.__version__ + + + +from .types.addon_widget_set import AddOnWidgetSet +from .types.extension_point import HomepageExtensionPoint +from .types.extension_point import MenuItemExtensionPoint +from .types.extension_point import UniversalActionExtensionPoint +from .types.script_manifest import CommonAddOnManifest +from .types.script_manifest import HttpOptions +from .types.script_manifest import LayoutProperties +from .types.script_manifest import HttpAuthorizationHeader + +__all__ = ( +'AddOnWidgetSet', +'CommonAddOnManifest', +'HomepageExtensionPoint', +'HttpAuthorizationHeader', +'HttpOptions', +'LayoutProperties', +'MenuItemExtensionPoint', +'UniversalActionExtensionPoint', +) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/__init__.py new file mode 100644 index 000000000000..0a55085d9603 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/__init__.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from google.apps.script.type.calendar import gapic_version as package_version + +__version__ = package_version.__version__ + + + +from .types.calendar_addon_manifest import CalendarAddOnManifest +from .types.calendar_addon_manifest import CalendarExtensionPoint +from .types.calendar_addon_manifest import ConferenceSolution + +__all__ = ( +'CalendarAddOnManifest', +'CalendarExtensionPoint', +'ConferenceSolution', +) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/gapic_metadata.json new file mode 100644 index 000000000000..c2cc763ffc99 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/gapic_metadata.json @@ -0,0 +1,7 @@ + { + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "python", + "libraryPackage": "google.apps.script.type.calendar", + "protoPackage": "google.apps.script.type.calendar", + "schema": "1.0" +} diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/gapic_version.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/gapic_version.py new file mode 100644 index 000000000000..360a0d13ebdd --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/py.typed b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/py.typed new file mode 100644 index 000000000000..c8179d505670 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-apps-script-type-calendar package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/services/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/services/__init__.py new file mode 100644 index 000000000000..89a37dc92c5a --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/services/__init__.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/types/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/types/__init__.py new file mode 100644 index 000000000000..a1c8bfcb36ab --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/types/__init__.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from .calendar_addon_manifest import ( + CalendarAddOnManifest, + CalendarExtensionPoint, + ConferenceSolution, +) + +__all__ = ( + 'CalendarAddOnManifest', + 'CalendarExtensionPoint', + 'ConferenceSolution', +) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/types/calendar_addon_manifest.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/types/calendar_addon_manifest.py new file mode 100644 index 000000000000..c3e457798e5b --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/types/calendar_addon_manifest.py @@ -0,0 +1,184 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.apps.script.type.types import extension_point + + +__protobuf__ = proto.module( + package='google.apps.script.type.calendar', + manifest={ + 'CalendarAddOnManifest', + 'ConferenceSolution', + 'CalendarExtensionPoint', + }, +) + + +class CalendarAddOnManifest(proto.Message): + r"""Calendar add-on manifest. + + Attributes: + homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): + Defines an endpoint that will be executed contexts that + don't match a declared contextual trigger. Any cards + generated by this function will always be available to the + user, but may be eclipsed by contextual content when this + add-on declares more targeted triggers. + + If present, this overrides the configuration from + ``addOns.common.homepageTrigger``. + conference_solution (MutableSequence[google.apps.script.type.calendar.types.ConferenceSolution]): + Defines conference solutions provided by this + add-on. + create_settings_url_function (str): + An endpoint to execute that creates a URL to + the add-on's settings page. + event_open_trigger (google.apps.script.type.calendar.types.CalendarExtensionPoint): + An endpoint to trigger when an event is + opened (viewed/edited). + event_update_trigger (google.apps.script.type.calendar.types.CalendarExtensionPoint): + An endpoint to trigger when the open event is + updated. + current_event_access (google.apps.script.type.calendar.types.CalendarAddOnManifest.EventAccess): + Define the level of data access when an event + addon is triggered. + """ + class EventAccess(proto.Enum): + r"""An enum defining the level of data access event triggers + require. + + Values: + UNSPECIFIED (0): + Default value when nothing is set for + EventAccess. + METADATA (1): + METADATA gives event triggers the permission + to access the metadata of events such as event + id and calendar id. + READ (3): + READ gives event triggers access to all + provided event fields including the metadata, + attendees, and conference data. + WRITE (4): + WRITE gives event triggers access to the + metadata of events and the ability to perform + all actions, including adding attendees and + setting conference data. + READ_WRITE (5): + READ_WRITE gives event triggers access to all provided event + fields including the metadata, attendees, and conference + data and the ability to perform all actions. + """ + UNSPECIFIED = 0 + METADATA = 1 + READ = 3 + WRITE = 4 + READ_WRITE = 5 + + homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( + proto.MESSAGE, + number=6, + message=extension_point.HomepageExtensionPoint, + ) + conference_solution: MutableSequence['ConferenceSolution'] = proto.RepeatedField( + proto.MESSAGE, + number=3, + message='ConferenceSolution', + ) + create_settings_url_function: str = proto.Field( + proto.STRING, + number=5, + ) + event_open_trigger: 'CalendarExtensionPoint' = proto.Field( + proto.MESSAGE, + number=10, + message='CalendarExtensionPoint', + ) + event_update_trigger: 'CalendarExtensionPoint' = proto.Field( + proto.MESSAGE, + number=11, + message='CalendarExtensionPoint', + ) + current_event_access: EventAccess = proto.Field( + proto.ENUM, + number=12, + enum=EventAccess, + ) + + +class ConferenceSolution(proto.Message): + r"""Defines conference related values. + + Attributes: + on_create_function (str): + Required. The endpoint to call when + ConferenceData should be created. + id (str): + Required. IDs should be unique across + ConferenceSolutions within one add-on, but this + is not strictly enforced. It is up to the add-on + developer to assign them uniquely, otherwise the + wrong ConferenceSolution may be used when the + add-on is triggered. While the developer may + change the display name of an add-on, the ID + should not be changed. + name (str): + Required. The display name of the + ConferenceSolution. + logo_url (str): + Required. The URL for the logo image of the + ConferenceSolution. + """ + + on_create_function: str = proto.Field( + proto.STRING, + number=1, + ) + id: str = proto.Field( + proto.STRING, + number=4, + ) + name: str = proto.Field( + proto.STRING, + number=5, + ) + logo_url: str = proto.Field( + proto.STRING, + number=6, + ) + + +class CalendarExtensionPoint(proto.Message): + r"""Common format for declaring a calendar add-on's triggers. + + Attributes: + run_function (str): + Required. The endpoint to execute when this + extension point is activated. + """ + + run_function: str = proto.Field( + proto.STRING, + number=1, + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/__init__.py new file mode 100644 index 000000000000..74558807cc62 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/__init__.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from google.apps.script.type.docs import gapic_version as package_version + +__version__ = package_version.__version__ + + + +from .types.docs_addon_manifest import DocsAddOnManifest +from .types.docs_addon_manifest import DocsExtensionPoint + +__all__ = ( +'DocsAddOnManifest', +'DocsExtensionPoint', +) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/gapic_metadata.json new file mode 100644 index 000000000000..5df2a0423a5e --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/gapic_metadata.json @@ -0,0 +1,7 @@ + { + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "python", + "libraryPackage": "google.apps.script.type.docs", + "protoPackage": "google.apps.script.type.docs", + "schema": "1.0" +} diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/gapic_version.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/gapic_version.py new file mode 100644 index 000000000000..360a0d13ebdd --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/py.typed b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/py.typed new file mode 100644 index 000000000000..a954439caa66 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-apps-script-type-docs package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/services/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/services/__init__.py new file mode 100644 index 000000000000..89a37dc92c5a --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/services/__init__.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/types/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/types/__init__.py new file mode 100644 index 000000000000..1dbe144fc8ff --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/types/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from .docs_addon_manifest import ( + DocsAddOnManifest, + DocsExtensionPoint, +) + +__all__ = ( + 'DocsAddOnManifest', + 'DocsExtensionPoint', +) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/types/docs_addon_manifest.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/types/docs_addon_manifest.py new file mode 100644 index 000000000000..db2d01ed2b4c --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/types/docs_addon_manifest.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.apps.script.type.types import extension_point + + +__protobuf__ = proto.module( + package='google.apps.script.type.docs', + manifest={ + 'DocsAddOnManifest', + 'DocsExtensionPoint', + }, +) + + +class DocsAddOnManifest(proto.Message): + r"""Docs add-on manifest. + + Attributes: + homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): + If present, this overrides the configuration from + ``addOns.common.homepageTrigger``. + on_file_scope_granted_trigger (google.apps.script.type.docs.types.DocsExtensionPoint): + Endpoint to execute when file scope + authorization is granted for this document/user + pair. + """ + + homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( + proto.MESSAGE, + number=1, + message=extension_point.HomepageExtensionPoint, + ) + on_file_scope_granted_trigger: 'DocsExtensionPoint' = proto.Field( + proto.MESSAGE, + number=2, + message='DocsExtensionPoint', + ) + + +class DocsExtensionPoint(proto.Message): + r"""Common format for declaring a Docs add-on's triggers. + + Attributes: + run_function (str): + Required. The endpoint to execute when this + extension point is activated. + """ + + run_function: str = proto.Field( + proto.STRING, + number=1, + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/__init__.py new file mode 100644 index 000000000000..85f4fe7c43ca --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/__init__.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from google.apps.script.type.drive import gapic_version as package_version + +__version__ = package_version.__version__ + + + +from .types.drive_addon_manifest import DriveAddOnManifest +from .types.drive_addon_manifest import DriveExtensionPoint + +__all__ = ( +'DriveAddOnManifest', +'DriveExtensionPoint', +) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/gapic_metadata.json new file mode 100644 index 000000000000..89577093651d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/gapic_metadata.json @@ -0,0 +1,7 @@ + { + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "python", + "libraryPackage": "google.apps.script.type.drive", + "protoPackage": "google.apps.script.type.drive", + "schema": "1.0" +} diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/gapic_version.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/gapic_version.py new file mode 100644 index 000000000000..360a0d13ebdd --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/py.typed b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/py.typed new file mode 100644 index 000000000000..bbb573f18f73 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-apps-script-type-drive package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/services/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/services/__init__.py new file mode 100644 index 000000000000..89a37dc92c5a --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/services/__init__.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/types/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/types/__init__.py new file mode 100644 index 000000000000..85a4d7c4c5d6 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/types/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from .drive_addon_manifest import ( + DriveAddOnManifest, + DriveExtensionPoint, +) + +__all__ = ( + 'DriveAddOnManifest', + 'DriveExtensionPoint', +) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/types/drive_addon_manifest.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/types/drive_addon_manifest.py new file mode 100644 index 000000000000..b3c25a891c92 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/types/drive_addon_manifest.py @@ -0,0 +1,76 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.apps.script.type.types import extension_point + + +__protobuf__ = proto.module( + package='google.apps.script.type.drive', + manifest={ + 'DriveAddOnManifest', + 'DriveExtensionPoint', + }, +) + + +class DriveAddOnManifest(proto.Message): + r"""Drive add-on manifest. + + Attributes: + homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): + If present, this overrides the configuration from + ``addOns.common.homepageTrigger``. + on_items_selected_trigger (google.apps.script.type.drive.types.DriveExtensionPoint): + Corresponds to behvior that should execute + when items are selected in relevant Drive view + (e.g. the My Drive Doclist). + """ + + homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( + proto.MESSAGE, + number=1, + message=extension_point.HomepageExtensionPoint, + ) + on_items_selected_trigger: 'DriveExtensionPoint' = proto.Field( + proto.MESSAGE, + number=2, + message='DriveExtensionPoint', + ) + + +class DriveExtensionPoint(proto.Message): + r"""A generic extension point with common features, e.g. + something that simply needs a corresponding run function to + work. + + Attributes: + run_function (str): + Required. The endpoint to execute when this + extension point is activated. + """ + + run_function: str = proto.Field( + proto.STRING, + number=1, + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_metadata.json new file mode 100644 index 000000000000..ba4a361d1caf --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_metadata.json @@ -0,0 +1,7 @@ + { + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "python", + "libraryPackage": "google.apps.script.type", + "protoPackage": "google.apps.script.type", + "schema": "1.0" +} diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_version.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_version.py new file mode 100644 index 000000000000..360a0d13ebdd --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/__init__.py new file mode 100644 index 000000000000..d7365c75fa24 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/__init__.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from google.apps.script.type.gmail import gapic_version as package_version + +__version__ = package_version.__version__ + + + +from .types.gmail_addon_manifest import ComposeTrigger +from .types.gmail_addon_manifest import ContextualTrigger +from .types.gmail_addon_manifest import GmailAddOnManifest +from .types.gmail_addon_manifest import UnconditionalTrigger +from .types.gmail_addon_manifest import UniversalAction + +__all__ = ( +'ComposeTrigger', +'ContextualTrigger', +'GmailAddOnManifest', +'UnconditionalTrigger', +'UniversalAction', +) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/gapic_metadata.json new file mode 100644 index 000000000000..7733a14a8ce4 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/gapic_metadata.json @@ -0,0 +1,7 @@ + { + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "python", + "libraryPackage": "google.apps.script.type.gmail", + "protoPackage": "google.apps.script.type.gmail", + "schema": "1.0" +} diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/gapic_version.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/gapic_version.py new file mode 100644 index 000000000000..360a0d13ebdd --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/py.typed b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/py.typed new file mode 100644 index 000000000000..0906e16feda1 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-apps-script-type-gmail package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/services/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/services/__init__.py new file mode 100644 index 000000000000..89a37dc92c5a --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/services/__init__.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/types/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/types/__init__.py new file mode 100644 index 000000000000..3cc8dd5e9376 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/types/__init__.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from .gmail_addon_manifest import ( + ComposeTrigger, + ContextualTrigger, + GmailAddOnManifest, + UnconditionalTrigger, + UniversalAction, +) + +__all__ = ( + 'ComposeTrigger', + 'ContextualTrigger', + 'GmailAddOnManifest', + 'UnconditionalTrigger', + 'UniversalAction', +) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/types/gmail_addon_manifest.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/types/gmail_addon_manifest.py new file mode 100644 index 000000000000..e1164e06eb83 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/types/gmail_addon_manifest.py @@ -0,0 +1,232 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.apps.script.type.types import extension_point + + +__protobuf__ = proto.module( + package='google.apps.script.type.gmail', + manifest={ + 'GmailAddOnManifest', + 'UniversalAction', + 'ComposeTrigger', + 'ContextualTrigger', + 'UnconditionalTrigger', + }, +) + + +class GmailAddOnManifest(proto.Message): + r"""Properties customizing the appearance and execution of a + Gmail add-on. + + Attributes: + homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): + Defines an endpoint that will be executed in contexts that + don't match a declared contextual trigger. Any cards + generated by this function will always be available to the + user, but may be eclipsed by contextual content when this + add-on declares more targeted triggers. + + If present, this overrides the configuration from + ``addOns.common.homepageTrigger``. + contextual_triggers (MutableSequence[google.apps.script.type.gmail.types.ContextualTrigger]): + Defines the set of conditions that trigger + the add-on. + universal_actions (MutableSequence[google.apps.script.type.gmail.types.UniversalAction]): + Defines set of `universal + actions `__ for + the add-on. The user triggers universal actions from the + add-on toolbar menu. + compose_trigger (google.apps.script.type.gmail.types.ComposeTrigger): + Defines the compose time trigger for a + compose time add-on. This is the trigger that + causes an add-on to take action when the user is + composing an email. + All compose time addons are required to have the + gmail.addons.current.action.compose scope even + though it might not edit the draft. + authorization_check_function (str): + The name of an endpoint that verifies that + the add-on has all the required third-party + authorizations, by probing the third-party APIs. + If the probe fails, the function should throw an + exception to initiate the authorization flow. + This function is called before each invocation + of the add-on, in order to ensure a smooth user + experience. + """ + + homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( + proto.MESSAGE, + number=14, + message=extension_point.HomepageExtensionPoint, + ) + contextual_triggers: MutableSequence['ContextualTrigger'] = proto.RepeatedField( + proto.MESSAGE, + number=3, + message='ContextualTrigger', + ) + universal_actions: MutableSequence['UniversalAction'] = proto.RepeatedField( + proto.MESSAGE, + number=4, + message='UniversalAction', + ) + compose_trigger: 'ComposeTrigger' = proto.Field( + proto.MESSAGE, + number=12, + message='ComposeTrigger', + ) + authorization_check_function: str = proto.Field( + proto.STRING, + number=7, + ) + + +class UniversalAction(proto.Message): + r"""An action that is always available in the add-on toolbar menu + regardless of message context. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + text (str): + Required. User-visible text describing the + action, for example, "Add a new contact.". + open_link (str): + A link that is opened by Gmail when the user + triggers the action. + + This field is a member of `oneof`_ ``action_type``. + run_function (str): + An endpoint that is called when the user triggers the + action. See the `universal actions + guide `__ for + details. + + This field is a member of `oneof`_ ``action_type``. + """ + + text: str = proto.Field( + proto.STRING, + number=1, + ) + open_link: str = proto.Field( + proto.STRING, + number=2, + oneof='action_type', + ) + run_function: str = proto.Field( + proto.STRING, + number=3, + oneof='action_type', + ) + + +class ComposeTrigger(proto.Message): + r"""A trigger that activates when user is composing an email. + + Attributes: + actions (MutableSequence[google.apps.script.type.types.MenuItemExtensionPoint]): + Defines the set of actions for compose time + add-on. These are actions that user can trigger + on a compose time addon. + draft_access (google.apps.script.type.gmail.types.ComposeTrigger.DraftAccess): + Define the level of data access when a + compose time addon is triggered. + """ + class DraftAccess(proto.Enum): + r"""An enum defining the level of data access this compose + trigger requires. + + Values: + UNSPECIFIED (0): + Default value when nothing is set for + DraftAccess. + NONE (1): + NONE means compose trigger won't be able to + access any data of the draft when a compose + addon is triggered. + METADATA (2): + METADATA gives compose trigger the permission + to access the metadata of the draft when a + compose addon is triggered. This includes the + audience list (To/cc list) of a draft message. + """ + UNSPECIFIED = 0 + NONE = 1 + METADATA = 2 + + actions: MutableSequence[extension_point.MenuItemExtensionPoint] = proto.RepeatedField( + proto.MESSAGE, + number=5, + message=extension_point.MenuItemExtensionPoint, + ) + draft_access: DraftAccess = proto.Field( + proto.ENUM, + number=4, + enum=DraftAccess, + ) + + +class ContextualTrigger(proto.Message): + r"""Defines a trigger that fires when the open email meets a + specific criteria. When the trigger fires, it executes a + specific endpoint, usually in order to create new cards and + update the UI. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + unconditional (google.apps.script.type.gmail.types.UnconditionalTrigger): + UnconditionalTriggers are executed when any + mail message is opened. + + This field is a member of `oneof`_ ``trigger``. + on_trigger_function (str): + Required. The name of the endpoint to call + when a message matches the trigger. + """ + + unconditional: 'UnconditionalTrigger' = proto.Field( + proto.MESSAGE, + number=1, + oneof='trigger', + message='UnconditionalTrigger', + ) + on_trigger_function: str = proto.Field( + proto.STRING, + number=4, + ) + + +class UnconditionalTrigger(proto.Message): + r"""A trigger that fires when any email message is opened. + """ + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/py.typed b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/py.typed new file mode 100644 index 000000000000..04b9596b161d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-apps-script-type package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/services/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/services/__init__.py new file mode 100644 index 000000000000..89a37dc92c5a --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/services/__init__.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/__init__.py new file mode 100644 index 000000000000..4188159ee265 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/__init__.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from google.apps.script.type.sheets import gapic_version as package_version + +__version__ = package_version.__version__ + + + +from .types.sheets_addon_manifest import SheetsAddOnManifest +from .types.sheets_addon_manifest import SheetsExtensionPoint + +__all__ = ( +'SheetsAddOnManifest', +'SheetsExtensionPoint', +) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/gapic_metadata.json new file mode 100644 index 000000000000..f43947aa567d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/gapic_metadata.json @@ -0,0 +1,7 @@ + { + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "python", + "libraryPackage": "google.apps.script.type.sheets", + "protoPackage": "google.apps.script.type.sheets", + "schema": "1.0" +} diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/gapic_version.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/gapic_version.py new file mode 100644 index 000000000000..360a0d13ebdd --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/py.typed b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/py.typed new file mode 100644 index 000000000000..4744d49c1dd6 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-apps-script-type-sheets package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/services/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/services/__init__.py new file mode 100644 index 000000000000..89a37dc92c5a --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/services/__init__.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/types/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/types/__init__.py new file mode 100644 index 000000000000..3ac5fa0d29c1 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/types/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from .sheets_addon_manifest import ( + SheetsAddOnManifest, + SheetsExtensionPoint, +) + +__all__ = ( + 'SheetsAddOnManifest', + 'SheetsExtensionPoint', +) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/types/sheets_addon_manifest.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/types/sheets_addon_manifest.py new file mode 100644 index 000000000000..68313b777f64 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/types/sheets_addon_manifest.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.apps.script.type.types import extension_point + + +__protobuf__ = proto.module( + package='google.apps.script.type.sheets', + manifest={ + 'SheetsAddOnManifest', + 'SheetsExtensionPoint', + }, +) + + +class SheetsAddOnManifest(proto.Message): + r"""Sheets add-on manifest. + + Attributes: + homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): + If present, this overrides the configuration from + ``addOns.common.homepageTrigger``. + on_file_scope_granted_trigger (google.apps.script.type.sheets.types.SheetsExtensionPoint): + Endpoint to execute when file scope + authorization is granted for this document/user + pair. + """ + + homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( + proto.MESSAGE, + number=3, + message=extension_point.HomepageExtensionPoint, + ) + on_file_scope_granted_trigger: 'SheetsExtensionPoint' = proto.Field( + proto.MESSAGE, + number=5, + message='SheetsExtensionPoint', + ) + + +class SheetsExtensionPoint(proto.Message): + r"""Common format for declaring a Sheets add-on's triggers. + + Attributes: + run_function (str): + Required. The endpoint to execute when this + extension point is activated. + """ + + run_function: str = proto.Field( + proto.STRING, + number=1, + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/__init__.py new file mode 100644 index 000000000000..f356ec8e3574 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/__init__.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from google.apps.script.type.slides import gapic_version as package_version + +__version__ = package_version.__version__ + + + +from .types.slides_addon_manifest import SlidesAddOnManifest +from .types.slides_addon_manifest import SlidesExtensionPoint + +__all__ = ( +'SlidesAddOnManifest', +'SlidesExtensionPoint', +) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/gapic_metadata.json new file mode 100644 index 000000000000..dff8f8bbc7bf --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/gapic_metadata.json @@ -0,0 +1,7 @@ + { + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "python", + "libraryPackage": "google.apps.script.type.slides", + "protoPackage": "google.apps.script.type.slides", + "schema": "1.0" +} diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/gapic_version.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/gapic_version.py new file mode 100644 index 000000000000..360a0d13ebdd --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/py.typed b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/py.typed new file mode 100644 index 000000000000..eee2788b4c55 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-apps-script-type-slides package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/services/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/services/__init__.py new file mode 100644 index 000000000000..89a37dc92c5a --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/services/__init__.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/types/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/types/__init__.py new file mode 100644 index 000000000000..eb85bf4a5a46 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/types/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from .slides_addon_manifest import ( + SlidesAddOnManifest, + SlidesExtensionPoint, +) + +__all__ = ( + 'SlidesAddOnManifest', + 'SlidesExtensionPoint', +) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/types/slides_addon_manifest.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/types/slides_addon_manifest.py new file mode 100644 index 000000000000..1b54f5192821 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/types/slides_addon_manifest.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.apps.script.type.types import extension_point + + +__protobuf__ = proto.module( + package='google.apps.script.type.slides', + manifest={ + 'SlidesAddOnManifest', + 'SlidesExtensionPoint', + }, +) + + +class SlidesAddOnManifest(proto.Message): + r"""Slides add-on manifest. + + Attributes: + homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): + If present, this overrides the configuration from + ``addOns.common.homepageTrigger``. + on_file_scope_granted_trigger (google.apps.script.type.slides.types.SlidesExtensionPoint): + Endpoint to execute when file scope + authorization is granted for this document/user + pair. + """ + + homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( + proto.MESSAGE, + number=1, + message=extension_point.HomepageExtensionPoint, + ) + on_file_scope_granted_trigger: 'SlidesExtensionPoint' = proto.Field( + proto.MESSAGE, + number=2, + message='SlidesExtensionPoint', + ) + + +class SlidesExtensionPoint(proto.Message): + r"""Common format for declaring a Slides add-on's triggers. + + Attributes: + run_function (str): + Required. The endpoint to execute when this + extension point is activated. + """ + + run_function: str = proto.Field( + proto.STRING, + number=1, + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/__init__.py new file mode 100644 index 000000000000..e8ebf1bcb7c6 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/__init__.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from .addon_widget_set import ( + AddOnWidgetSet, +) +from .extension_point import ( + HomepageExtensionPoint, + MenuItemExtensionPoint, + UniversalActionExtensionPoint, +) +from .script_manifest import ( + CommonAddOnManifest, + HttpOptions, + LayoutProperties, + HttpAuthorizationHeader, +) + +__all__ = ( + 'AddOnWidgetSet', + 'HomepageExtensionPoint', + 'MenuItemExtensionPoint', + 'UniversalActionExtensionPoint', + 'CommonAddOnManifest', + 'HttpOptions', + 'LayoutProperties', + 'HttpAuthorizationHeader', +) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/addon_widget_set.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/addon_widget_set.py new file mode 100644 index 000000000000..d6379beb0be6 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/addon_widget_set.py @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + + +__protobuf__ = proto.module( + package='google.apps.script.type', + manifest={ + 'AddOnWidgetSet', + }, +) + + +class AddOnWidgetSet(proto.Message): + r"""The widget subset used by an add-on. + + Attributes: + used_widgets (MutableSequence[google.apps.script.type.types.AddOnWidgetSet.WidgetType]): + The list of widgets used in an add-on. + """ + class WidgetType(proto.Enum): + r"""The Widget type. DEFAULT is the basic widget set. + + Values: + WIDGET_TYPE_UNSPECIFIED (0): + The default widget set. + DATE_PICKER (1): + The date picker. + STYLED_BUTTONS (2): + Styled buttons include filled buttons and + disabled buttons. + PERSISTENT_FORMS (3): + Persistent forms allow persisting form values + during actions. + FIXED_FOOTER (4): + Fixed footer in card. + UPDATE_SUBJECT_AND_RECIPIENTS (5): + Update the subject and recipients of a draft. + GRID_WIDGET (6): + The grid widget. + ADDON_COMPOSE_UI_ACTION (7): + A Gmail add-on action that applies to the + addon compose UI. + """ + WIDGET_TYPE_UNSPECIFIED = 0 + DATE_PICKER = 1 + STYLED_BUTTONS = 2 + PERSISTENT_FORMS = 3 + FIXED_FOOTER = 4 + UPDATE_SUBJECT_AND_RECIPIENTS = 5 + GRID_WIDGET = 6 + ADDON_COMPOSE_UI_ACTION = 7 + + used_widgets: MutableSequence[WidgetType] = proto.RepeatedField( + proto.ENUM, + number=1, + enum=WidgetType, + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/extension_point.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/extension_point.py new file mode 100644 index 000000000000..434e1c01a383 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/extension_point.py @@ -0,0 +1,139 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.protobuf import wrappers_pb2 # type: ignore + + +__protobuf__ = proto.module( + package='google.apps.script.type', + manifest={ + 'MenuItemExtensionPoint', + 'HomepageExtensionPoint', + 'UniversalActionExtensionPoint', + }, +) + + +class MenuItemExtensionPoint(proto.Message): + r"""Common format for declaring a menu item, or button, that + appears within a host app. + + Attributes: + run_function (str): + Required. The endpoint to execute when this + extension point is activated. + label (str): + Required. User-visible text describing the + action taken by activating this extension point. + For example, "Insert invoice". + logo_url (str): + The URL for the logo image shown in the + add-on toolbar. + If not set, defaults to the add-on's primary + logo URL. + """ + + run_function: str = proto.Field( + proto.STRING, + number=1, + ) + label: str = proto.Field( + proto.STRING, + number=2, + ) + logo_url: str = proto.Field( + proto.STRING, + number=3, + ) + + +class HomepageExtensionPoint(proto.Message): + r"""Common format for declaring an add-on's home-page view. + + Attributes: + run_function (str): + Required. The endpoint to execute when this + extension point is activated. + enabled (google.protobuf.wrappers_pb2.BoolValue): + Optional. If set to ``false``, disable the home-page view in + this context. + + Defaults to ``true`` if unset. + + If an add-ons custom home-page view is disabled, an + autogenerated overview card will be provided for users + instead. + """ + + run_function: str = proto.Field( + proto.STRING, + number=1, + ) + enabled: wrappers_pb2.BoolValue = proto.Field( + proto.MESSAGE, + number=2, + message=wrappers_pb2.BoolValue, + ) + + +class UniversalActionExtensionPoint(proto.Message): + r"""Format for declaring a universal action menu item extension + point. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + label (str): + Required. User-visible text describing the + action taken by activating this extension point, + for example, "Add a new contact". + open_link (str): + URL to be opened by the UniversalAction. + + This field is a member of `oneof`_ ``action_type``. + run_function (str): + Endpoint to be run by the UniversalAction. + + This field is a member of `oneof`_ ``action_type``. + """ + + label: str = proto.Field( + proto.STRING, + number=1, + ) + open_link: str = proto.Field( + proto.STRING, + number=2, + oneof='action_type', + ) + run_function: str = proto.Field( + proto.STRING, + number=3, + oneof='action_type', + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/script_manifest.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/script_manifest.py new file mode 100644 index 000000000000..57d5b2415f2e --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/script_manifest.py @@ -0,0 +1,186 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.apps.script.type.types import addon_widget_set +from google.apps.script.type.types import extension_point +from google.protobuf import struct_pb2 # type: ignore + + +__protobuf__ = proto.module( + package='google.apps.script.type', + manifest={ + 'HttpAuthorizationHeader', + 'CommonAddOnManifest', + 'LayoutProperties', + 'HttpOptions', + }, +) + + +class HttpAuthorizationHeader(proto.Enum): + r"""Authorization header sent in add-on HTTP requests + + Values: + HTTP_AUTHORIZATION_HEADER_UNSPECIFIED (0): + Default value, equivalent to ``SYSTEM_ID_TOKEN`` + SYSTEM_ID_TOKEN (1): + Send an ID token for the project-specific + Google Workspace Add-ons system service account + (default) + USER_ID_TOKEN (2): + Send an ID token for the end user + NONE (3): + Do not send an Authentication header + """ + HTTP_AUTHORIZATION_HEADER_UNSPECIFIED = 0 + SYSTEM_ID_TOKEN = 1 + USER_ID_TOKEN = 2 + NONE = 3 + + +class CommonAddOnManifest(proto.Message): + r"""Add-on configuration that is shared across all add-on host + applications. + + Attributes: + name (str): + Required. The display name of the add-on. + logo_url (str): + Required. The URL for the logo image shown in + the add-on toolbar. + layout_properties (google.apps.script.type.types.LayoutProperties): + Common layout properties for the add-on + cards. + add_on_widget_set (google.apps.script.type.types.AddOnWidgetSet): + The widgets used in the add-on. If this field + is not specified, it indicates that default set + is used. + use_locale_from_app (bool): + Whether to pass locale information from host + app. + homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): + Defines an endpoint that will be executed in + any context, in any host. Any cards generated by + this function will always be available to the + user, but may be eclipsed by contextual content + when this add-on declares more targeted + triggers. + universal_actions (MutableSequence[google.apps.script.type.types.UniversalActionExtensionPoint]): + Defines a list of extension points in the + universal action menu which serves as a setting + menu for the add-on. The extension point can be + link URL to open or an endpoint to execute as a + form submission. + open_link_url_prefixes (google.protobuf.struct_pb2.ListValue): + An OpenLink action can only use a URL with an HTTPS, MAILTO + or TEL scheme. For HTTPS links, the URL must also + `match `__ + one of the prefixes specified in this whitelist. If the + prefix omits the scheme, HTTPS is assumed. Notice that HTTP + links are automatically rewritten to HTTPS links. + """ + + name: str = proto.Field( + proto.STRING, + number=1, + ) + logo_url: str = proto.Field( + proto.STRING, + number=2, + ) + layout_properties: 'LayoutProperties' = proto.Field( + proto.MESSAGE, + number=3, + message='LayoutProperties', + ) + add_on_widget_set: addon_widget_set.AddOnWidgetSet = proto.Field( + proto.MESSAGE, + number=4, + message=addon_widget_set.AddOnWidgetSet, + ) + use_locale_from_app: bool = proto.Field( + proto.BOOL, + number=5, + ) + homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( + proto.MESSAGE, + number=6, + message=extension_point.HomepageExtensionPoint, + ) + universal_actions: MutableSequence[extension_point.UniversalActionExtensionPoint] = proto.RepeatedField( + proto.MESSAGE, + number=7, + message=extension_point.UniversalActionExtensionPoint, + ) + open_link_url_prefixes: struct_pb2.ListValue = proto.Field( + proto.MESSAGE, + number=8, + message=struct_pb2.ListValue, + ) + + +class LayoutProperties(proto.Message): + r"""Card layout properties shared across all add-on host + applications. + + Attributes: + primary_color (str): + The primary color of the add-on. It sets the + color of toolbar. If no primary color is set + explicitly, the default value provided by the + framework is used. + secondary_color (str): + The secondary color of the add-on. It sets + the color of buttons. If primary color is set + but no secondary color is set, the secondary + color is the same as the primary color. If + neither primary color nor secondary color is + set, the default value provided by the framework + is used. + """ + + primary_color: str = proto.Field( + proto.STRING, + number=1, + ) + secondary_color: str = proto.Field( + proto.STRING, + number=2, + ) + + +class HttpOptions(proto.Message): + r"""Options for sending requests to add-on HTTP endpoints + + Attributes: + authorization_header (google.apps.script.type.types.HttpAuthorizationHeader): + Configuration for the token sent in the HTTP + Authorization header + """ + + authorization_header: 'HttpAuthorizationHeader' = proto.Field( + proto.ENUM, + number=1, + enum='HttpAuthorizationHeader', + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/type-py/mypy.ini b/owl-bot-staging/google-apps-script-type/type-py/mypy.ini new file mode 100644 index 000000000000..574c5aed394b --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/mypy.ini @@ -0,0 +1,3 @@ +[mypy] +python_version = 3.7 +namespace_packages = True diff --git a/owl-bot-staging/google-apps-script-type/type-py/noxfile.py b/owl-bot-staging/google-apps-script-type/type-py/noxfile.py new file mode 100644 index 000000000000..426935428392 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/noxfile.py @@ -0,0 +1,184 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import os +import pathlib +import shutil +import subprocess +import sys + + +import nox # type: ignore + +ALL_PYTHON = [ + "3.7", + "3.8", + "3.9", + "3.10", + "3.11", +] + +CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() + +LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt" +PACKAGE_NAME = subprocess.check_output([sys.executable, "setup.py", "--name"], encoding="utf-8") + +BLACK_VERSION = "black==22.3.0" +BLACK_PATHS = ["docs", "google", "tests", "samples", "noxfile.py", "setup.py"] +DEFAULT_PYTHON_VERSION = "3.11" + +nox.sessions = [ + "unit", + "cover", + "mypy", + "check_lower_bounds" + # exclude update_lower_bounds from default + "docs", + "blacken", + "lint", + "lint_setup_py", +] + +@nox.session(python=ALL_PYTHON) +def unit(session): + """Run the unit test suite.""" + + session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') + session.install('-e', '.') + + session.run( + 'py.test', + '--quiet', + '--cov=google/apps/script/type/slides/', + '--cov=tests/', + '--cov-config=.coveragerc', + '--cov-report=term', + '--cov-report=html', + os.path.join('tests', 'unit', ''.join(session.posargs)) + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def cover(session): + """Run the final coverage report. + This outputs the coverage report aggregating coverage from the unit + test runs (not system test runs), and then erases coverage data. + """ + session.install("coverage", "pytest-cov") + session.run("coverage", "report", "--show-missing", "--fail-under=100") + + session.run("coverage", "erase") + + +@nox.session(python=ALL_PYTHON) +def mypy(session): + """Run the type checker.""" + session.install( + 'mypy', + 'types-requests', + 'types-protobuf' + ) + session.install('.') + session.run( + 'mypy', + '--explicit-package-bases', + 'google', + ) + + +@nox.session +def update_lower_bounds(session): + """Update lower bounds in constraints.txt to match setup.py""" + session.install('google-cloud-testutils') + session.install('.') + + session.run( + 'lower-bound-checker', + 'update', + '--package-name', + PACKAGE_NAME, + '--constraints-file', + str(LOWER_BOUND_CONSTRAINTS_FILE), + ) + + +@nox.session +def check_lower_bounds(session): + """Check lower bounds in setup.py are reflected in constraints file""" + session.install('google-cloud-testutils') + session.install('.') + + session.run( + 'lower-bound-checker', + 'check', + '--package-name', + PACKAGE_NAME, + '--constraints-file', + str(LOWER_BOUND_CONSTRAINTS_FILE), + ) + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def docs(session): + """Build the docs for this library.""" + + session.install("-e", ".") + session.install("sphinx==7.0.1", "alabaster", "recommonmark") + + shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) + session.run( + "sphinx-build", + "-W", # warnings as errors + "-T", # show full traceback on exception + "-N", # no colors + "-b", + "html", + "-d", + os.path.join("docs", "_build", "doctrees", ""), + os.path.join("docs", ""), + os.path.join("docs", "_build", "html", ""), + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def lint(session): + """Run linters. + + Returns a failure if the linters find linting errors or sufficiently + serious code quality issues. + """ + session.install("flake8", BLACK_VERSION) + session.run( + "black", + "--check", + *BLACK_PATHS, + ) + session.run("flake8", "google", "tests", "samples") + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def blacken(session): + """Run black. Format code to uniform standard.""" + session.install(BLACK_VERSION) + session.run( + "black", + *BLACK_PATHS, + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def lint_setup_py(session): + """Verify that setup.py is valid (including RST check).""" + session.install("docutils", "pygments") + session.run("python", "setup.py", "check", "--restructuredtext", "--strict") diff --git a/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_calendar_keywords.py b/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_calendar_keywords.py new file mode 100644 index 000000000000..1ed0cfa7a38b --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_calendar_keywords.py @@ -0,0 +1,175 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import argparse +import os +import libcst as cst +import pathlib +import sys +from typing import (Any, Callable, Dict, List, Sequence, Tuple) + + +def partition( + predicate: Callable[[Any], bool], + iterator: Sequence[Any] +) -> Tuple[List[Any], List[Any]]: + """A stable, out-of-place partition.""" + results = ([], []) + + for i in iterator: + results[int(predicate(i))].append(i) + + # Returns trueList, falseList + return results[1], results[0] + + +class calendarCallTransformer(cst.CSTTransformer): + CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') + METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { + } + + def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: + try: + key = original.func.attr.value + kword_params = self.METHOD_TO_PARAMS[key] + except (AttributeError, KeyError): + # Either not a method from the API or too convoluted to be sure. + return updated + + # If the existing code is valid, keyword args come after positional args. + # Therefore, all positional args must map to the first parameters. + args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) + if any(k.keyword.value == "request" for k in kwargs): + # We've already fixed this file, don't fix it again. + return updated + + kwargs, ctrl_kwargs = partition( + lambda a: a.keyword.value not in self.CTRL_PARAMS, + kwargs + ) + + args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] + ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) + for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) + + request_arg = cst.Arg( + value=cst.Dict([ + cst.DictElement( + cst.SimpleString("'{}'".format(name)), +cst.Element(value=arg.value) + ) + # Note: the args + kwargs looks silly, but keep in mind that + # the control parameters had to be stripped out, and that + # those could have been passed positionally or by keyword. + for name, arg in zip(kword_params, args + kwargs)]), + keyword=cst.Name("request") + ) + + return updated.with_changes( + args=[request_arg] + ctrl_kwargs + ) + + +def fix_files( + in_dir: pathlib.Path, + out_dir: pathlib.Path, + *, + transformer=calendarCallTransformer(), +): + """Duplicate the input dir to the output dir, fixing file method calls. + + Preconditions: + * in_dir is a real directory + * out_dir is a real, empty directory + """ + pyfile_gen = ( + pathlib.Path(os.path.join(root, f)) + for root, _, files in os.walk(in_dir) + for f in files if os.path.splitext(f)[1] == ".py" + ) + + for fpath in pyfile_gen: + with open(fpath, 'r') as f: + src = f.read() + + # Parse the code and insert method call fixes. + tree = cst.parse_module(src) + updated = tree.visit(transformer) + + # Create the path and directory structure for the new file. + updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) + updated_path.parent.mkdir(parents=True, exist_ok=True) + + # Generate the updated source file at the corresponding path. + with open(updated_path, 'w') as f: + f.write(updated.code) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser( + description="""Fix up source that uses the calendar client library. + +The existing sources are NOT overwritten but are copied to output_dir with changes made. + +Note: This tool operates at a best-effort level at converting positional + parameters in client method calls to keyword based parameters. + Cases where it WILL FAIL include + A) * or ** expansion in a method call. + B) Calls via function or method alias (includes free function calls) + C) Indirect or dispatched calls (e.g. the method is looked up dynamically) + + These all constitute false negatives. The tool will also detect false + positives when an API method shares a name with another method. +""") + parser.add_argument( + '-d', + '--input-directory', + required=True, + dest='input_dir', + help='the input directory to walk for python files to fix up', + ) + parser.add_argument( + '-o', + '--output-directory', + required=True, + dest='output_dir', + help='the directory to output files fixed via un-flattening', + ) + args = parser.parse_args() + input_dir = pathlib.Path(args.input_dir) + output_dir = pathlib.Path(args.output_dir) + if not input_dir.is_dir(): + print( + f"input directory '{input_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if not output_dir.is_dir(): + print( + f"output directory '{output_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if os.listdir(output_dir): + print( + f"output directory '{output_dir}' is not empty", + file=sys.stderr, + ) + sys.exit(-1) + + fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_docs_keywords.py b/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_docs_keywords.py new file mode 100644 index 000000000000..d48b7b2fa613 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_docs_keywords.py @@ -0,0 +1,175 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import argparse +import os +import libcst as cst +import pathlib +import sys +from typing import (Any, Callable, Dict, List, Sequence, Tuple) + + +def partition( + predicate: Callable[[Any], bool], + iterator: Sequence[Any] +) -> Tuple[List[Any], List[Any]]: + """A stable, out-of-place partition.""" + results = ([], []) + + for i in iterator: + results[int(predicate(i))].append(i) + + # Returns trueList, falseList + return results[1], results[0] + + +class docsCallTransformer(cst.CSTTransformer): + CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') + METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { + } + + def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: + try: + key = original.func.attr.value + kword_params = self.METHOD_TO_PARAMS[key] + except (AttributeError, KeyError): + # Either not a method from the API or too convoluted to be sure. + return updated + + # If the existing code is valid, keyword args come after positional args. + # Therefore, all positional args must map to the first parameters. + args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) + if any(k.keyword.value == "request" for k in kwargs): + # We've already fixed this file, don't fix it again. + return updated + + kwargs, ctrl_kwargs = partition( + lambda a: a.keyword.value not in self.CTRL_PARAMS, + kwargs + ) + + args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] + ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) + for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) + + request_arg = cst.Arg( + value=cst.Dict([ + cst.DictElement( + cst.SimpleString("'{}'".format(name)), +cst.Element(value=arg.value) + ) + # Note: the args + kwargs looks silly, but keep in mind that + # the control parameters had to be stripped out, and that + # those could have been passed positionally or by keyword. + for name, arg in zip(kword_params, args + kwargs)]), + keyword=cst.Name("request") + ) + + return updated.with_changes( + args=[request_arg] + ctrl_kwargs + ) + + +def fix_files( + in_dir: pathlib.Path, + out_dir: pathlib.Path, + *, + transformer=docsCallTransformer(), +): + """Duplicate the input dir to the output dir, fixing file method calls. + + Preconditions: + * in_dir is a real directory + * out_dir is a real, empty directory + """ + pyfile_gen = ( + pathlib.Path(os.path.join(root, f)) + for root, _, files in os.walk(in_dir) + for f in files if os.path.splitext(f)[1] == ".py" + ) + + for fpath in pyfile_gen: + with open(fpath, 'r') as f: + src = f.read() + + # Parse the code and insert method call fixes. + tree = cst.parse_module(src) + updated = tree.visit(transformer) + + # Create the path and directory structure for the new file. + updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) + updated_path.parent.mkdir(parents=True, exist_ok=True) + + # Generate the updated source file at the corresponding path. + with open(updated_path, 'w') as f: + f.write(updated.code) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser( + description="""Fix up source that uses the docs client library. + +The existing sources are NOT overwritten but are copied to output_dir with changes made. + +Note: This tool operates at a best-effort level at converting positional + parameters in client method calls to keyword based parameters. + Cases where it WILL FAIL include + A) * or ** expansion in a method call. + B) Calls via function or method alias (includes free function calls) + C) Indirect or dispatched calls (e.g. the method is looked up dynamically) + + These all constitute false negatives. The tool will also detect false + positives when an API method shares a name with another method. +""") + parser.add_argument( + '-d', + '--input-directory', + required=True, + dest='input_dir', + help='the input directory to walk for python files to fix up', + ) + parser.add_argument( + '-o', + '--output-directory', + required=True, + dest='output_dir', + help='the directory to output files fixed via un-flattening', + ) + args = parser.parse_args() + input_dir = pathlib.Path(args.input_dir) + output_dir = pathlib.Path(args.output_dir) + if not input_dir.is_dir(): + print( + f"input directory '{input_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if not output_dir.is_dir(): + print( + f"output directory '{output_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if os.listdir(output_dir): + print( + f"output directory '{output_dir}' is not empty", + file=sys.stderr, + ) + sys.exit(-1) + + fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_drive_keywords.py b/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_drive_keywords.py new file mode 100644 index 000000000000..7928863678e4 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_drive_keywords.py @@ -0,0 +1,175 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import argparse +import os +import libcst as cst +import pathlib +import sys +from typing import (Any, Callable, Dict, List, Sequence, Tuple) + + +def partition( + predicate: Callable[[Any], bool], + iterator: Sequence[Any] +) -> Tuple[List[Any], List[Any]]: + """A stable, out-of-place partition.""" + results = ([], []) + + for i in iterator: + results[int(predicate(i))].append(i) + + # Returns trueList, falseList + return results[1], results[0] + + +class driveCallTransformer(cst.CSTTransformer): + CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') + METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { + } + + def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: + try: + key = original.func.attr.value + kword_params = self.METHOD_TO_PARAMS[key] + except (AttributeError, KeyError): + # Either not a method from the API or too convoluted to be sure. + return updated + + # If the existing code is valid, keyword args come after positional args. + # Therefore, all positional args must map to the first parameters. + args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) + if any(k.keyword.value == "request" for k in kwargs): + # We've already fixed this file, don't fix it again. + return updated + + kwargs, ctrl_kwargs = partition( + lambda a: a.keyword.value not in self.CTRL_PARAMS, + kwargs + ) + + args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] + ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) + for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) + + request_arg = cst.Arg( + value=cst.Dict([ + cst.DictElement( + cst.SimpleString("'{}'".format(name)), +cst.Element(value=arg.value) + ) + # Note: the args + kwargs looks silly, but keep in mind that + # the control parameters had to be stripped out, and that + # those could have been passed positionally or by keyword. + for name, arg in zip(kword_params, args + kwargs)]), + keyword=cst.Name("request") + ) + + return updated.with_changes( + args=[request_arg] + ctrl_kwargs + ) + + +def fix_files( + in_dir: pathlib.Path, + out_dir: pathlib.Path, + *, + transformer=driveCallTransformer(), +): + """Duplicate the input dir to the output dir, fixing file method calls. + + Preconditions: + * in_dir is a real directory + * out_dir is a real, empty directory + """ + pyfile_gen = ( + pathlib.Path(os.path.join(root, f)) + for root, _, files in os.walk(in_dir) + for f in files if os.path.splitext(f)[1] == ".py" + ) + + for fpath in pyfile_gen: + with open(fpath, 'r') as f: + src = f.read() + + # Parse the code and insert method call fixes. + tree = cst.parse_module(src) + updated = tree.visit(transformer) + + # Create the path and directory structure for the new file. + updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) + updated_path.parent.mkdir(parents=True, exist_ok=True) + + # Generate the updated source file at the corresponding path. + with open(updated_path, 'w') as f: + f.write(updated.code) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser( + description="""Fix up source that uses the drive client library. + +The existing sources are NOT overwritten but are copied to output_dir with changes made. + +Note: This tool operates at a best-effort level at converting positional + parameters in client method calls to keyword based parameters. + Cases where it WILL FAIL include + A) * or ** expansion in a method call. + B) Calls via function or method alias (includes free function calls) + C) Indirect or dispatched calls (e.g. the method is looked up dynamically) + + These all constitute false negatives. The tool will also detect false + positives when an API method shares a name with another method. +""") + parser.add_argument( + '-d', + '--input-directory', + required=True, + dest='input_dir', + help='the input directory to walk for python files to fix up', + ) + parser.add_argument( + '-o', + '--output-directory', + required=True, + dest='output_dir', + help='the directory to output files fixed via un-flattening', + ) + args = parser.parse_args() + input_dir = pathlib.Path(args.input_dir) + output_dir = pathlib.Path(args.output_dir) + if not input_dir.is_dir(): + print( + f"input directory '{input_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if not output_dir.is_dir(): + print( + f"output directory '{output_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if os.listdir(output_dir): + print( + f"output directory '{output_dir}' is not empty", + file=sys.stderr, + ) + sys.exit(-1) + + fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_gmail_keywords.py b/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_gmail_keywords.py new file mode 100644 index 000000000000..c9dad594e8de --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_gmail_keywords.py @@ -0,0 +1,175 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import argparse +import os +import libcst as cst +import pathlib +import sys +from typing import (Any, Callable, Dict, List, Sequence, Tuple) + + +def partition( + predicate: Callable[[Any], bool], + iterator: Sequence[Any] +) -> Tuple[List[Any], List[Any]]: + """A stable, out-of-place partition.""" + results = ([], []) + + for i in iterator: + results[int(predicate(i))].append(i) + + # Returns trueList, falseList + return results[1], results[0] + + +class gmailCallTransformer(cst.CSTTransformer): + CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') + METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { + } + + def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: + try: + key = original.func.attr.value + kword_params = self.METHOD_TO_PARAMS[key] + except (AttributeError, KeyError): + # Either not a method from the API or too convoluted to be sure. + return updated + + # If the existing code is valid, keyword args come after positional args. + # Therefore, all positional args must map to the first parameters. + args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) + if any(k.keyword.value == "request" for k in kwargs): + # We've already fixed this file, don't fix it again. + return updated + + kwargs, ctrl_kwargs = partition( + lambda a: a.keyword.value not in self.CTRL_PARAMS, + kwargs + ) + + args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] + ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) + for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) + + request_arg = cst.Arg( + value=cst.Dict([ + cst.DictElement( + cst.SimpleString("'{}'".format(name)), +cst.Element(value=arg.value) + ) + # Note: the args + kwargs looks silly, but keep in mind that + # the control parameters had to be stripped out, and that + # those could have been passed positionally or by keyword. + for name, arg in zip(kword_params, args + kwargs)]), + keyword=cst.Name("request") + ) + + return updated.with_changes( + args=[request_arg] + ctrl_kwargs + ) + + +def fix_files( + in_dir: pathlib.Path, + out_dir: pathlib.Path, + *, + transformer=gmailCallTransformer(), +): + """Duplicate the input dir to the output dir, fixing file method calls. + + Preconditions: + * in_dir is a real directory + * out_dir is a real, empty directory + """ + pyfile_gen = ( + pathlib.Path(os.path.join(root, f)) + for root, _, files in os.walk(in_dir) + for f in files if os.path.splitext(f)[1] == ".py" + ) + + for fpath in pyfile_gen: + with open(fpath, 'r') as f: + src = f.read() + + # Parse the code and insert method call fixes. + tree = cst.parse_module(src) + updated = tree.visit(transformer) + + # Create the path and directory structure for the new file. + updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) + updated_path.parent.mkdir(parents=True, exist_ok=True) + + # Generate the updated source file at the corresponding path. + with open(updated_path, 'w') as f: + f.write(updated.code) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser( + description="""Fix up source that uses the gmail client library. + +The existing sources are NOT overwritten but are copied to output_dir with changes made. + +Note: This tool operates at a best-effort level at converting positional + parameters in client method calls to keyword based parameters. + Cases where it WILL FAIL include + A) * or ** expansion in a method call. + B) Calls via function or method alias (includes free function calls) + C) Indirect or dispatched calls (e.g. the method is looked up dynamically) + + These all constitute false negatives. The tool will also detect false + positives when an API method shares a name with another method. +""") + parser.add_argument( + '-d', + '--input-directory', + required=True, + dest='input_dir', + help='the input directory to walk for python files to fix up', + ) + parser.add_argument( + '-o', + '--output-directory', + required=True, + dest='output_dir', + help='the directory to output files fixed via un-flattening', + ) + args = parser.parse_args() + input_dir = pathlib.Path(args.input_dir) + output_dir = pathlib.Path(args.output_dir) + if not input_dir.is_dir(): + print( + f"input directory '{input_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if not output_dir.is_dir(): + print( + f"output directory '{output_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if os.listdir(output_dir): + print( + f"output directory '{output_dir}' is not empty", + file=sys.stderr, + ) + sys.exit(-1) + + fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_sheets_keywords.py b/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_sheets_keywords.py new file mode 100644 index 000000000000..4ef43f6bf0e1 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_sheets_keywords.py @@ -0,0 +1,175 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import argparse +import os +import libcst as cst +import pathlib +import sys +from typing import (Any, Callable, Dict, List, Sequence, Tuple) + + +def partition( + predicate: Callable[[Any], bool], + iterator: Sequence[Any] +) -> Tuple[List[Any], List[Any]]: + """A stable, out-of-place partition.""" + results = ([], []) + + for i in iterator: + results[int(predicate(i))].append(i) + + # Returns trueList, falseList + return results[1], results[0] + + +class sheetsCallTransformer(cst.CSTTransformer): + CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') + METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { + } + + def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: + try: + key = original.func.attr.value + kword_params = self.METHOD_TO_PARAMS[key] + except (AttributeError, KeyError): + # Either not a method from the API or too convoluted to be sure. + return updated + + # If the existing code is valid, keyword args come after positional args. + # Therefore, all positional args must map to the first parameters. + args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) + if any(k.keyword.value == "request" for k in kwargs): + # We've already fixed this file, don't fix it again. + return updated + + kwargs, ctrl_kwargs = partition( + lambda a: a.keyword.value not in self.CTRL_PARAMS, + kwargs + ) + + args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] + ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) + for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) + + request_arg = cst.Arg( + value=cst.Dict([ + cst.DictElement( + cst.SimpleString("'{}'".format(name)), +cst.Element(value=arg.value) + ) + # Note: the args + kwargs looks silly, but keep in mind that + # the control parameters had to be stripped out, and that + # those could have been passed positionally or by keyword. + for name, arg in zip(kword_params, args + kwargs)]), + keyword=cst.Name("request") + ) + + return updated.with_changes( + args=[request_arg] + ctrl_kwargs + ) + + +def fix_files( + in_dir: pathlib.Path, + out_dir: pathlib.Path, + *, + transformer=sheetsCallTransformer(), +): + """Duplicate the input dir to the output dir, fixing file method calls. + + Preconditions: + * in_dir is a real directory + * out_dir is a real, empty directory + """ + pyfile_gen = ( + pathlib.Path(os.path.join(root, f)) + for root, _, files in os.walk(in_dir) + for f in files if os.path.splitext(f)[1] == ".py" + ) + + for fpath in pyfile_gen: + with open(fpath, 'r') as f: + src = f.read() + + # Parse the code and insert method call fixes. + tree = cst.parse_module(src) + updated = tree.visit(transformer) + + # Create the path and directory structure for the new file. + updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) + updated_path.parent.mkdir(parents=True, exist_ok=True) + + # Generate the updated source file at the corresponding path. + with open(updated_path, 'w') as f: + f.write(updated.code) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser( + description="""Fix up source that uses the sheets client library. + +The existing sources are NOT overwritten but are copied to output_dir with changes made. + +Note: This tool operates at a best-effort level at converting positional + parameters in client method calls to keyword based parameters. + Cases where it WILL FAIL include + A) * or ** expansion in a method call. + B) Calls via function or method alias (includes free function calls) + C) Indirect or dispatched calls (e.g. the method is looked up dynamically) + + These all constitute false negatives. The tool will also detect false + positives when an API method shares a name with another method. +""") + parser.add_argument( + '-d', + '--input-directory', + required=True, + dest='input_dir', + help='the input directory to walk for python files to fix up', + ) + parser.add_argument( + '-o', + '--output-directory', + required=True, + dest='output_dir', + help='the directory to output files fixed via un-flattening', + ) + args = parser.parse_args() + input_dir = pathlib.Path(args.input_dir) + output_dir = pathlib.Path(args.output_dir) + if not input_dir.is_dir(): + print( + f"input directory '{input_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if not output_dir.is_dir(): + print( + f"output directory '{output_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if os.listdir(output_dir): + print( + f"output directory '{output_dir}' is not empty", + file=sys.stderr, + ) + sys.exit(-1) + + fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_slides_keywords.py b/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_slides_keywords.py new file mode 100644 index 000000000000..6937fd026deb --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_slides_keywords.py @@ -0,0 +1,175 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import argparse +import os +import libcst as cst +import pathlib +import sys +from typing import (Any, Callable, Dict, List, Sequence, Tuple) + + +def partition( + predicate: Callable[[Any], bool], + iterator: Sequence[Any] +) -> Tuple[List[Any], List[Any]]: + """A stable, out-of-place partition.""" + results = ([], []) + + for i in iterator: + results[int(predicate(i))].append(i) + + # Returns trueList, falseList + return results[1], results[0] + + +class slidesCallTransformer(cst.CSTTransformer): + CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') + METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { + } + + def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: + try: + key = original.func.attr.value + kword_params = self.METHOD_TO_PARAMS[key] + except (AttributeError, KeyError): + # Either not a method from the API or too convoluted to be sure. + return updated + + # If the existing code is valid, keyword args come after positional args. + # Therefore, all positional args must map to the first parameters. + args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) + if any(k.keyword.value == "request" for k in kwargs): + # We've already fixed this file, don't fix it again. + return updated + + kwargs, ctrl_kwargs = partition( + lambda a: a.keyword.value not in self.CTRL_PARAMS, + kwargs + ) + + args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] + ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) + for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) + + request_arg = cst.Arg( + value=cst.Dict([ + cst.DictElement( + cst.SimpleString("'{}'".format(name)), +cst.Element(value=arg.value) + ) + # Note: the args + kwargs looks silly, but keep in mind that + # the control parameters had to be stripped out, and that + # those could have been passed positionally or by keyword. + for name, arg in zip(kword_params, args + kwargs)]), + keyword=cst.Name("request") + ) + + return updated.with_changes( + args=[request_arg] + ctrl_kwargs + ) + + +def fix_files( + in_dir: pathlib.Path, + out_dir: pathlib.Path, + *, + transformer=slidesCallTransformer(), +): + """Duplicate the input dir to the output dir, fixing file method calls. + + Preconditions: + * in_dir is a real directory + * out_dir is a real, empty directory + """ + pyfile_gen = ( + pathlib.Path(os.path.join(root, f)) + for root, _, files in os.walk(in_dir) + for f in files if os.path.splitext(f)[1] == ".py" + ) + + for fpath in pyfile_gen: + with open(fpath, 'r') as f: + src = f.read() + + # Parse the code and insert method call fixes. + tree = cst.parse_module(src) + updated = tree.visit(transformer) + + # Create the path and directory structure for the new file. + updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) + updated_path.parent.mkdir(parents=True, exist_ok=True) + + # Generate the updated source file at the corresponding path. + with open(updated_path, 'w') as f: + f.write(updated.code) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser( + description="""Fix up source that uses the slides client library. + +The existing sources are NOT overwritten but are copied to output_dir with changes made. + +Note: This tool operates at a best-effort level at converting positional + parameters in client method calls to keyword based parameters. + Cases where it WILL FAIL include + A) * or ** expansion in a method call. + B) Calls via function or method alias (includes free function calls) + C) Indirect or dispatched calls (e.g. the method is looked up dynamically) + + These all constitute false negatives. The tool will also detect false + positives when an API method shares a name with another method. +""") + parser.add_argument( + '-d', + '--input-directory', + required=True, + dest='input_dir', + help='the input directory to walk for python files to fix up', + ) + parser.add_argument( + '-o', + '--output-directory', + required=True, + dest='output_dir', + help='the directory to output files fixed via un-flattening', + ) + args = parser.parse_args() + input_dir = pathlib.Path(args.input_dir) + output_dir = pathlib.Path(args.output_dir) + if not input_dir.is_dir(): + print( + f"input directory '{input_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if not output_dir.is_dir(): + print( + f"output directory '{output_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if os.listdir(output_dir): + print( + f"output directory '{output_dir}' is not empty", + file=sys.stderr, + ) + sys.exit(-1) + + fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_type_keywords.py b/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_type_keywords.py new file mode 100644 index 000000000000..f2e069a0f033 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_type_keywords.py @@ -0,0 +1,175 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import argparse +import os +import libcst as cst +import pathlib +import sys +from typing import (Any, Callable, Dict, List, Sequence, Tuple) + + +def partition( + predicate: Callable[[Any], bool], + iterator: Sequence[Any] +) -> Tuple[List[Any], List[Any]]: + """A stable, out-of-place partition.""" + results = ([], []) + + for i in iterator: + results[int(predicate(i))].append(i) + + # Returns trueList, falseList + return results[1], results[0] + + +class typeCallTransformer(cst.CSTTransformer): + CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') + METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { + } + + def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: + try: + key = original.func.attr.value + kword_params = self.METHOD_TO_PARAMS[key] + except (AttributeError, KeyError): + # Either not a method from the API or too convoluted to be sure. + return updated + + # If the existing code is valid, keyword args come after positional args. + # Therefore, all positional args must map to the first parameters. + args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) + if any(k.keyword.value == "request" for k in kwargs): + # We've already fixed this file, don't fix it again. + return updated + + kwargs, ctrl_kwargs = partition( + lambda a: a.keyword.value not in self.CTRL_PARAMS, + kwargs + ) + + args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] + ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) + for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) + + request_arg = cst.Arg( + value=cst.Dict([ + cst.DictElement( + cst.SimpleString("'{}'".format(name)), +cst.Element(value=arg.value) + ) + # Note: the args + kwargs looks silly, but keep in mind that + # the control parameters had to be stripped out, and that + # those could have been passed positionally or by keyword. + for name, arg in zip(kword_params, args + kwargs)]), + keyword=cst.Name("request") + ) + + return updated.with_changes( + args=[request_arg] + ctrl_kwargs + ) + + +def fix_files( + in_dir: pathlib.Path, + out_dir: pathlib.Path, + *, + transformer=typeCallTransformer(), +): + """Duplicate the input dir to the output dir, fixing file method calls. + + Preconditions: + * in_dir is a real directory + * out_dir is a real, empty directory + """ + pyfile_gen = ( + pathlib.Path(os.path.join(root, f)) + for root, _, files in os.walk(in_dir) + for f in files if os.path.splitext(f)[1] == ".py" + ) + + for fpath in pyfile_gen: + with open(fpath, 'r') as f: + src = f.read() + + # Parse the code and insert method call fixes. + tree = cst.parse_module(src) + updated = tree.visit(transformer) + + # Create the path and directory structure for the new file. + updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) + updated_path.parent.mkdir(parents=True, exist_ok=True) + + # Generate the updated source file at the corresponding path. + with open(updated_path, 'w') as f: + f.write(updated.code) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser( + description="""Fix up source that uses the type client library. + +The existing sources are NOT overwritten but are copied to output_dir with changes made. + +Note: This tool operates at a best-effort level at converting positional + parameters in client method calls to keyword based parameters. + Cases where it WILL FAIL include + A) * or ** expansion in a method call. + B) Calls via function or method alias (includes free function calls) + C) Indirect or dispatched calls (e.g. the method is looked up dynamically) + + These all constitute false negatives. The tool will also detect false + positives when an API method shares a name with another method. +""") + parser.add_argument( + '-d', + '--input-directory', + required=True, + dest='input_dir', + help='the input directory to walk for python files to fix up', + ) + parser.add_argument( + '-o', + '--output-directory', + required=True, + dest='output_dir', + help='the directory to output files fixed via un-flattening', + ) + args = parser.parse_args() + input_dir = pathlib.Path(args.input_dir) + output_dir = pathlib.Path(args.output_dir) + if not input_dir.is_dir(): + print( + f"input directory '{input_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if not output_dir.is_dir(): + print( + f"output directory '{output_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if os.listdir(output_dir): + print( + f"output directory '{output_dir}' is not empty", + file=sys.stderr, + ) + sys.exit(-1) + + fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/type-py/setup.py b/owl-bot-staging/google-apps-script-type/type-py/setup.py new file mode 100644 index 000000000000..2deee65a5b5a --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/setup.py @@ -0,0 +1,91 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import io +import os + +import setuptools # type: ignore + +package_root = os.path.abspath(os.path.dirname(__file__)) + +name = 'google-apps-script-type-slides' + + +description = "Google Apps Script Type Slides API client library" + +version = {} +with open(os.path.join(package_root, 'google/apps/script/type/slides/gapic_version.py')) as fp: + exec(fp.read(), version) +version = version["__version__"] + +if version[0] == "0": + release_status = "Development Status :: 4 - Beta" +else: + release_status = "Development Status :: 5 - Production/Stable" + +dependencies = [ + "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", + "proto-plus >= 1.22.0, <2.0.0dev", + "proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'", + "protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", + "google-apps-script-type >= 0.2.0, <1.0.0dev", +] +url = "https://github.com/googleapis/python-apps-script-type-slides" + +package_root = os.path.abspath(os.path.dirname(__file__)) + +readme_filename = os.path.join(package_root, "README.rst") +with io.open(readme_filename, encoding="utf-8") as readme_file: + readme = readme_file.read() + +packages = [ + package + for package in setuptools.PEP420PackageFinder.find() + if package.startswith("google") +] + +namespaces = ["google", "google.apps", "google.apps.script", "google.apps.script.type"] + +setuptools.setup( + name=name, + version=version, + description=description, + long_description=readme, + author="Google LLC", + author_email="googleapis-packages@google.com", + license="Apache 2.0", + url=url, + classifiers=[ + release_status, + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Operating System :: OS Independent", + "Topic :: Internet", + ], + platforms="Posix; MacOS X; Windows", + packages=packages, + python_requires=">=3.7", + namespace_packages=namespaces, + install_requires=dependencies, + include_package_data=True, + zip_safe=False, +) diff --git a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.10.txt b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.10.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.10.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.11.txt b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.11.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.11.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.12.txt b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.12.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.12.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.7.txt b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.7.txt new file mode 100644 index 000000000000..4ae34ff40304 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.7.txt @@ -0,0 +1,10 @@ +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file. +# Pin the version to the lower bound. +# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", +# Then this file should have google-cloud-foo==1.14.0 +google-api-core==1.34.0 +proto-plus==1.22.0 +protobuf==3.19.5 +google-apps-script-type==0.2.0 diff --git a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.8.txt b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.8.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.8.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.9.txt b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.9.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.9.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/type-py/tests/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/tests/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/tests/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/calendar/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/calendar/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/calendar/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/docs/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/docs/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/docs/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/drive/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/drive/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/drive/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/gmail/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/gmail/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/gmail/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/sheets/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/sheets/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/sheets/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/slides/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/slides/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/slides/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/type/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/type/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/type/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# From 114cbade0bbe3d475ff8d564ba0573f000b101cd Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 21 Sep 2023 18:01:49 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../type-py/.coveragerc | 13 - .../google-apps-script-type/type-py/.flake8 | 33 -- .../type-py/MANIFEST.in | 2 - .../type-py/README.rst | 49 --- .../type-py/docs/_static/custom.css | 3 - .../type-py/docs/calendar/services.rst | 4 - .../type-py/docs/calendar/types.rst | 6 - .../type-py/docs/conf.py | 376 ------------------ .../type-py/docs/docs/services.rst | 4 - .../type-py/docs/docs/types.rst | 6 - .../type-py/docs/drive/services.rst | 4 - .../type-py/docs/drive/types.rst | 6 - .../type-py/docs/gmail/services.rst | 4 - .../type-py/docs/gmail/types.rst | 6 - .../type-py/docs/index.rst | 7 - .../type-py/docs/sheets/services.rst | 4 - .../type-py/docs/sheets/types.rst | 6 - .../type-py/docs/slides/services.rst | 4 - .../type-py/docs/slides/types.rst | 6 - .../type-py/docs/type/services.rst | 4 - .../type-py/docs/type/types.rst | 6 - .../google/apps/script/type/__init__.py | 40 -- .../apps/script/type/calendar/__init__.py | 30 -- .../script/type/calendar/gapic_metadata.json | 7 - .../script/type/calendar/gapic_version.py | 16 - .../google/apps/script/type/calendar/py.typed | 2 - .../script/type/calendar/services/__init__.py | 15 - .../script/type/calendar/types/__init__.py | 26 -- .../calendar/types/calendar_addon_manifest.py | 184 --------- .../google/apps/script/type/docs/__init__.py | 28 -- .../apps/script/type/docs/gapic_metadata.json | 7 - .../apps/script/type/docs/gapic_version.py | 16 - .../google/apps/script/type/docs/py.typed | 2 - .../script/type/docs/services/__init__.py | 15 - .../apps/script/type/docs/types/__init__.py | 24 -- .../type/docs/types/docs_addon_manifest.py | 74 ---- .../google/apps/script/type/drive/__init__.py | 28 -- .../script/type/drive/gapic_metadata.json | 7 - .../apps/script/type/drive/gapic_version.py | 16 - .../google/apps/script/type/drive/py.typed | 2 - .../script/type/drive/services/__init__.py | 15 - .../apps/script/type/drive/types/__init__.py | 24 -- .../type/drive/types/drive_addon_manifest.py | 76 ---- .../apps/script/type/gapic_metadata.json | 7 - .../google/apps/script/type/gapic_version.py | 16 - .../google/apps/script/type/gmail/__init__.py | 34 -- .../script/type/gmail/gapic_metadata.json | 7 - .../apps/script/type/gmail/gapic_version.py | 16 - .../google/apps/script/type/gmail/py.typed | 2 - .../script/type/gmail/services/__init__.py | 15 - .../apps/script/type/gmail/types/__init__.py | 30 -- .../type/gmail/types/gmail_addon_manifest.py | 232 ----------- .../type-py/google/apps/script/type/py.typed | 2 - .../apps/script/type/services/__init__.py | 15 - .../apps/script/type/sheets/__init__.py | 28 -- .../script/type/sheets/gapic_metadata.json | 7 - .../apps/script/type/sheets/gapic_version.py | 16 - .../google/apps/script/type/sheets/py.typed | 2 - .../script/type/sheets/services/__init__.py | 15 - .../apps/script/type/sheets/types/__init__.py | 24 -- .../sheets/types/sheets_addon_manifest.py | 74 ---- .../apps/script/type/slides/__init__.py | 28 -- .../script/type/slides/gapic_metadata.json | 7 - .../apps/script/type/slides/gapic_version.py | 16 - .../google/apps/script/type/slides/py.typed | 2 - .../script/type/slides/services/__init__.py | 15 - .../apps/script/type/slides/types/__init__.py | 24 -- .../slides/types/slides_addon_manifest.py | 74 ---- .../google/apps/script/type/types/__init__.py | 40 -- .../script/type/types/addon_widget_set.py | 78 ---- .../apps/script/type/types/extension_point.py | 139 ------- .../apps/script/type/types/script_manifest.py | 186 --------- .../google-apps-script-type/type-py/mypy.ini | 3 - .../type-py/noxfile.py | 184 --------- .../scripts/fixup_calendar_keywords.py | 175 -------- .../type-py/scripts/fixup_docs_keywords.py | 175 -------- .../type-py/scripts/fixup_drive_keywords.py | 175 -------- .../type-py/scripts/fixup_gmail_keywords.py | 175 -------- .../type-py/scripts/fixup_sheets_keywords.py | 175 -------- .../type-py/scripts/fixup_slides_keywords.py | 175 -------- .../type-py/scripts/fixup_type_keywords.py | 175 -------- .../google-apps-script-type/type-py/setup.py | 91 ----- .../type-py/testing/constraints-3.10.txt | 7 - .../type-py/testing/constraints-3.11.txt | 7 - .../type-py/testing/constraints-3.12.txt | 7 - .../type-py/testing/constraints-3.7.txt | 10 - .../type-py/testing/constraints-3.8.txt | 7 - .../type-py/testing/constraints-3.9.txt | 7 - .../type-py/tests/__init__.py | 16 - .../type-py/tests/unit/__init__.py | 16 - .../type-py/tests/unit/gapic/__init__.py | 16 - .../tests/unit/gapic/calendar/__init__.py | 16 - .../type-py/tests/unit/gapic/docs/__init__.py | 16 - .../tests/unit/gapic/drive/__init__.py | 16 - .../tests/unit/gapic/gmail/__init__.py | 16 - .../tests/unit/gapic/sheets/__init__.py | 16 - .../tests/unit/gapic/slides/__init__.py | 16 - .../type-py/tests/unit/gapic/type/__init__.py | 16 - packages/google-apps-script-type/.flake8 | 2 +- .../google-apps-script-type/CONTRIBUTING.rst | 2 +- packages/google-apps-script-type/MANIFEST.in | 2 +- packages/google-apps-script-type/README.rst | 27 +- packages/google-apps-script-type/docs/conf.py | 2 +- .../google-apps-script-type/docs/index.rst | 27 -- .../calendar/types/calendar_addon_manifest.py | 12 +- .../type/docs/types/docs_addon_manifest.py | 12 +- .../type/drive/types/drive_addon_manifest.py | 12 +- .../type/gmail/types/gmail_addon_manifest.py | 16 +- .../sheets/types/sheets_addon_manifest.py | 12 +- .../slides/types/slides_addon_manifest.py | 12 +- packages/google-apps-script-type/noxfile.py | 2 +- .../scripts/decrypt-secrets.sh | 2 +- packages/google-apps-script-type/setup.py | 11 +- .../testing/constraints-3.7.txt | 1 + 114 files changed, 60 insertions(+), 4160 deletions(-) delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/.coveragerc delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/.flake8 delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/MANIFEST.in delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/README.rst delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/_static/custom.css delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/calendar/services.rst delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/calendar/types.rst delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/conf.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/docs/services.rst delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/docs/types.rst delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/drive/services.rst delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/drive/types.rst delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/gmail/services.rst delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/gmail/types.rst delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/index.rst delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/sheets/services.rst delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/sheets/types.rst delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/slides/services.rst delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/slides/types.rst delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/type/services.rst delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/type/types.rst delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/gapic_metadata.json delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/gapic_version.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/py.typed delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/services/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/types/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/types/calendar_addon_manifest.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/gapic_metadata.json delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/gapic_version.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/py.typed delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/services/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/types/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/types/docs_addon_manifest.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/gapic_metadata.json delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/gapic_version.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/py.typed delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/services/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/types/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/types/drive_addon_manifest.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_metadata.json delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_version.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/gapic_metadata.json delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/gapic_version.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/py.typed delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/services/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/types/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/types/gmail_addon_manifest.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/py.typed delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/services/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/gapic_metadata.json delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/gapic_version.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/py.typed delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/services/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/types/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/types/sheets_addon_manifest.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/gapic_metadata.json delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/gapic_version.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/py.typed delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/services/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/types/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/types/slides_addon_manifest.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/addon_widget_set.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/extension_point.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/script_manifest.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/mypy.ini delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/noxfile.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_calendar_keywords.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_docs_keywords.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_drive_keywords.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_gmail_keywords.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_sheets_keywords.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_slides_keywords.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_type_keywords.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/setup.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.10.txt delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.11.txt delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.12.txt delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.7.txt delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.8.txt delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.9.txt delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/tests/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/tests/unit/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/calendar/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/docs/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/drive/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/gmail/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/sheets/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/slides/__init__.py delete mode 100644 owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/type/__init__.py diff --git a/owl-bot-staging/google-apps-script-type/type-py/.coveragerc b/owl-bot-staging/google-apps-script-type/type-py/.coveragerc deleted file mode 100644 index 5b06ae94a652..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/.coveragerc +++ /dev/null @@ -1,13 +0,0 @@ -[run] -branch = True - -[report] -show_missing = True -omit = - google/apps/script/type/slides/__init__.py - google/apps/script/type/slides/gapic_version.py -exclude_lines = - # Re-enable the standard pragma - pragma: NO COVER - # Ignore debug-only repr - def __repr__ diff --git a/owl-bot-staging/google-apps-script-type/type-py/.flake8 b/owl-bot-staging/google-apps-script-type/type-py/.flake8 deleted file mode 100644 index 29227d4cf419..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/.flake8 +++ /dev/null @@ -1,33 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Generated by synthtool. DO NOT EDIT! -[flake8] -ignore = E203, E266, E501, W503 -exclude = - # Exclude generated code. - **/proto/** - **/gapic/** - **/services/** - **/types/** - *_pb2.py - - # Standard linting exemptions. - **/.nox/** - __pycache__, - .git, - *.pyc, - conf.py diff --git a/owl-bot-staging/google-apps-script-type/type-py/MANIFEST.in b/owl-bot-staging/google-apps-script-type/type-py/MANIFEST.in deleted file mode 100644 index 017124b78953..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/MANIFEST.in +++ /dev/null @@ -1,2 +0,0 @@ -recursive-include google/apps/script/type/slides *.py -recursive-include google/apps/script/type/slides *.py diff --git a/owl-bot-staging/google-apps-script-type/type-py/README.rst b/owl-bot-staging/google-apps-script-type/type-py/README.rst deleted file mode 100644 index 8baf4a9e8a16..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/README.rst +++ /dev/null @@ -1,49 +0,0 @@ -Python Client for Google Apps Script Type Slides API -================================================= - -Quick Start ------------ - -In order to use this library, you first need to go through the following steps: - -1. `Select or create a Cloud Platform project.`_ -2. `Enable billing for your project.`_ -3. Enable the Google Apps Script Type Slides API. -4. `Setup Authentication.`_ - -.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project -.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project -.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html - -Installation -~~~~~~~~~~~~ - -Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to -create isolated Python environments. The basic problem it addresses is one of -dependencies and versions, and indirectly permissions. - -With `virtualenv`_, it's possible to install this library without needing system -install permissions, and without clashing with the installed system -dependencies. - -.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ - - -Mac/Linux -^^^^^^^^^ - -.. code-block:: console - - python3 -m venv - source /bin/activate - /bin/pip install /path/to/library - - -Windows -^^^^^^^ - -.. code-block:: console - - python3 -m venv - \Scripts\activate - \Scripts\pip.exe install \path\to\library diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/_static/custom.css b/owl-bot-staging/google-apps-script-type/type-py/docs/_static/custom.css deleted file mode 100644 index 06423be0b592..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/docs/_static/custom.css +++ /dev/null @@ -1,3 +0,0 @@ -dl.field-list > dt { - min-width: 100px -} diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/calendar/services.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/calendar/services.rst deleted file mode 100644 index 3f8cdc1e081a..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/docs/calendar/services.rst +++ /dev/null @@ -1,4 +0,0 @@ -Services for Google Apps Script Type Calendar API -================================================== -.. toctree:: - :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/calendar/types.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/calendar/types.rst deleted file mode 100644 index 5d78802c53ab..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/docs/calendar/types.rst +++ /dev/null @@ -1,6 +0,0 @@ -Types for Google Apps Script Type Calendar API -=============================================== - -.. automodule:: google.apps.script.type.calendar.types - :members: - :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/conf.py b/owl-bot-staging/google-apps-script-type/type-py/docs/conf.py deleted file mode 100644 index 04f250485165..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/docs/conf.py +++ /dev/null @@ -1,376 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# -# google-apps-script-type-slides documentation build configuration file -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os -import shlex - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath("..")) - -__version__ = "0.1.0" - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = "4.0.1" - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.intersphinx", - "sphinx.ext.coverage", - "sphinx.ext.napoleon", - "sphinx.ext.todo", - "sphinx.ext.viewcode", -] - -# autodoc/autosummary flags -autoclass_content = "both" -autodoc_default_flags = ["members"] -autosummary_generate = True - - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -source_suffix = [".rst", ".md"] - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The root toctree document. -root_doc = "index" - -# General information about the project. -project = u"google-apps-script-type-slides" -copyright = u"2023, Google, LLC" -author = u"Google APIs" # TODO: autogenerate this bit - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The full version, including alpha/beta/rc tags. -release = __version__ -# The short X.Y version. -version = ".".join(release.split(".")[0:2]) - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = 'en' - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ["_build"] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = "alabaster" - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - "description": "Google Apps Script Type Client Libraries for Python", - "github_user": "googleapis", - "github_repo": "google-cloud-python", - "github_banner": True, - "font_family": "'Roboto', Georgia, sans", - "head_font_family": "'Roboto', Georgia, serif", - "code_font_family": "'Roboto Mono', 'Consolas', monospace", -} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -# html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -# html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -# html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -# html_search_scorer = 'scorer.js' - -# Output file base name for HTML help builder. -htmlhelp_basename = "google-apps-script-type-slides-doc" - -# -- Options for warnings ------------------------------------------------------ - - -suppress_warnings = [ - # Temporarily suppress this to avoid "more than one target found for - # cross-reference" warning, which are intractable for us to avoid while in - # a mono-repo. - # See https://github.com/sphinx-doc/sphinx/blob - # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 - "ref.python" -] - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - # 'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - # 'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - # 'preamble': '', - # Latex figure (float) alignment - # 'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ( - root_doc, - "google-apps-script-type-slides.tex", - u"google-apps-script-type-slides Documentation", - author, - "manual", - ) -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ( - root_doc, - "google-apps-script-type-slides", - u"Google Apps Script Type Slides Documentation", - [author], - 1, - ) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - root_doc, - "google-apps-script-type-slides", - u"google-apps-script-type-slides Documentation", - author, - "google-apps-script-type-slides", - "GAPIC library for Google Apps Script Type Slides API", - "APIs", - ) -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False - - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = { - "python": ("http://python.readthedocs.org/en/latest/", None), - "gax": ("https://gax-python.readthedocs.org/en/latest/", None), - "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None), - "grpc": ("https://grpc.io/grpc/python/", None), - "requests": ("http://requests.kennethreitz.org/en/stable/", None), - "proto": ("https://proto-plus-python.readthedocs.io/en/stable", None), - "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), -} - - -# Napoleon settings -napoleon_google_docstring = True -napoleon_numpy_docstring = True -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = True -napoleon_use_admonition_for_examples = False -napoleon_use_admonition_for_notes = False -napoleon_use_admonition_for_references = False -napoleon_use_ivar = False -napoleon_use_param = True -napoleon_use_rtype = True diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/docs/services.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/docs/services.rst deleted file mode 100644 index 4af412e533c2..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/docs/docs/services.rst +++ /dev/null @@ -1,4 +0,0 @@ -Services for Google Apps Script Type Docs API -============================================== -.. toctree:: - :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/docs/types.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/docs/types.rst deleted file mode 100644 index 3f47df031446..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/docs/docs/types.rst +++ /dev/null @@ -1,6 +0,0 @@ -Types for Google Apps Script Type Docs API -=========================================== - -.. automodule:: google.apps.script.type.docs.types - :members: - :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/drive/services.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/drive/services.rst deleted file mode 100644 index 8ff18c898331..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/docs/drive/services.rst +++ /dev/null @@ -1,4 +0,0 @@ -Services for Google Apps Script Type Drive API -=============================================== -.. toctree:: - :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/drive/types.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/drive/types.rst deleted file mode 100644 index b7b1423eb9ea..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/docs/drive/types.rst +++ /dev/null @@ -1,6 +0,0 @@ -Types for Google Apps Script Type Drive API -============================================ - -.. automodule:: google.apps.script.type.drive.types - :members: - :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/gmail/services.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/gmail/services.rst deleted file mode 100644 index 7df066840e3f..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/docs/gmail/services.rst +++ /dev/null @@ -1,4 +0,0 @@ -Services for Google Apps Script Type Gmail API -=============================================== -.. toctree:: - :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/gmail/types.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/gmail/types.rst deleted file mode 100644 index bc0bef9f5807..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/docs/gmail/types.rst +++ /dev/null @@ -1,6 +0,0 @@ -Types for Google Apps Script Type Gmail API -============================================ - -.. automodule:: google.apps.script.type.gmail.types - :members: - :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/index.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/index.rst deleted file mode 100644 index 71c050be8d28..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/docs/index.rst +++ /dev/null @@ -1,7 +0,0 @@ -API Reference -------------- -.. toctree:: - :maxdepth: 2 - - slides/services - slides/types diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/sheets/services.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/sheets/services.rst deleted file mode 100644 index 8015dea9d07c..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/docs/sheets/services.rst +++ /dev/null @@ -1,4 +0,0 @@ -Services for Google Apps Script Type Sheets API -================================================ -.. toctree:: - :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/sheets/types.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/sheets/types.rst deleted file mode 100644 index 299268839314..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/docs/sheets/types.rst +++ /dev/null @@ -1,6 +0,0 @@ -Types for Google Apps Script Type Sheets API -============================================= - -.. automodule:: google.apps.script.type.sheets.types - :members: - :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/slides/services.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/slides/services.rst deleted file mode 100644 index ab06ee6547e5..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/docs/slides/services.rst +++ /dev/null @@ -1,4 +0,0 @@ -Services for Google Apps Script Type Slides API -================================================ -.. toctree:: - :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/slides/types.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/slides/types.rst deleted file mode 100644 index 8d074bd3c493..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/docs/slides/types.rst +++ /dev/null @@ -1,6 +0,0 @@ -Types for Google Apps Script Type Slides API -============================================= - -.. automodule:: google.apps.script.type.slides.types - :members: - :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/type/services.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/type/services.rst deleted file mode 100644 index 2d0581ddccc7..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/docs/type/services.rst +++ /dev/null @@ -1,4 +0,0 @@ -Services for Google Apps Script Type API -========================================= -.. toctree:: - :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/type/types.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/type/types.rst deleted file mode 100644 index 1076ae59ac52..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/docs/type/types.rst +++ /dev/null @@ -1,6 +0,0 @@ -Types for Google Apps Script Type API -====================================== - -.. automodule:: google.apps.script.type.types - :members: - :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/__init__.py deleted file mode 100644 index 392f67a89e6b..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/__init__.py +++ /dev/null @@ -1,40 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from google.apps.script.type import gapic_version as package_version - -__version__ = package_version.__version__ - - - -from .types.addon_widget_set import AddOnWidgetSet -from .types.extension_point import HomepageExtensionPoint -from .types.extension_point import MenuItemExtensionPoint -from .types.extension_point import UniversalActionExtensionPoint -from .types.script_manifest import CommonAddOnManifest -from .types.script_manifest import HttpOptions -from .types.script_manifest import LayoutProperties -from .types.script_manifest import HttpAuthorizationHeader - -__all__ = ( -'AddOnWidgetSet', -'CommonAddOnManifest', -'HomepageExtensionPoint', -'HttpAuthorizationHeader', -'HttpOptions', -'LayoutProperties', -'MenuItemExtensionPoint', -'UniversalActionExtensionPoint', -) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/__init__.py deleted file mode 100644 index 0a55085d9603..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/__init__.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from google.apps.script.type.calendar import gapic_version as package_version - -__version__ = package_version.__version__ - - - -from .types.calendar_addon_manifest import CalendarAddOnManifest -from .types.calendar_addon_manifest import CalendarExtensionPoint -from .types.calendar_addon_manifest import ConferenceSolution - -__all__ = ( -'CalendarAddOnManifest', -'CalendarExtensionPoint', -'ConferenceSolution', -) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/gapic_metadata.json deleted file mode 100644 index c2cc763ffc99..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/gapic_metadata.json +++ /dev/null @@ -1,7 +0,0 @@ - { - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "python", - "libraryPackage": "google.apps.script.type.calendar", - "protoPackage": "google.apps.script.type.calendar", - "schema": "1.0" -} diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/gapic_version.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/gapic_version.py deleted file mode 100644 index 360a0d13ebdd..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/gapic_version.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/py.typed b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/py.typed deleted file mode 100644 index c8179d505670..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/py.typed +++ /dev/null @@ -1,2 +0,0 @@ -# Marker file for PEP 561. -# The google-apps-script-type-calendar package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/services/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/services/__init__.py deleted file mode 100644 index 89a37dc92c5a..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/services/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/types/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/types/__init__.py deleted file mode 100644 index a1c8bfcb36ab..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/types/__init__.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from .calendar_addon_manifest import ( - CalendarAddOnManifest, - CalendarExtensionPoint, - ConferenceSolution, -) - -__all__ = ( - 'CalendarAddOnManifest', - 'CalendarExtensionPoint', - 'ConferenceSolution', -) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/types/calendar_addon_manifest.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/types/calendar_addon_manifest.py deleted file mode 100644 index c3e457798e5b..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/calendar/types/calendar_addon_manifest.py +++ /dev/null @@ -1,184 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from __future__ import annotations - -from typing import MutableMapping, MutableSequence - -import proto # type: ignore - -from google.apps.script.type.types import extension_point - - -__protobuf__ = proto.module( - package='google.apps.script.type.calendar', - manifest={ - 'CalendarAddOnManifest', - 'ConferenceSolution', - 'CalendarExtensionPoint', - }, -) - - -class CalendarAddOnManifest(proto.Message): - r"""Calendar add-on manifest. - - Attributes: - homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): - Defines an endpoint that will be executed contexts that - don't match a declared contextual trigger. Any cards - generated by this function will always be available to the - user, but may be eclipsed by contextual content when this - add-on declares more targeted triggers. - - If present, this overrides the configuration from - ``addOns.common.homepageTrigger``. - conference_solution (MutableSequence[google.apps.script.type.calendar.types.ConferenceSolution]): - Defines conference solutions provided by this - add-on. - create_settings_url_function (str): - An endpoint to execute that creates a URL to - the add-on's settings page. - event_open_trigger (google.apps.script.type.calendar.types.CalendarExtensionPoint): - An endpoint to trigger when an event is - opened (viewed/edited). - event_update_trigger (google.apps.script.type.calendar.types.CalendarExtensionPoint): - An endpoint to trigger when the open event is - updated. - current_event_access (google.apps.script.type.calendar.types.CalendarAddOnManifest.EventAccess): - Define the level of data access when an event - addon is triggered. - """ - class EventAccess(proto.Enum): - r"""An enum defining the level of data access event triggers - require. - - Values: - UNSPECIFIED (0): - Default value when nothing is set for - EventAccess. - METADATA (1): - METADATA gives event triggers the permission - to access the metadata of events such as event - id and calendar id. - READ (3): - READ gives event triggers access to all - provided event fields including the metadata, - attendees, and conference data. - WRITE (4): - WRITE gives event triggers access to the - metadata of events and the ability to perform - all actions, including adding attendees and - setting conference data. - READ_WRITE (5): - READ_WRITE gives event triggers access to all provided event - fields including the metadata, attendees, and conference - data and the ability to perform all actions. - """ - UNSPECIFIED = 0 - METADATA = 1 - READ = 3 - WRITE = 4 - READ_WRITE = 5 - - homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( - proto.MESSAGE, - number=6, - message=extension_point.HomepageExtensionPoint, - ) - conference_solution: MutableSequence['ConferenceSolution'] = proto.RepeatedField( - proto.MESSAGE, - number=3, - message='ConferenceSolution', - ) - create_settings_url_function: str = proto.Field( - proto.STRING, - number=5, - ) - event_open_trigger: 'CalendarExtensionPoint' = proto.Field( - proto.MESSAGE, - number=10, - message='CalendarExtensionPoint', - ) - event_update_trigger: 'CalendarExtensionPoint' = proto.Field( - proto.MESSAGE, - number=11, - message='CalendarExtensionPoint', - ) - current_event_access: EventAccess = proto.Field( - proto.ENUM, - number=12, - enum=EventAccess, - ) - - -class ConferenceSolution(proto.Message): - r"""Defines conference related values. - - Attributes: - on_create_function (str): - Required. The endpoint to call when - ConferenceData should be created. - id (str): - Required. IDs should be unique across - ConferenceSolutions within one add-on, but this - is not strictly enforced. It is up to the add-on - developer to assign them uniquely, otherwise the - wrong ConferenceSolution may be used when the - add-on is triggered. While the developer may - change the display name of an add-on, the ID - should not be changed. - name (str): - Required. The display name of the - ConferenceSolution. - logo_url (str): - Required. The URL for the logo image of the - ConferenceSolution. - """ - - on_create_function: str = proto.Field( - proto.STRING, - number=1, - ) - id: str = proto.Field( - proto.STRING, - number=4, - ) - name: str = proto.Field( - proto.STRING, - number=5, - ) - logo_url: str = proto.Field( - proto.STRING, - number=6, - ) - - -class CalendarExtensionPoint(proto.Message): - r"""Common format for declaring a calendar add-on's triggers. - - Attributes: - run_function (str): - Required. The endpoint to execute when this - extension point is activated. - """ - - run_function: str = proto.Field( - proto.STRING, - number=1, - ) - - -__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/__init__.py deleted file mode 100644 index 74558807cc62..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/__init__.py +++ /dev/null @@ -1,28 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from google.apps.script.type.docs import gapic_version as package_version - -__version__ = package_version.__version__ - - - -from .types.docs_addon_manifest import DocsAddOnManifest -from .types.docs_addon_manifest import DocsExtensionPoint - -__all__ = ( -'DocsAddOnManifest', -'DocsExtensionPoint', -) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/gapic_metadata.json deleted file mode 100644 index 5df2a0423a5e..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/gapic_metadata.json +++ /dev/null @@ -1,7 +0,0 @@ - { - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "python", - "libraryPackage": "google.apps.script.type.docs", - "protoPackage": "google.apps.script.type.docs", - "schema": "1.0" -} diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/gapic_version.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/gapic_version.py deleted file mode 100644 index 360a0d13ebdd..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/gapic_version.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/py.typed b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/py.typed deleted file mode 100644 index a954439caa66..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/py.typed +++ /dev/null @@ -1,2 +0,0 @@ -# Marker file for PEP 561. -# The google-apps-script-type-docs package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/services/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/services/__init__.py deleted file mode 100644 index 89a37dc92c5a..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/services/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/types/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/types/__init__.py deleted file mode 100644 index 1dbe144fc8ff..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/types/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from .docs_addon_manifest import ( - DocsAddOnManifest, - DocsExtensionPoint, -) - -__all__ = ( - 'DocsAddOnManifest', - 'DocsExtensionPoint', -) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/types/docs_addon_manifest.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/types/docs_addon_manifest.py deleted file mode 100644 index db2d01ed2b4c..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/docs/types/docs_addon_manifest.py +++ /dev/null @@ -1,74 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from __future__ import annotations - -from typing import MutableMapping, MutableSequence - -import proto # type: ignore - -from google.apps.script.type.types import extension_point - - -__protobuf__ = proto.module( - package='google.apps.script.type.docs', - manifest={ - 'DocsAddOnManifest', - 'DocsExtensionPoint', - }, -) - - -class DocsAddOnManifest(proto.Message): - r"""Docs add-on manifest. - - Attributes: - homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): - If present, this overrides the configuration from - ``addOns.common.homepageTrigger``. - on_file_scope_granted_trigger (google.apps.script.type.docs.types.DocsExtensionPoint): - Endpoint to execute when file scope - authorization is granted for this document/user - pair. - """ - - homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( - proto.MESSAGE, - number=1, - message=extension_point.HomepageExtensionPoint, - ) - on_file_scope_granted_trigger: 'DocsExtensionPoint' = proto.Field( - proto.MESSAGE, - number=2, - message='DocsExtensionPoint', - ) - - -class DocsExtensionPoint(proto.Message): - r"""Common format for declaring a Docs add-on's triggers. - - Attributes: - run_function (str): - Required. The endpoint to execute when this - extension point is activated. - """ - - run_function: str = proto.Field( - proto.STRING, - number=1, - ) - - -__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/__init__.py deleted file mode 100644 index 85f4fe7c43ca..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/__init__.py +++ /dev/null @@ -1,28 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from google.apps.script.type.drive import gapic_version as package_version - -__version__ = package_version.__version__ - - - -from .types.drive_addon_manifest import DriveAddOnManifest -from .types.drive_addon_manifest import DriveExtensionPoint - -__all__ = ( -'DriveAddOnManifest', -'DriveExtensionPoint', -) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/gapic_metadata.json deleted file mode 100644 index 89577093651d..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/gapic_metadata.json +++ /dev/null @@ -1,7 +0,0 @@ - { - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "python", - "libraryPackage": "google.apps.script.type.drive", - "protoPackage": "google.apps.script.type.drive", - "schema": "1.0" -} diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/gapic_version.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/gapic_version.py deleted file mode 100644 index 360a0d13ebdd..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/gapic_version.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/py.typed b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/py.typed deleted file mode 100644 index bbb573f18f73..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/py.typed +++ /dev/null @@ -1,2 +0,0 @@ -# Marker file for PEP 561. -# The google-apps-script-type-drive package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/services/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/services/__init__.py deleted file mode 100644 index 89a37dc92c5a..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/services/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/types/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/types/__init__.py deleted file mode 100644 index 85a4d7c4c5d6..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/types/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from .drive_addon_manifest import ( - DriveAddOnManifest, - DriveExtensionPoint, -) - -__all__ = ( - 'DriveAddOnManifest', - 'DriveExtensionPoint', -) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/types/drive_addon_manifest.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/types/drive_addon_manifest.py deleted file mode 100644 index b3c25a891c92..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/drive/types/drive_addon_manifest.py +++ /dev/null @@ -1,76 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from __future__ import annotations - -from typing import MutableMapping, MutableSequence - -import proto # type: ignore - -from google.apps.script.type.types import extension_point - - -__protobuf__ = proto.module( - package='google.apps.script.type.drive', - manifest={ - 'DriveAddOnManifest', - 'DriveExtensionPoint', - }, -) - - -class DriveAddOnManifest(proto.Message): - r"""Drive add-on manifest. - - Attributes: - homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): - If present, this overrides the configuration from - ``addOns.common.homepageTrigger``. - on_items_selected_trigger (google.apps.script.type.drive.types.DriveExtensionPoint): - Corresponds to behvior that should execute - when items are selected in relevant Drive view - (e.g. the My Drive Doclist). - """ - - homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( - proto.MESSAGE, - number=1, - message=extension_point.HomepageExtensionPoint, - ) - on_items_selected_trigger: 'DriveExtensionPoint' = proto.Field( - proto.MESSAGE, - number=2, - message='DriveExtensionPoint', - ) - - -class DriveExtensionPoint(proto.Message): - r"""A generic extension point with common features, e.g. - something that simply needs a corresponding run function to - work. - - Attributes: - run_function (str): - Required. The endpoint to execute when this - extension point is activated. - """ - - run_function: str = proto.Field( - proto.STRING, - number=1, - ) - - -__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_metadata.json deleted file mode 100644 index ba4a361d1caf..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_metadata.json +++ /dev/null @@ -1,7 +0,0 @@ - { - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "python", - "libraryPackage": "google.apps.script.type", - "protoPackage": "google.apps.script.type", - "schema": "1.0" -} diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_version.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_version.py deleted file mode 100644 index 360a0d13ebdd..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_version.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/__init__.py deleted file mode 100644 index d7365c75fa24..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/__init__.py +++ /dev/null @@ -1,34 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from google.apps.script.type.gmail import gapic_version as package_version - -__version__ = package_version.__version__ - - - -from .types.gmail_addon_manifest import ComposeTrigger -from .types.gmail_addon_manifest import ContextualTrigger -from .types.gmail_addon_manifest import GmailAddOnManifest -from .types.gmail_addon_manifest import UnconditionalTrigger -from .types.gmail_addon_manifest import UniversalAction - -__all__ = ( -'ComposeTrigger', -'ContextualTrigger', -'GmailAddOnManifest', -'UnconditionalTrigger', -'UniversalAction', -) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/gapic_metadata.json deleted file mode 100644 index 7733a14a8ce4..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/gapic_metadata.json +++ /dev/null @@ -1,7 +0,0 @@ - { - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "python", - "libraryPackage": "google.apps.script.type.gmail", - "protoPackage": "google.apps.script.type.gmail", - "schema": "1.0" -} diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/gapic_version.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/gapic_version.py deleted file mode 100644 index 360a0d13ebdd..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/gapic_version.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/py.typed b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/py.typed deleted file mode 100644 index 0906e16feda1..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/py.typed +++ /dev/null @@ -1,2 +0,0 @@ -# Marker file for PEP 561. -# The google-apps-script-type-gmail package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/services/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/services/__init__.py deleted file mode 100644 index 89a37dc92c5a..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/services/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/types/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/types/__init__.py deleted file mode 100644 index 3cc8dd5e9376..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/types/__init__.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from .gmail_addon_manifest import ( - ComposeTrigger, - ContextualTrigger, - GmailAddOnManifest, - UnconditionalTrigger, - UniversalAction, -) - -__all__ = ( - 'ComposeTrigger', - 'ContextualTrigger', - 'GmailAddOnManifest', - 'UnconditionalTrigger', - 'UniversalAction', -) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/types/gmail_addon_manifest.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/types/gmail_addon_manifest.py deleted file mode 100644 index e1164e06eb83..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gmail/types/gmail_addon_manifest.py +++ /dev/null @@ -1,232 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from __future__ import annotations - -from typing import MutableMapping, MutableSequence - -import proto # type: ignore - -from google.apps.script.type.types import extension_point - - -__protobuf__ = proto.module( - package='google.apps.script.type.gmail', - manifest={ - 'GmailAddOnManifest', - 'UniversalAction', - 'ComposeTrigger', - 'ContextualTrigger', - 'UnconditionalTrigger', - }, -) - - -class GmailAddOnManifest(proto.Message): - r"""Properties customizing the appearance and execution of a - Gmail add-on. - - Attributes: - homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): - Defines an endpoint that will be executed in contexts that - don't match a declared contextual trigger. Any cards - generated by this function will always be available to the - user, but may be eclipsed by contextual content when this - add-on declares more targeted triggers. - - If present, this overrides the configuration from - ``addOns.common.homepageTrigger``. - contextual_triggers (MutableSequence[google.apps.script.type.gmail.types.ContextualTrigger]): - Defines the set of conditions that trigger - the add-on. - universal_actions (MutableSequence[google.apps.script.type.gmail.types.UniversalAction]): - Defines set of `universal - actions `__ for - the add-on. The user triggers universal actions from the - add-on toolbar menu. - compose_trigger (google.apps.script.type.gmail.types.ComposeTrigger): - Defines the compose time trigger for a - compose time add-on. This is the trigger that - causes an add-on to take action when the user is - composing an email. - All compose time addons are required to have the - gmail.addons.current.action.compose scope even - though it might not edit the draft. - authorization_check_function (str): - The name of an endpoint that verifies that - the add-on has all the required third-party - authorizations, by probing the third-party APIs. - If the probe fails, the function should throw an - exception to initiate the authorization flow. - This function is called before each invocation - of the add-on, in order to ensure a smooth user - experience. - """ - - homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( - proto.MESSAGE, - number=14, - message=extension_point.HomepageExtensionPoint, - ) - contextual_triggers: MutableSequence['ContextualTrigger'] = proto.RepeatedField( - proto.MESSAGE, - number=3, - message='ContextualTrigger', - ) - universal_actions: MutableSequence['UniversalAction'] = proto.RepeatedField( - proto.MESSAGE, - number=4, - message='UniversalAction', - ) - compose_trigger: 'ComposeTrigger' = proto.Field( - proto.MESSAGE, - number=12, - message='ComposeTrigger', - ) - authorization_check_function: str = proto.Field( - proto.STRING, - number=7, - ) - - -class UniversalAction(proto.Message): - r"""An action that is always available in the add-on toolbar menu - regardless of message context. - - This message has `oneof`_ fields (mutually exclusive fields). - For each oneof, at most one member field can be set at the same time. - Setting any member of the oneof automatically clears all other - members. - - .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields - - Attributes: - text (str): - Required. User-visible text describing the - action, for example, "Add a new contact.". - open_link (str): - A link that is opened by Gmail when the user - triggers the action. - - This field is a member of `oneof`_ ``action_type``. - run_function (str): - An endpoint that is called when the user triggers the - action. See the `universal actions - guide `__ for - details. - - This field is a member of `oneof`_ ``action_type``. - """ - - text: str = proto.Field( - proto.STRING, - number=1, - ) - open_link: str = proto.Field( - proto.STRING, - number=2, - oneof='action_type', - ) - run_function: str = proto.Field( - proto.STRING, - number=3, - oneof='action_type', - ) - - -class ComposeTrigger(proto.Message): - r"""A trigger that activates when user is composing an email. - - Attributes: - actions (MutableSequence[google.apps.script.type.types.MenuItemExtensionPoint]): - Defines the set of actions for compose time - add-on. These are actions that user can trigger - on a compose time addon. - draft_access (google.apps.script.type.gmail.types.ComposeTrigger.DraftAccess): - Define the level of data access when a - compose time addon is triggered. - """ - class DraftAccess(proto.Enum): - r"""An enum defining the level of data access this compose - trigger requires. - - Values: - UNSPECIFIED (0): - Default value when nothing is set for - DraftAccess. - NONE (1): - NONE means compose trigger won't be able to - access any data of the draft when a compose - addon is triggered. - METADATA (2): - METADATA gives compose trigger the permission - to access the metadata of the draft when a - compose addon is triggered. This includes the - audience list (To/cc list) of a draft message. - """ - UNSPECIFIED = 0 - NONE = 1 - METADATA = 2 - - actions: MutableSequence[extension_point.MenuItemExtensionPoint] = proto.RepeatedField( - proto.MESSAGE, - number=5, - message=extension_point.MenuItemExtensionPoint, - ) - draft_access: DraftAccess = proto.Field( - proto.ENUM, - number=4, - enum=DraftAccess, - ) - - -class ContextualTrigger(proto.Message): - r"""Defines a trigger that fires when the open email meets a - specific criteria. When the trigger fires, it executes a - specific endpoint, usually in order to create new cards and - update the UI. - - - .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields - - Attributes: - unconditional (google.apps.script.type.gmail.types.UnconditionalTrigger): - UnconditionalTriggers are executed when any - mail message is opened. - - This field is a member of `oneof`_ ``trigger``. - on_trigger_function (str): - Required. The name of the endpoint to call - when a message matches the trigger. - """ - - unconditional: 'UnconditionalTrigger' = proto.Field( - proto.MESSAGE, - number=1, - oneof='trigger', - message='UnconditionalTrigger', - ) - on_trigger_function: str = proto.Field( - proto.STRING, - number=4, - ) - - -class UnconditionalTrigger(proto.Message): - r"""A trigger that fires when any email message is opened. - """ - - -__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/py.typed b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/py.typed deleted file mode 100644 index 04b9596b161d..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/py.typed +++ /dev/null @@ -1,2 +0,0 @@ -# Marker file for PEP 561. -# The google-apps-script-type package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/services/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/services/__init__.py deleted file mode 100644 index 89a37dc92c5a..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/services/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/__init__.py deleted file mode 100644 index 4188159ee265..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/__init__.py +++ /dev/null @@ -1,28 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from google.apps.script.type.sheets import gapic_version as package_version - -__version__ = package_version.__version__ - - - -from .types.sheets_addon_manifest import SheetsAddOnManifest -from .types.sheets_addon_manifest import SheetsExtensionPoint - -__all__ = ( -'SheetsAddOnManifest', -'SheetsExtensionPoint', -) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/gapic_metadata.json deleted file mode 100644 index f43947aa567d..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/gapic_metadata.json +++ /dev/null @@ -1,7 +0,0 @@ - { - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "python", - "libraryPackage": "google.apps.script.type.sheets", - "protoPackage": "google.apps.script.type.sheets", - "schema": "1.0" -} diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/gapic_version.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/gapic_version.py deleted file mode 100644 index 360a0d13ebdd..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/gapic_version.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/py.typed b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/py.typed deleted file mode 100644 index 4744d49c1dd6..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/py.typed +++ /dev/null @@ -1,2 +0,0 @@ -# Marker file for PEP 561. -# The google-apps-script-type-sheets package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/services/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/services/__init__.py deleted file mode 100644 index 89a37dc92c5a..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/services/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/types/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/types/__init__.py deleted file mode 100644 index 3ac5fa0d29c1..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/types/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from .sheets_addon_manifest import ( - SheetsAddOnManifest, - SheetsExtensionPoint, -) - -__all__ = ( - 'SheetsAddOnManifest', - 'SheetsExtensionPoint', -) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/types/sheets_addon_manifest.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/types/sheets_addon_manifest.py deleted file mode 100644 index 68313b777f64..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/sheets/types/sheets_addon_manifest.py +++ /dev/null @@ -1,74 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from __future__ import annotations - -from typing import MutableMapping, MutableSequence - -import proto # type: ignore - -from google.apps.script.type.types import extension_point - - -__protobuf__ = proto.module( - package='google.apps.script.type.sheets', - manifest={ - 'SheetsAddOnManifest', - 'SheetsExtensionPoint', - }, -) - - -class SheetsAddOnManifest(proto.Message): - r"""Sheets add-on manifest. - - Attributes: - homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): - If present, this overrides the configuration from - ``addOns.common.homepageTrigger``. - on_file_scope_granted_trigger (google.apps.script.type.sheets.types.SheetsExtensionPoint): - Endpoint to execute when file scope - authorization is granted for this document/user - pair. - """ - - homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( - proto.MESSAGE, - number=3, - message=extension_point.HomepageExtensionPoint, - ) - on_file_scope_granted_trigger: 'SheetsExtensionPoint' = proto.Field( - proto.MESSAGE, - number=5, - message='SheetsExtensionPoint', - ) - - -class SheetsExtensionPoint(proto.Message): - r"""Common format for declaring a Sheets add-on's triggers. - - Attributes: - run_function (str): - Required. The endpoint to execute when this - extension point is activated. - """ - - run_function: str = proto.Field( - proto.STRING, - number=1, - ) - - -__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/__init__.py deleted file mode 100644 index f356ec8e3574..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/__init__.py +++ /dev/null @@ -1,28 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from google.apps.script.type.slides import gapic_version as package_version - -__version__ = package_version.__version__ - - - -from .types.slides_addon_manifest import SlidesAddOnManifest -from .types.slides_addon_manifest import SlidesExtensionPoint - -__all__ = ( -'SlidesAddOnManifest', -'SlidesExtensionPoint', -) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/gapic_metadata.json deleted file mode 100644 index dff8f8bbc7bf..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/gapic_metadata.json +++ /dev/null @@ -1,7 +0,0 @@ - { - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "python", - "libraryPackage": "google.apps.script.type.slides", - "protoPackage": "google.apps.script.type.slides", - "schema": "1.0" -} diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/gapic_version.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/gapic_version.py deleted file mode 100644 index 360a0d13ebdd..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/gapic_version.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/py.typed b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/py.typed deleted file mode 100644 index eee2788b4c55..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/py.typed +++ /dev/null @@ -1,2 +0,0 @@ -# Marker file for PEP 561. -# The google-apps-script-type-slides package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/services/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/services/__init__.py deleted file mode 100644 index 89a37dc92c5a..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/services/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/types/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/types/__init__.py deleted file mode 100644 index eb85bf4a5a46..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/types/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from .slides_addon_manifest import ( - SlidesAddOnManifest, - SlidesExtensionPoint, -) - -__all__ = ( - 'SlidesAddOnManifest', - 'SlidesExtensionPoint', -) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/types/slides_addon_manifest.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/types/slides_addon_manifest.py deleted file mode 100644 index 1b54f5192821..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/slides/types/slides_addon_manifest.py +++ /dev/null @@ -1,74 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from __future__ import annotations - -from typing import MutableMapping, MutableSequence - -import proto # type: ignore - -from google.apps.script.type.types import extension_point - - -__protobuf__ = proto.module( - package='google.apps.script.type.slides', - manifest={ - 'SlidesAddOnManifest', - 'SlidesExtensionPoint', - }, -) - - -class SlidesAddOnManifest(proto.Message): - r"""Slides add-on manifest. - - Attributes: - homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): - If present, this overrides the configuration from - ``addOns.common.homepageTrigger``. - on_file_scope_granted_trigger (google.apps.script.type.slides.types.SlidesExtensionPoint): - Endpoint to execute when file scope - authorization is granted for this document/user - pair. - """ - - homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( - proto.MESSAGE, - number=1, - message=extension_point.HomepageExtensionPoint, - ) - on_file_scope_granted_trigger: 'SlidesExtensionPoint' = proto.Field( - proto.MESSAGE, - number=2, - message='SlidesExtensionPoint', - ) - - -class SlidesExtensionPoint(proto.Message): - r"""Common format for declaring a Slides add-on's triggers. - - Attributes: - run_function (str): - Required. The endpoint to execute when this - extension point is activated. - """ - - run_function: str = proto.Field( - proto.STRING, - number=1, - ) - - -__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/__init__.py deleted file mode 100644 index e8ebf1bcb7c6..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/__init__.py +++ /dev/null @@ -1,40 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from .addon_widget_set import ( - AddOnWidgetSet, -) -from .extension_point import ( - HomepageExtensionPoint, - MenuItemExtensionPoint, - UniversalActionExtensionPoint, -) -from .script_manifest import ( - CommonAddOnManifest, - HttpOptions, - LayoutProperties, - HttpAuthorizationHeader, -) - -__all__ = ( - 'AddOnWidgetSet', - 'HomepageExtensionPoint', - 'MenuItemExtensionPoint', - 'UniversalActionExtensionPoint', - 'CommonAddOnManifest', - 'HttpOptions', - 'LayoutProperties', - 'HttpAuthorizationHeader', -) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/addon_widget_set.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/addon_widget_set.py deleted file mode 100644 index d6379beb0be6..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/addon_widget_set.py +++ /dev/null @@ -1,78 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from __future__ import annotations - -from typing import MutableMapping, MutableSequence - -import proto # type: ignore - - -__protobuf__ = proto.module( - package='google.apps.script.type', - manifest={ - 'AddOnWidgetSet', - }, -) - - -class AddOnWidgetSet(proto.Message): - r"""The widget subset used by an add-on. - - Attributes: - used_widgets (MutableSequence[google.apps.script.type.types.AddOnWidgetSet.WidgetType]): - The list of widgets used in an add-on. - """ - class WidgetType(proto.Enum): - r"""The Widget type. DEFAULT is the basic widget set. - - Values: - WIDGET_TYPE_UNSPECIFIED (0): - The default widget set. - DATE_PICKER (1): - The date picker. - STYLED_BUTTONS (2): - Styled buttons include filled buttons and - disabled buttons. - PERSISTENT_FORMS (3): - Persistent forms allow persisting form values - during actions. - FIXED_FOOTER (4): - Fixed footer in card. - UPDATE_SUBJECT_AND_RECIPIENTS (5): - Update the subject and recipients of a draft. - GRID_WIDGET (6): - The grid widget. - ADDON_COMPOSE_UI_ACTION (7): - A Gmail add-on action that applies to the - addon compose UI. - """ - WIDGET_TYPE_UNSPECIFIED = 0 - DATE_PICKER = 1 - STYLED_BUTTONS = 2 - PERSISTENT_FORMS = 3 - FIXED_FOOTER = 4 - UPDATE_SUBJECT_AND_RECIPIENTS = 5 - GRID_WIDGET = 6 - ADDON_COMPOSE_UI_ACTION = 7 - - used_widgets: MutableSequence[WidgetType] = proto.RepeatedField( - proto.ENUM, - number=1, - enum=WidgetType, - ) - - -__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/extension_point.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/extension_point.py deleted file mode 100644 index 434e1c01a383..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/extension_point.py +++ /dev/null @@ -1,139 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from __future__ import annotations - -from typing import MutableMapping, MutableSequence - -import proto # type: ignore - -from google.protobuf import wrappers_pb2 # type: ignore - - -__protobuf__ = proto.module( - package='google.apps.script.type', - manifest={ - 'MenuItemExtensionPoint', - 'HomepageExtensionPoint', - 'UniversalActionExtensionPoint', - }, -) - - -class MenuItemExtensionPoint(proto.Message): - r"""Common format for declaring a menu item, or button, that - appears within a host app. - - Attributes: - run_function (str): - Required. The endpoint to execute when this - extension point is activated. - label (str): - Required. User-visible text describing the - action taken by activating this extension point. - For example, "Insert invoice". - logo_url (str): - The URL for the logo image shown in the - add-on toolbar. - If not set, defaults to the add-on's primary - logo URL. - """ - - run_function: str = proto.Field( - proto.STRING, - number=1, - ) - label: str = proto.Field( - proto.STRING, - number=2, - ) - logo_url: str = proto.Field( - proto.STRING, - number=3, - ) - - -class HomepageExtensionPoint(proto.Message): - r"""Common format for declaring an add-on's home-page view. - - Attributes: - run_function (str): - Required. The endpoint to execute when this - extension point is activated. - enabled (google.protobuf.wrappers_pb2.BoolValue): - Optional. If set to ``false``, disable the home-page view in - this context. - - Defaults to ``true`` if unset. - - If an add-ons custom home-page view is disabled, an - autogenerated overview card will be provided for users - instead. - """ - - run_function: str = proto.Field( - proto.STRING, - number=1, - ) - enabled: wrappers_pb2.BoolValue = proto.Field( - proto.MESSAGE, - number=2, - message=wrappers_pb2.BoolValue, - ) - - -class UniversalActionExtensionPoint(proto.Message): - r"""Format for declaring a universal action menu item extension - point. - - This message has `oneof`_ fields (mutually exclusive fields). - For each oneof, at most one member field can be set at the same time. - Setting any member of the oneof automatically clears all other - members. - - .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields - - Attributes: - label (str): - Required. User-visible text describing the - action taken by activating this extension point, - for example, "Add a new contact". - open_link (str): - URL to be opened by the UniversalAction. - - This field is a member of `oneof`_ ``action_type``. - run_function (str): - Endpoint to be run by the UniversalAction. - - This field is a member of `oneof`_ ``action_type``. - """ - - label: str = proto.Field( - proto.STRING, - number=1, - ) - open_link: str = proto.Field( - proto.STRING, - number=2, - oneof='action_type', - ) - run_function: str = proto.Field( - proto.STRING, - number=3, - oneof='action_type', - ) - - -__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/script_manifest.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/script_manifest.py deleted file mode 100644 index 57d5b2415f2e..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/script_manifest.py +++ /dev/null @@ -1,186 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from __future__ import annotations - -from typing import MutableMapping, MutableSequence - -import proto # type: ignore - -from google.apps.script.type.types import addon_widget_set -from google.apps.script.type.types import extension_point -from google.protobuf import struct_pb2 # type: ignore - - -__protobuf__ = proto.module( - package='google.apps.script.type', - manifest={ - 'HttpAuthorizationHeader', - 'CommonAddOnManifest', - 'LayoutProperties', - 'HttpOptions', - }, -) - - -class HttpAuthorizationHeader(proto.Enum): - r"""Authorization header sent in add-on HTTP requests - - Values: - HTTP_AUTHORIZATION_HEADER_UNSPECIFIED (0): - Default value, equivalent to ``SYSTEM_ID_TOKEN`` - SYSTEM_ID_TOKEN (1): - Send an ID token for the project-specific - Google Workspace Add-ons system service account - (default) - USER_ID_TOKEN (2): - Send an ID token for the end user - NONE (3): - Do not send an Authentication header - """ - HTTP_AUTHORIZATION_HEADER_UNSPECIFIED = 0 - SYSTEM_ID_TOKEN = 1 - USER_ID_TOKEN = 2 - NONE = 3 - - -class CommonAddOnManifest(proto.Message): - r"""Add-on configuration that is shared across all add-on host - applications. - - Attributes: - name (str): - Required. The display name of the add-on. - logo_url (str): - Required. The URL for the logo image shown in - the add-on toolbar. - layout_properties (google.apps.script.type.types.LayoutProperties): - Common layout properties for the add-on - cards. - add_on_widget_set (google.apps.script.type.types.AddOnWidgetSet): - The widgets used in the add-on. If this field - is not specified, it indicates that default set - is used. - use_locale_from_app (bool): - Whether to pass locale information from host - app. - homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): - Defines an endpoint that will be executed in - any context, in any host. Any cards generated by - this function will always be available to the - user, but may be eclipsed by contextual content - when this add-on declares more targeted - triggers. - universal_actions (MutableSequence[google.apps.script.type.types.UniversalActionExtensionPoint]): - Defines a list of extension points in the - universal action menu which serves as a setting - menu for the add-on. The extension point can be - link URL to open or an endpoint to execute as a - form submission. - open_link_url_prefixes (google.protobuf.struct_pb2.ListValue): - An OpenLink action can only use a URL with an HTTPS, MAILTO - or TEL scheme. For HTTPS links, the URL must also - `match `__ - one of the prefixes specified in this whitelist. If the - prefix omits the scheme, HTTPS is assumed. Notice that HTTP - links are automatically rewritten to HTTPS links. - """ - - name: str = proto.Field( - proto.STRING, - number=1, - ) - logo_url: str = proto.Field( - proto.STRING, - number=2, - ) - layout_properties: 'LayoutProperties' = proto.Field( - proto.MESSAGE, - number=3, - message='LayoutProperties', - ) - add_on_widget_set: addon_widget_set.AddOnWidgetSet = proto.Field( - proto.MESSAGE, - number=4, - message=addon_widget_set.AddOnWidgetSet, - ) - use_locale_from_app: bool = proto.Field( - proto.BOOL, - number=5, - ) - homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( - proto.MESSAGE, - number=6, - message=extension_point.HomepageExtensionPoint, - ) - universal_actions: MutableSequence[extension_point.UniversalActionExtensionPoint] = proto.RepeatedField( - proto.MESSAGE, - number=7, - message=extension_point.UniversalActionExtensionPoint, - ) - open_link_url_prefixes: struct_pb2.ListValue = proto.Field( - proto.MESSAGE, - number=8, - message=struct_pb2.ListValue, - ) - - -class LayoutProperties(proto.Message): - r"""Card layout properties shared across all add-on host - applications. - - Attributes: - primary_color (str): - The primary color of the add-on. It sets the - color of toolbar. If no primary color is set - explicitly, the default value provided by the - framework is used. - secondary_color (str): - The secondary color of the add-on. It sets - the color of buttons. If primary color is set - but no secondary color is set, the secondary - color is the same as the primary color. If - neither primary color nor secondary color is - set, the default value provided by the framework - is used. - """ - - primary_color: str = proto.Field( - proto.STRING, - number=1, - ) - secondary_color: str = proto.Field( - proto.STRING, - number=2, - ) - - -class HttpOptions(proto.Message): - r"""Options for sending requests to add-on HTTP endpoints - - Attributes: - authorization_header (google.apps.script.type.types.HttpAuthorizationHeader): - Configuration for the token sent in the HTTP - Authorization header - """ - - authorization_header: 'HttpAuthorizationHeader' = proto.Field( - proto.ENUM, - number=1, - enum='HttpAuthorizationHeader', - ) - - -__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/type-py/mypy.ini b/owl-bot-staging/google-apps-script-type/type-py/mypy.ini deleted file mode 100644 index 574c5aed394b..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/mypy.ini +++ /dev/null @@ -1,3 +0,0 @@ -[mypy] -python_version = 3.7 -namespace_packages = True diff --git a/owl-bot-staging/google-apps-script-type/type-py/noxfile.py b/owl-bot-staging/google-apps-script-type/type-py/noxfile.py deleted file mode 100644 index 426935428392..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/noxfile.py +++ /dev/null @@ -1,184 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import os -import pathlib -import shutil -import subprocess -import sys - - -import nox # type: ignore - -ALL_PYTHON = [ - "3.7", - "3.8", - "3.9", - "3.10", - "3.11", -] - -CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() - -LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt" -PACKAGE_NAME = subprocess.check_output([sys.executable, "setup.py", "--name"], encoding="utf-8") - -BLACK_VERSION = "black==22.3.0" -BLACK_PATHS = ["docs", "google", "tests", "samples", "noxfile.py", "setup.py"] -DEFAULT_PYTHON_VERSION = "3.11" - -nox.sessions = [ - "unit", - "cover", - "mypy", - "check_lower_bounds" - # exclude update_lower_bounds from default - "docs", - "blacken", - "lint", - "lint_setup_py", -] - -@nox.session(python=ALL_PYTHON) -def unit(session): - """Run the unit test suite.""" - - session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') - session.install('-e', '.') - - session.run( - 'py.test', - '--quiet', - '--cov=google/apps/script/type/slides/', - '--cov=tests/', - '--cov-config=.coveragerc', - '--cov-report=term', - '--cov-report=html', - os.path.join('tests', 'unit', ''.join(session.posargs)) - ) - - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def cover(session): - """Run the final coverage report. - This outputs the coverage report aggregating coverage from the unit - test runs (not system test runs), and then erases coverage data. - """ - session.install("coverage", "pytest-cov") - session.run("coverage", "report", "--show-missing", "--fail-under=100") - - session.run("coverage", "erase") - - -@nox.session(python=ALL_PYTHON) -def mypy(session): - """Run the type checker.""" - session.install( - 'mypy', - 'types-requests', - 'types-protobuf' - ) - session.install('.') - session.run( - 'mypy', - '--explicit-package-bases', - 'google', - ) - - -@nox.session -def update_lower_bounds(session): - """Update lower bounds in constraints.txt to match setup.py""" - session.install('google-cloud-testutils') - session.install('.') - - session.run( - 'lower-bound-checker', - 'update', - '--package-name', - PACKAGE_NAME, - '--constraints-file', - str(LOWER_BOUND_CONSTRAINTS_FILE), - ) - - -@nox.session -def check_lower_bounds(session): - """Check lower bounds in setup.py are reflected in constraints file""" - session.install('google-cloud-testutils') - session.install('.') - - session.run( - 'lower-bound-checker', - 'check', - '--package-name', - PACKAGE_NAME, - '--constraints-file', - str(LOWER_BOUND_CONSTRAINTS_FILE), - ) - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def docs(session): - """Build the docs for this library.""" - - session.install("-e", ".") - session.install("sphinx==7.0.1", "alabaster", "recommonmark") - - shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) - session.run( - "sphinx-build", - "-W", # warnings as errors - "-T", # show full traceback on exception - "-N", # no colors - "-b", - "html", - "-d", - os.path.join("docs", "_build", "doctrees", ""), - os.path.join("docs", ""), - os.path.join("docs", "_build", "html", ""), - ) - - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def lint(session): - """Run linters. - - Returns a failure if the linters find linting errors or sufficiently - serious code quality issues. - """ - session.install("flake8", BLACK_VERSION) - session.run( - "black", - "--check", - *BLACK_PATHS, - ) - session.run("flake8", "google", "tests", "samples") - - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def blacken(session): - """Run black. Format code to uniform standard.""" - session.install(BLACK_VERSION) - session.run( - "black", - *BLACK_PATHS, - ) - - -@nox.session(python=DEFAULT_PYTHON_VERSION) -def lint_setup_py(session): - """Verify that setup.py is valid (including RST check).""" - session.install("docutils", "pygments") - session.run("python", "setup.py", "check", "--restructuredtext", "--strict") diff --git a/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_calendar_keywords.py b/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_calendar_keywords.py deleted file mode 100644 index 1ed0cfa7a38b..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_calendar_keywords.py +++ /dev/null @@ -1,175 +0,0 @@ -#! /usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import argparse -import os -import libcst as cst -import pathlib -import sys -from typing import (Any, Callable, Dict, List, Sequence, Tuple) - - -def partition( - predicate: Callable[[Any], bool], - iterator: Sequence[Any] -) -> Tuple[List[Any], List[Any]]: - """A stable, out-of-place partition.""" - results = ([], []) - - for i in iterator: - results[int(predicate(i))].append(i) - - # Returns trueList, falseList - return results[1], results[0] - - -class calendarCallTransformer(cst.CSTTransformer): - CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') - METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - } - - def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: - try: - key = original.func.attr.value - kword_params = self.METHOD_TO_PARAMS[key] - except (AttributeError, KeyError): - # Either not a method from the API or too convoluted to be sure. - return updated - - # If the existing code is valid, keyword args come after positional args. - # Therefore, all positional args must map to the first parameters. - args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) - if any(k.keyword.value == "request" for k in kwargs): - # We've already fixed this file, don't fix it again. - return updated - - kwargs, ctrl_kwargs = partition( - lambda a: a.keyword.value not in self.CTRL_PARAMS, - kwargs - ) - - args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] - ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) - for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) - - request_arg = cst.Arg( - value=cst.Dict([ - cst.DictElement( - cst.SimpleString("'{}'".format(name)), -cst.Element(value=arg.value) - ) - # Note: the args + kwargs looks silly, but keep in mind that - # the control parameters had to be stripped out, and that - # those could have been passed positionally or by keyword. - for name, arg in zip(kword_params, args + kwargs)]), - keyword=cst.Name("request") - ) - - return updated.with_changes( - args=[request_arg] + ctrl_kwargs - ) - - -def fix_files( - in_dir: pathlib.Path, - out_dir: pathlib.Path, - *, - transformer=calendarCallTransformer(), -): - """Duplicate the input dir to the output dir, fixing file method calls. - - Preconditions: - * in_dir is a real directory - * out_dir is a real, empty directory - """ - pyfile_gen = ( - pathlib.Path(os.path.join(root, f)) - for root, _, files in os.walk(in_dir) - for f in files if os.path.splitext(f)[1] == ".py" - ) - - for fpath in pyfile_gen: - with open(fpath, 'r') as f: - src = f.read() - - # Parse the code and insert method call fixes. - tree = cst.parse_module(src) - updated = tree.visit(transformer) - - # Create the path and directory structure for the new file. - updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) - updated_path.parent.mkdir(parents=True, exist_ok=True) - - # Generate the updated source file at the corresponding path. - with open(updated_path, 'w') as f: - f.write(updated.code) - - -if __name__ == '__main__': - parser = argparse.ArgumentParser( - description="""Fix up source that uses the calendar client library. - -The existing sources are NOT overwritten but are copied to output_dir with changes made. - -Note: This tool operates at a best-effort level at converting positional - parameters in client method calls to keyword based parameters. - Cases where it WILL FAIL include - A) * or ** expansion in a method call. - B) Calls via function or method alias (includes free function calls) - C) Indirect or dispatched calls (e.g. the method is looked up dynamically) - - These all constitute false negatives. The tool will also detect false - positives when an API method shares a name with another method. -""") - parser.add_argument( - '-d', - '--input-directory', - required=True, - dest='input_dir', - help='the input directory to walk for python files to fix up', - ) - parser.add_argument( - '-o', - '--output-directory', - required=True, - dest='output_dir', - help='the directory to output files fixed via un-flattening', - ) - args = parser.parse_args() - input_dir = pathlib.Path(args.input_dir) - output_dir = pathlib.Path(args.output_dir) - if not input_dir.is_dir(): - print( - f"input directory '{input_dir}' does not exist or is not a directory", - file=sys.stderr, - ) - sys.exit(-1) - - if not output_dir.is_dir(): - print( - f"output directory '{output_dir}' does not exist or is not a directory", - file=sys.stderr, - ) - sys.exit(-1) - - if os.listdir(output_dir): - print( - f"output directory '{output_dir}' is not empty", - file=sys.stderr, - ) - sys.exit(-1) - - fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_docs_keywords.py b/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_docs_keywords.py deleted file mode 100644 index d48b7b2fa613..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_docs_keywords.py +++ /dev/null @@ -1,175 +0,0 @@ -#! /usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import argparse -import os -import libcst as cst -import pathlib -import sys -from typing import (Any, Callable, Dict, List, Sequence, Tuple) - - -def partition( - predicate: Callable[[Any], bool], - iterator: Sequence[Any] -) -> Tuple[List[Any], List[Any]]: - """A stable, out-of-place partition.""" - results = ([], []) - - for i in iterator: - results[int(predicate(i))].append(i) - - # Returns trueList, falseList - return results[1], results[0] - - -class docsCallTransformer(cst.CSTTransformer): - CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') - METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - } - - def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: - try: - key = original.func.attr.value - kword_params = self.METHOD_TO_PARAMS[key] - except (AttributeError, KeyError): - # Either not a method from the API or too convoluted to be sure. - return updated - - # If the existing code is valid, keyword args come after positional args. - # Therefore, all positional args must map to the first parameters. - args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) - if any(k.keyword.value == "request" for k in kwargs): - # We've already fixed this file, don't fix it again. - return updated - - kwargs, ctrl_kwargs = partition( - lambda a: a.keyword.value not in self.CTRL_PARAMS, - kwargs - ) - - args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] - ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) - for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) - - request_arg = cst.Arg( - value=cst.Dict([ - cst.DictElement( - cst.SimpleString("'{}'".format(name)), -cst.Element(value=arg.value) - ) - # Note: the args + kwargs looks silly, but keep in mind that - # the control parameters had to be stripped out, and that - # those could have been passed positionally or by keyword. - for name, arg in zip(kword_params, args + kwargs)]), - keyword=cst.Name("request") - ) - - return updated.with_changes( - args=[request_arg] + ctrl_kwargs - ) - - -def fix_files( - in_dir: pathlib.Path, - out_dir: pathlib.Path, - *, - transformer=docsCallTransformer(), -): - """Duplicate the input dir to the output dir, fixing file method calls. - - Preconditions: - * in_dir is a real directory - * out_dir is a real, empty directory - """ - pyfile_gen = ( - pathlib.Path(os.path.join(root, f)) - for root, _, files in os.walk(in_dir) - for f in files if os.path.splitext(f)[1] == ".py" - ) - - for fpath in pyfile_gen: - with open(fpath, 'r') as f: - src = f.read() - - # Parse the code and insert method call fixes. - tree = cst.parse_module(src) - updated = tree.visit(transformer) - - # Create the path and directory structure for the new file. - updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) - updated_path.parent.mkdir(parents=True, exist_ok=True) - - # Generate the updated source file at the corresponding path. - with open(updated_path, 'w') as f: - f.write(updated.code) - - -if __name__ == '__main__': - parser = argparse.ArgumentParser( - description="""Fix up source that uses the docs client library. - -The existing sources are NOT overwritten but are copied to output_dir with changes made. - -Note: This tool operates at a best-effort level at converting positional - parameters in client method calls to keyword based parameters. - Cases where it WILL FAIL include - A) * or ** expansion in a method call. - B) Calls via function or method alias (includes free function calls) - C) Indirect or dispatched calls (e.g. the method is looked up dynamically) - - These all constitute false negatives. The tool will also detect false - positives when an API method shares a name with another method. -""") - parser.add_argument( - '-d', - '--input-directory', - required=True, - dest='input_dir', - help='the input directory to walk for python files to fix up', - ) - parser.add_argument( - '-o', - '--output-directory', - required=True, - dest='output_dir', - help='the directory to output files fixed via un-flattening', - ) - args = parser.parse_args() - input_dir = pathlib.Path(args.input_dir) - output_dir = pathlib.Path(args.output_dir) - if not input_dir.is_dir(): - print( - f"input directory '{input_dir}' does not exist or is not a directory", - file=sys.stderr, - ) - sys.exit(-1) - - if not output_dir.is_dir(): - print( - f"output directory '{output_dir}' does not exist or is not a directory", - file=sys.stderr, - ) - sys.exit(-1) - - if os.listdir(output_dir): - print( - f"output directory '{output_dir}' is not empty", - file=sys.stderr, - ) - sys.exit(-1) - - fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_drive_keywords.py b/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_drive_keywords.py deleted file mode 100644 index 7928863678e4..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_drive_keywords.py +++ /dev/null @@ -1,175 +0,0 @@ -#! /usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import argparse -import os -import libcst as cst -import pathlib -import sys -from typing import (Any, Callable, Dict, List, Sequence, Tuple) - - -def partition( - predicate: Callable[[Any], bool], - iterator: Sequence[Any] -) -> Tuple[List[Any], List[Any]]: - """A stable, out-of-place partition.""" - results = ([], []) - - for i in iterator: - results[int(predicate(i))].append(i) - - # Returns trueList, falseList - return results[1], results[0] - - -class driveCallTransformer(cst.CSTTransformer): - CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') - METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - } - - def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: - try: - key = original.func.attr.value - kword_params = self.METHOD_TO_PARAMS[key] - except (AttributeError, KeyError): - # Either not a method from the API or too convoluted to be sure. - return updated - - # If the existing code is valid, keyword args come after positional args. - # Therefore, all positional args must map to the first parameters. - args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) - if any(k.keyword.value == "request" for k in kwargs): - # We've already fixed this file, don't fix it again. - return updated - - kwargs, ctrl_kwargs = partition( - lambda a: a.keyword.value not in self.CTRL_PARAMS, - kwargs - ) - - args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] - ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) - for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) - - request_arg = cst.Arg( - value=cst.Dict([ - cst.DictElement( - cst.SimpleString("'{}'".format(name)), -cst.Element(value=arg.value) - ) - # Note: the args + kwargs looks silly, but keep in mind that - # the control parameters had to be stripped out, and that - # those could have been passed positionally or by keyword. - for name, arg in zip(kword_params, args + kwargs)]), - keyword=cst.Name("request") - ) - - return updated.with_changes( - args=[request_arg] + ctrl_kwargs - ) - - -def fix_files( - in_dir: pathlib.Path, - out_dir: pathlib.Path, - *, - transformer=driveCallTransformer(), -): - """Duplicate the input dir to the output dir, fixing file method calls. - - Preconditions: - * in_dir is a real directory - * out_dir is a real, empty directory - """ - pyfile_gen = ( - pathlib.Path(os.path.join(root, f)) - for root, _, files in os.walk(in_dir) - for f in files if os.path.splitext(f)[1] == ".py" - ) - - for fpath in pyfile_gen: - with open(fpath, 'r') as f: - src = f.read() - - # Parse the code and insert method call fixes. - tree = cst.parse_module(src) - updated = tree.visit(transformer) - - # Create the path and directory structure for the new file. - updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) - updated_path.parent.mkdir(parents=True, exist_ok=True) - - # Generate the updated source file at the corresponding path. - with open(updated_path, 'w') as f: - f.write(updated.code) - - -if __name__ == '__main__': - parser = argparse.ArgumentParser( - description="""Fix up source that uses the drive client library. - -The existing sources are NOT overwritten but are copied to output_dir with changes made. - -Note: This tool operates at a best-effort level at converting positional - parameters in client method calls to keyword based parameters. - Cases where it WILL FAIL include - A) * or ** expansion in a method call. - B) Calls via function or method alias (includes free function calls) - C) Indirect or dispatched calls (e.g. the method is looked up dynamically) - - These all constitute false negatives. The tool will also detect false - positives when an API method shares a name with another method. -""") - parser.add_argument( - '-d', - '--input-directory', - required=True, - dest='input_dir', - help='the input directory to walk for python files to fix up', - ) - parser.add_argument( - '-o', - '--output-directory', - required=True, - dest='output_dir', - help='the directory to output files fixed via un-flattening', - ) - args = parser.parse_args() - input_dir = pathlib.Path(args.input_dir) - output_dir = pathlib.Path(args.output_dir) - if not input_dir.is_dir(): - print( - f"input directory '{input_dir}' does not exist or is not a directory", - file=sys.stderr, - ) - sys.exit(-1) - - if not output_dir.is_dir(): - print( - f"output directory '{output_dir}' does not exist or is not a directory", - file=sys.stderr, - ) - sys.exit(-1) - - if os.listdir(output_dir): - print( - f"output directory '{output_dir}' is not empty", - file=sys.stderr, - ) - sys.exit(-1) - - fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_gmail_keywords.py b/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_gmail_keywords.py deleted file mode 100644 index c9dad594e8de..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_gmail_keywords.py +++ /dev/null @@ -1,175 +0,0 @@ -#! /usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import argparse -import os -import libcst as cst -import pathlib -import sys -from typing import (Any, Callable, Dict, List, Sequence, Tuple) - - -def partition( - predicate: Callable[[Any], bool], - iterator: Sequence[Any] -) -> Tuple[List[Any], List[Any]]: - """A stable, out-of-place partition.""" - results = ([], []) - - for i in iterator: - results[int(predicate(i))].append(i) - - # Returns trueList, falseList - return results[1], results[0] - - -class gmailCallTransformer(cst.CSTTransformer): - CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') - METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - } - - def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: - try: - key = original.func.attr.value - kword_params = self.METHOD_TO_PARAMS[key] - except (AttributeError, KeyError): - # Either not a method from the API or too convoluted to be sure. - return updated - - # If the existing code is valid, keyword args come after positional args. - # Therefore, all positional args must map to the first parameters. - args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) - if any(k.keyword.value == "request" for k in kwargs): - # We've already fixed this file, don't fix it again. - return updated - - kwargs, ctrl_kwargs = partition( - lambda a: a.keyword.value not in self.CTRL_PARAMS, - kwargs - ) - - args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] - ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) - for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) - - request_arg = cst.Arg( - value=cst.Dict([ - cst.DictElement( - cst.SimpleString("'{}'".format(name)), -cst.Element(value=arg.value) - ) - # Note: the args + kwargs looks silly, but keep in mind that - # the control parameters had to be stripped out, and that - # those could have been passed positionally or by keyword. - for name, arg in zip(kword_params, args + kwargs)]), - keyword=cst.Name("request") - ) - - return updated.with_changes( - args=[request_arg] + ctrl_kwargs - ) - - -def fix_files( - in_dir: pathlib.Path, - out_dir: pathlib.Path, - *, - transformer=gmailCallTransformer(), -): - """Duplicate the input dir to the output dir, fixing file method calls. - - Preconditions: - * in_dir is a real directory - * out_dir is a real, empty directory - """ - pyfile_gen = ( - pathlib.Path(os.path.join(root, f)) - for root, _, files in os.walk(in_dir) - for f in files if os.path.splitext(f)[1] == ".py" - ) - - for fpath in pyfile_gen: - with open(fpath, 'r') as f: - src = f.read() - - # Parse the code and insert method call fixes. - tree = cst.parse_module(src) - updated = tree.visit(transformer) - - # Create the path and directory structure for the new file. - updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) - updated_path.parent.mkdir(parents=True, exist_ok=True) - - # Generate the updated source file at the corresponding path. - with open(updated_path, 'w') as f: - f.write(updated.code) - - -if __name__ == '__main__': - parser = argparse.ArgumentParser( - description="""Fix up source that uses the gmail client library. - -The existing sources are NOT overwritten but are copied to output_dir with changes made. - -Note: This tool operates at a best-effort level at converting positional - parameters in client method calls to keyword based parameters. - Cases where it WILL FAIL include - A) * or ** expansion in a method call. - B) Calls via function or method alias (includes free function calls) - C) Indirect or dispatched calls (e.g. the method is looked up dynamically) - - These all constitute false negatives. The tool will also detect false - positives when an API method shares a name with another method. -""") - parser.add_argument( - '-d', - '--input-directory', - required=True, - dest='input_dir', - help='the input directory to walk for python files to fix up', - ) - parser.add_argument( - '-o', - '--output-directory', - required=True, - dest='output_dir', - help='the directory to output files fixed via un-flattening', - ) - args = parser.parse_args() - input_dir = pathlib.Path(args.input_dir) - output_dir = pathlib.Path(args.output_dir) - if not input_dir.is_dir(): - print( - f"input directory '{input_dir}' does not exist or is not a directory", - file=sys.stderr, - ) - sys.exit(-1) - - if not output_dir.is_dir(): - print( - f"output directory '{output_dir}' does not exist or is not a directory", - file=sys.stderr, - ) - sys.exit(-1) - - if os.listdir(output_dir): - print( - f"output directory '{output_dir}' is not empty", - file=sys.stderr, - ) - sys.exit(-1) - - fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_sheets_keywords.py b/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_sheets_keywords.py deleted file mode 100644 index 4ef43f6bf0e1..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_sheets_keywords.py +++ /dev/null @@ -1,175 +0,0 @@ -#! /usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import argparse -import os -import libcst as cst -import pathlib -import sys -from typing import (Any, Callable, Dict, List, Sequence, Tuple) - - -def partition( - predicate: Callable[[Any], bool], - iterator: Sequence[Any] -) -> Tuple[List[Any], List[Any]]: - """A stable, out-of-place partition.""" - results = ([], []) - - for i in iterator: - results[int(predicate(i))].append(i) - - # Returns trueList, falseList - return results[1], results[0] - - -class sheetsCallTransformer(cst.CSTTransformer): - CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') - METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - } - - def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: - try: - key = original.func.attr.value - kword_params = self.METHOD_TO_PARAMS[key] - except (AttributeError, KeyError): - # Either not a method from the API or too convoluted to be sure. - return updated - - # If the existing code is valid, keyword args come after positional args. - # Therefore, all positional args must map to the first parameters. - args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) - if any(k.keyword.value == "request" for k in kwargs): - # We've already fixed this file, don't fix it again. - return updated - - kwargs, ctrl_kwargs = partition( - lambda a: a.keyword.value not in self.CTRL_PARAMS, - kwargs - ) - - args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] - ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) - for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) - - request_arg = cst.Arg( - value=cst.Dict([ - cst.DictElement( - cst.SimpleString("'{}'".format(name)), -cst.Element(value=arg.value) - ) - # Note: the args + kwargs looks silly, but keep in mind that - # the control parameters had to be stripped out, and that - # those could have been passed positionally or by keyword. - for name, arg in zip(kword_params, args + kwargs)]), - keyword=cst.Name("request") - ) - - return updated.with_changes( - args=[request_arg] + ctrl_kwargs - ) - - -def fix_files( - in_dir: pathlib.Path, - out_dir: pathlib.Path, - *, - transformer=sheetsCallTransformer(), -): - """Duplicate the input dir to the output dir, fixing file method calls. - - Preconditions: - * in_dir is a real directory - * out_dir is a real, empty directory - """ - pyfile_gen = ( - pathlib.Path(os.path.join(root, f)) - for root, _, files in os.walk(in_dir) - for f in files if os.path.splitext(f)[1] == ".py" - ) - - for fpath in pyfile_gen: - with open(fpath, 'r') as f: - src = f.read() - - # Parse the code and insert method call fixes. - tree = cst.parse_module(src) - updated = tree.visit(transformer) - - # Create the path and directory structure for the new file. - updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) - updated_path.parent.mkdir(parents=True, exist_ok=True) - - # Generate the updated source file at the corresponding path. - with open(updated_path, 'w') as f: - f.write(updated.code) - - -if __name__ == '__main__': - parser = argparse.ArgumentParser( - description="""Fix up source that uses the sheets client library. - -The existing sources are NOT overwritten but are copied to output_dir with changes made. - -Note: This tool operates at a best-effort level at converting positional - parameters in client method calls to keyword based parameters. - Cases where it WILL FAIL include - A) * or ** expansion in a method call. - B) Calls via function or method alias (includes free function calls) - C) Indirect or dispatched calls (e.g. the method is looked up dynamically) - - These all constitute false negatives. The tool will also detect false - positives when an API method shares a name with another method. -""") - parser.add_argument( - '-d', - '--input-directory', - required=True, - dest='input_dir', - help='the input directory to walk for python files to fix up', - ) - parser.add_argument( - '-o', - '--output-directory', - required=True, - dest='output_dir', - help='the directory to output files fixed via un-flattening', - ) - args = parser.parse_args() - input_dir = pathlib.Path(args.input_dir) - output_dir = pathlib.Path(args.output_dir) - if not input_dir.is_dir(): - print( - f"input directory '{input_dir}' does not exist or is not a directory", - file=sys.stderr, - ) - sys.exit(-1) - - if not output_dir.is_dir(): - print( - f"output directory '{output_dir}' does not exist or is not a directory", - file=sys.stderr, - ) - sys.exit(-1) - - if os.listdir(output_dir): - print( - f"output directory '{output_dir}' is not empty", - file=sys.stderr, - ) - sys.exit(-1) - - fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_slides_keywords.py b/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_slides_keywords.py deleted file mode 100644 index 6937fd026deb..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_slides_keywords.py +++ /dev/null @@ -1,175 +0,0 @@ -#! /usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import argparse -import os -import libcst as cst -import pathlib -import sys -from typing import (Any, Callable, Dict, List, Sequence, Tuple) - - -def partition( - predicate: Callable[[Any], bool], - iterator: Sequence[Any] -) -> Tuple[List[Any], List[Any]]: - """A stable, out-of-place partition.""" - results = ([], []) - - for i in iterator: - results[int(predicate(i))].append(i) - - # Returns trueList, falseList - return results[1], results[0] - - -class slidesCallTransformer(cst.CSTTransformer): - CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') - METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - } - - def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: - try: - key = original.func.attr.value - kword_params = self.METHOD_TO_PARAMS[key] - except (AttributeError, KeyError): - # Either not a method from the API or too convoluted to be sure. - return updated - - # If the existing code is valid, keyword args come after positional args. - # Therefore, all positional args must map to the first parameters. - args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) - if any(k.keyword.value == "request" for k in kwargs): - # We've already fixed this file, don't fix it again. - return updated - - kwargs, ctrl_kwargs = partition( - lambda a: a.keyword.value not in self.CTRL_PARAMS, - kwargs - ) - - args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] - ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) - for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) - - request_arg = cst.Arg( - value=cst.Dict([ - cst.DictElement( - cst.SimpleString("'{}'".format(name)), -cst.Element(value=arg.value) - ) - # Note: the args + kwargs looks silly, but keep in mind that - # the control parameters had to be stripped out, and that - # those could have been passed positionally or by keyword. - for name, arg in zip(kword_params, args + kwargs)]), - keyword=cst.Name("request") - ) - - return updated.with_changes( - args=[request_arg] + ctrl_kwargs - ) - - -def fix_files( - in_dir: pathlib.Path, - out_dir: pathlib.Path, - *, - transformer=slidesCallTransformer(), -): - """Duplicate the input dir to the output dir, fixing file method calls. - - Preconditions: - * in_dir is a real directory - * out_dir is a real, empty directory - """ - pyfile_gen = ( - pathlib.Path(os.path.join(root, f)) - for root, _, files in os.walk(in_dir) - for f in files if os.path.splitext(f)[1] == ".py" - ) - - for fpath in pyfile_gen: - with open(fpath, 'r') as f: - src = f.read() - - # Parse the code and insert method call fixes. - tree = cst.parse_module(src) - updated = tree.visit(transformer) - - # Create the path and directory structure for the new file. - updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) - updated_path.parent.mkdir(parents=True, exist_ok=True) - - # Generate the updated source file at the corresponding path. - with open(updated_path, 'w') as f: - f.write(updated.code) - - -if __name__ == '__main__': - parser = argparse.ArgumentParser( - description="""Fix up source that uses the slides client library. - -The existing sources are NOT overwritten but are copied to output_dir with changes made. - -Note: This tool operates at a best-effort level at converting positional - parameters in client method calls to keyword based parameters. - Cases where it WILL FAIL include - A) * or ** expansion in a method call. - B) Calls via function or method alias (includes free function calls) - C) Indirect or dispatched calls (e.g. the method is looked up dynamically) - - These all constitute false negatives. The tool will also detect false - positives when an API method shares a name with another method. -""") - parser.add_argument( - '-d', - '--input-directory', - required=True, - dest='input_dir', - help='the input directory to walk for python files to fix up', - ) - parser.add_argument( - '-o', - '--output-directory', - required=True, - dest='output_dir', - help='the directory to output files fixed via un-flattening', - ) - args = parser.parse_args() - input_dir = pathlib.Path(args.input_dir) - output_dir = pathlib.Path(args.output_dir) - if not input_dir.is_dir(): - print( - f"input directory '{input_dir}' does not exist or is not a directory", - file=sys.stderr, - ) - sys.exit(-1) - - if not output_dir.is_dir(): - print( - f"output directory '{output_dir}' does not exist or is not a directory", - file=sys.stderr, - ) - sys.exit(-1) - - if os.listdir(output_dir): - print( - f"output directory '{output_dir}' is not empty", - file=sys.stderr, - ) - sys.exit(-1) - - fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_type_keywords.py b/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_type_keywords.py deleted file mode 100644 index f2e069a0f033..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_type_keywords.py +++ /dev/null @@ -1,175 +0,0 @@ -#! /usr/bin/env python3 -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import argparse -import os -import libcst as cst -import pathlib -import sys -from typing import (Any, Callable, Dict, List, Sequence, Tuple) - - -def partition( - predicate: Callable[[Any], bool], - iterator: Sequence[Any] -) -> Tuple[List[Any], List[Any]]: - """A stable, out-of-place partition.""" - results = ([], []) - - for i in iterator: - results[int(predicate(i))].append(i) - - # Returns trueList, falseList - return results[1], results[0] - - -class typeCallTransformer(cst.CSTTransformer): - CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') - METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - } - - def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: - try: - key = original.func.attr.value - kword_params = self.METHOD_TO_PARAMS[key] - except (AttributeError, KeyError): - # Either not a method from the API or too convoluted to be sure. - return updated - - # If the existing code is valid, keyword args come after positional args. - # Therefore, all positional args must map to the first parameters. - args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) - if any(k.keyword.value == "request" for k in kwargs): - # We've already fixed this file, don't fix it again. - return updated - - kwargs, ctrl_kwargs = partition( - lambda a: a.keyword.value not in self.CTRL_PARAMS, - kwargs - ) - - args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] - ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) - for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) - - request_arg = cst.Arg( - value=cst.Dict([ - cst.DictElement( - cst.SimpleString("'{}'".format(name)), -cst.Element(value=arg.value) - ) - # Note: the args + kwargs looks silly, but keep in mind that - # the control parameters had to be stripped out, and that - # those could have been passed positionally or by keyword. - for name, arg in zip(kword_params, args + kwargs)]), - keyword=cst.Name("request") - ) - - return updated.with_changes( - args=[request_arg] + ctrl_kwargs - ) - - -def fix_files( - in_dir: pathlib.Path, - out_dir: pathlib.Path, - *, - transformer=typeCallTransformer(), -): - """Duplicate the input dir to the output dir, fixing file method calls. - - Preconditions: - * in_dir is a real directory - * out_dir is a real, empty directory - """ - pyfile_gen = ( - pathlib.Path(os.path.join(root, f)) - for root, _, files in os.walk(in_dir) - for f in files if os.path.splitext(f)[1] == ".py" - ) - - for fpath in pyfile_gen: - with open(fpath, 'r') as f: - src = f.read() - - # Parse the code and insert method call fixes. - tree = cst.parse_module(src) - updated = tree.visit(transformer) - - # Create the path and directory structure for the new file. - updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) - updated_path.parent.mkdir(parents=True, exist_ok=True) - - # Generate the updated source file at the corresponding path. - with open(updated_path, 'w') as f: - f.write(updated.code) - - -if __name__ == '__main__': - parser = argparse.ArgumentParser( - description="""Fix up source that uses the type client library. - -The existing sources are NOT overwritten but are copied to output_dir with changes made. - -Note: This tool operates at a best-effort level at converting positional - parameters in client method calls to keyword based parameters. - Cases where it WILL FAIL include - A) * or ** expansion in a method call. - B) Calls via function or method alias (includes free function calls) - C) Indirect or dispatched calls (e.g. the method is looked up dynamically) - - These all constitute false negatives. The tool will also detect false - positives when an API method shares a name with another method. -""") - parser.add_argument( - '-d', - '--input-directory', - required=True, - dest='input_dir', - help='the input directory to walk for python files to fix up', - ) - parser.add_argument( - '-o', - '--output-directory', - required=True, - dest='output_dir', - help='the directory to output files fixed via un-flattening', - ) - args = parser.parse_args() - input_dir = pathlib.Path(args.input_dir) - output_dir = pathlib.Path(args.output_dir) - if not input_dir.is_dir(): - print( - f"input directory '{input_dir}' does not exist or is not a directory", - file=sys.stderr, - ) - sys.exit(-1) - - if not output_dir.is_dir(): - print( - f"output directory '{output_dir}' does not exist or is not a directory", - file=sys.stderr, - ) - sys.exit(-1) - - if os.listdir(output_dir): - print( - f"output directory '{output_dir}' is not empty", - file=sys.stderr, - ) - sys.exit(-1) - - fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/type-py/setup.py b/owl-bot-staging/google-apps-script-type/type-py/setup.py deleted file mode 100644 index 2deee65a5b5a..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/setup.py +++ /dev/null @@ -1,91 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -import io -import os - -import setuptools # type: ignore - -package_root = os.path.abspath(os.path.dirname(__file__)) - -name = 'google-apps-script-type-slides' - - -description = "Google Apps Script Type Slides API client library" - -version = {} -with open(os.path.join(package_root, 'google/apps/script/type/slides/gapic_version.py')) as fp: - exec(fp.read(), version) -version = version["__version__"] - -if version[0] == "0": - release_status = "Development Status :: 4 - Beta" -else: - release_status = "Development Status :: 5 - Production/Stable" - -dependencies = [ - "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", - "proto-plus >= 1.22.0, <2.0.0dev", - "proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'", - "protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", - "google-apps-script-type >= 0.2.0, <1.0.0dev", -] -url = "https://github.com/googleapis/python-apps-script-type-slides" - -package_root = os.path.abspath(os.path.dirname(__file__)) - -readme_filename = os.path.join(package_root, "README.rst") -with io.open(readme_filename, encoding="utf-8") as readme_file: - readme = readme_file.read() - -packages = [ - package - for package in setuptools.PEP420PackageFinder.find() - if package.startswith("google") -] - -namespaces = ["google", "google.apps", "google.apps.script", "google.apps.script.type"] - -setuptools.setup( - name=name, - version=version, - description=description, - long_description=readme, - author="Google LLC", - author_email="googleapis-packages@google.com", - license="Apache 2.0", - url=url, - classifiers=[ - release_status, - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Operating System :: OS Independent", - "Topic :: Internet", - ], - platforms="Posix; MacOS X; Windows", - packages=packages, - python_requires=">=3.7", - namespace_packages=namespaces, - install_requires=dependencies, - include_package_data=True, - zip_safe=False, -) diff --git a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.10.txt b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.10.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.10.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.11.txt b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.11.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.11.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.12.txt b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.12.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.12.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.7.txt b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.7.txt deleted file mode 100644 index 4ae34ff40304..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.7.txt +++ /dev/null @@ -1,10 +0,0 @@ -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file. -# Pin the version to the lower bound. -# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", -# Then this file should have google-cloud-foo==1.14.0 -google-api-core==1.34.0 -proto-plus==1.22.0 -protobuf==3.19.5 -google-apps-script-type==0.2.0 diff --git a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.8.txt b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.8.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.8.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.9.txt b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.9.txt deleted file mode 100644 index 3a9e27b606ec..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.9.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/type-py/tests/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/tests/__init__.py deleted file mode 100644 index 1b4db446eb8d..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/tests/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/__init__.py deleted file mode 100644 index 1b4db446eb8d..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/__init__.py deleted file mode 100644 index 1b4db446eb8d..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/calendar/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/calendar/__init__.py deleted file mode 100644 index 1b4db446eb8d..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/calendar/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/docs/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/docs/__init__.py deleted file mode 100644 index 1b4db446eb8d..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/docs/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/drive/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/drive/__init__.py deleted file mode 100644 index 1b4db446eb8d..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/drive/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/gmail/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/gmail/__init__.py deleted file mode 100644 index 1b4db446eb8d..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/gmail/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/sheets/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/sheets/__init__.py deleted file mode 100644 index 1b4db446eb8d..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/sheets/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/slides/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/slides/__init__.py deleted file mode 100644 index 1b4db446eb8d..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/slides/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/type/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/type/__init__.py deleted file mode 100644 index 1b4db446eb8d..000000000000 --- a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/type/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ - -# -*- coding: utf-8 -*- -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# diff --git a/packages/google-apps-script-type/.flake8 b/packages/google-apps-script-type/.flake8 index 2e438749863d..87f6e408c47d 100644 --- a/packages/google-apps-script-type/.flake8 +++ b/packages/google-apps-script-type/.flake8 @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright 2020 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-apps-script-type/CONTRIBUTING.rst b/packages/google-apps-script-type/CONTRIBUTING.rst index 820dac7ea427..1c2403f6b63e 100644 --- a/packages/google-apps-script-type/CONTRIBUTING.rst +++ b/packages/google-apps-script-type/CONTRIBUTING.rst @@ -236,7 +236,7 @@ We support: Supported versions can be found in our ``noxfile.py`` `config`_. -.. _config: https://github.com/googleapis/google-cloud-python/blob/main/noxfile.py +.. _config: https://github.com/googleapis/google-cloud-python/blob/main/packages/google-apps-script-type/noxfile.py ********** diff --git a/packages/google-apps-script-type/MANIFEST.in b/packages/google-apps-script-type/MANIFEST.in index e783f4c6209b..e0a66705318e 100644 --- a/packages/google-apps-script-type/MANIFEST.in +++ b/packages/google-apps-script-type/MANIFEST.in @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright 2020 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-apps-script-type/README.rst b/packages/google-apps-script-type/README.rst index bc32090e8cb7..3ca513ef66c8 100644 --- a/packages/google-apps-script-type/README.rst +++ b/packages/google-apps-script-type/README.rst @@ -36,21 +36,24 @@ In order to use this library, you first need to go through the following steps: Installation ~~~~~~~~~~~~ -Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to -create isolated Python environments. The basic problem it addresses is one of -dependencies and versions, and indirectly permissions. +Install this library in a virtual environment using `venv`_. `venv`_ is a tool that +creates isolated Python environments. These isolated environments can have separate +versions of Python packages, which allows you to isolate one project's dependencies +from the dependencies of other projects. -With `virtualenv`_, it's possible to install this library without needing system +With `venv`_, it's possible to install this library without needing system install permissions, and without clashing with the installed system dependencies. -.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ +.. _`venv`: https://docs.python.org/3/library/venv.html Code samples and snippets ~~~~~~~~~~~~~~~~~~~~~~~~~ -Code samples and snippets live in the `samples/` folder. +Code samples and snippets live in the `samples/`_ folder. + +.. _samples/: https://github.com/googleapis/google-cloud-python/tree/main/packages/google-apps-script-type/samples Supported Python Versions @@ -77,10 +80,9 @@ Mac/Linux .. code-block:: console - pip install virtualenv - virtualenv + python3 -m venv source /bin/activate - /bin/pip install google-apps-script-type + pip install google-apps-script-type Windows @@ -88,10 +90,9 @@ Windows .. code-block:: console - pip install virtualenv - virtualenv - \Scripts\activate - \Scripts\pip.exe install google-apps-script-type + py -m venv + .\\Scripts\activate + pip install google-apps-script-type Next Steps ~~~~~~~~~~ diff --git a/packages/google-apps-script-type/docs/conf.py b/packages/google-apps-script-type/docs/conf.py index 2b10a13f5b93..ab44fb1f60c8 100644 --- a/packages/google-apps-script-type/docs/conf.py +++ b/packages/google-apps-script-type/docs/conf.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2021 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-apps-script-type/docs/index.rst b/packages/google-apps-script-type/docs/index.rst index 383f38b0e249..71c050be8d28 100644 --- a/packages/google-apps-script-type/docs/index.rst +++ b/packages/google-apps-script-type/docs/index.rst @@ -1,34 +1,7 @@ -.. include:: README.rst - -.. include:: multiprocessing.rst - API Reference ------------- .. toctree:: :maxdepth: 2 - calendar/services - calendar/types - docs/services - docs/types - drive/services - drive/types - gmail/services - gmail/types - sheets/services - sheets/types slides/services slides/types - type/services - type/types - - -Changelog ---------- - -For a list of all ``google-apps-script-type`` releases: - -.. toctree:: - :maxdepth: 2 - - CHANGELOG diff --git a/packages/google-apps-script-type/google/apps/script/type/calendar/types/calendar_addon_manifest.py b/packages/google-apps-script-type/google/apps/script/type/calendar/types/calendar_addon_manifest.py index 95506ec6d33b..b231bd92b686 100644 --- a/packages/google-apps-script-type/google/apps/script/type/calendar/types/calendar_addon_manifest.py +++ b/packages/google-apps-script-type/google/apps/script/type/calendar/types/calendar_addon_manifest.py @@ -19,7 +19,7 @@ import proto # type: ignore -import google.apps.script.type.types # type: ignore +from google.apps.script.type.types import extension_point __protobuf__ = proto.module( package="google.apps.script.type.calendar", @@ -93,12 +93,10 @@ class EventAccess(proto.Enum): WRITE = 4 READ_WRITE = 5 - homepage_trigger: google.apps.script.type.types.HomepageExtensionPoint = ( - proto.Field( - proto.MESSAGE, - number=6, - message=google.apps.script.type.types.HomepageExtensionPoint, - ) + homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( + proto.MESSAGE, + number=6, + message=extension_point.HomepageExtensionPoint, ) conference_solution: MutableSequence["ConferenceSolution"] = proto.RepeatedField( proto.MESSAGE, diff --git a/packages/google-apps-script-type/google/apps/script/type/docs/types/docs_addon_manifest.py b/packages/google-apps-script-type/google/apps/script/type/docs/types/docs_addon_manifest.py index 4a0016e9406c..58e9772d8efe 100644 --- a/packages/google-apps-script-type/google/apps/script/type/docs/types/docs_addon_manifest.py +++ b/packages/google-apps-script-type/google/apps/script/type/docs/types/docs_addon_manifest.py @@ -19,7 +19,7 @@ import proto # type: ignore -import google.apps.script.type.types # type: ignore +from google.apps.script.type.types import extension_point __protobuf__ = proto.module( package="google.apps.script.type.docs", @@ -43,12 +43,10 @@ class DocsAddOnManifest(proto.Message): pair. """ - homepage_trigger: google.apps.script.type.types.HomepageExtensionPoint = ( - proto.Field( - proto.MESSAGE, - number=1, - message=google.apps.script.type.types.HomepageExtensionPoint, - ) + homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( + proto.MESSAGE, + number=1, + message=extension_point.HomepageExtensionPoint, ) on_file_scope_granted_trigger: "DocsExtensionPoint" = proto.Field( proto.MESSAGE, diff --git a/packages/google-apps-script-type/google/apps/script/type/drive/types/drive_addon_manifest.py b/packages/google-apps-script-type/google/apps/script/type/drive/types/drive_addon_manifest.py index f62767fc7c91..a0caf4922724 100644 --- a/packages/google-apps-script-type/google/apps/script/type/drive/types/drive_addon_manifest.py +++ b/packages/google-apps-script-type/google/apps/script/type/drive/types/drive_addon_manifest.py @@ -19,7 +19,7 @@ import proto # type: ignore -import google.apps.script.type.types # type: ignore +from google.apps.script.type.types import extension_point __protobuf__ = proto.module( package="google.apps.script.type.drive", @@ -43,12 +43,10 @@ class DriveAddOnManifest(proto.Message): (e.g. the My Drive Doclist). """ - homepage_trigger: google.apps.script.type.types.HomepageExtensionPoint = ( - proto.Field( - proto.MESSAGE, - number=1, - message=google.apps.script.type.types.HomepageExtensionPoint, - ) + homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( + proto.MESSAGE, + number=1, + message=extension_point.HomepageExtensionPoint, ) on_items_selected_trigger: "DriveExtensionPoint" = proto.Field( proto.MESSAGE, diff --git a/packages/google-apps-script-type/google/apps/script/type/gmail/types/gmail_addon_manifest.py b/packages/google-apps-script-type/google/apps/script/type/gmail/types/gmail_addon_manifest.py index e650a4b3501d..d9ee22e614e5 100644 --- a/packages/google-apps-script-type/google/apps/script/type/gmail/types/gmail_addon_manifest.py +++ b/packages/google-apps-script-type/google/apps/script/type/gmail/types/gmail_addon_manifest.py @@ -19,7 +19,7 @@ import proto # type: ignore -import google.apps.script.type.types # type: ignore +from google.apps.script.type.types import extension_point __protobuf__ = proto.module( package="google.apps.script.type.gmail", @@ -74,12 +74,10 @@ class GmailAddOnManifest(proto.Message): experience. """ - homepage_trigger: google.apps.script.type.types.HomepageExtensionPoint = ( - proto.Field( - proto.MESSAGE, - number=14, - message=google.apps.script.type.types.HomepageExtensionPoint, - ) + homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( + proto.MESSAGE, + number=14, + message=extension_point.HomepageExtensionPoint, ) contextual_triggers: MutableSequence["ContextualTrigger"] = proto.RepeatedField( proto.MESSAGE, @@ -183,11 +181,11 @@ class DraftAccess(proto.Enum): METADATA = 2 actions: MutableSequence[ - google.apps.script.type.types.MenuItemExtensionPoint + extension_point.MenuItemExtensionPoint ] = proto.RepeatedField( proto.MESSAGE, number=5, - message=google.apps.script.type.types.MenuItemExtensionPoint, + message=extension_point.MenuItemExtensionPoint, ) draft_access: DraftAccess = proto.Field( proto.ENUM, diff --git a/packages/google-apps-script-type/google/apps/script/type/sheets/types/sheets_addon_manifest.py b/packages/google-apps-script-type/google/apps/script/type/sheets/types/sheets_addon_manifest.py index 277d9f1008d7..92b171542177 100644 --- a/packages/google-apps-script-type/google/apps/script/type/sheets/types/sheets_addon_manifest.py +++ b/packages/google-apps-script-type/google/apps/script/type/sheets/types/sheets_addon_manifest.py @@ -19,7 +19,7 @@ import proto # type: ignore -import google.apps.script.type.types # type: ignore +from google.apps.script.type.types import extension_point __protobuf__ = proto.module( package="google.apps.script.type.sheets", @@ -43,12 +43,10 @@ class SheetsAddOnManifest(proto.Message): pair. """ - homepage_trigger: google.apps.script.type.types.HomepageExtensionPoint = ( - proto.Field( - proto.MESSAGE, - number=3, - message=google.apps.script.type.types.HomepageExtensionPoint, - ) + homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( + proto.MESSAGE, + number=3, + message=extension_point.HomepageExtensionPoint, ) on_file_scope_granted_trigger: "SheetsExtensionPoint" = proto.Field( proto.MESSAGE, diff --git a/packages/google-apps-script-type/google/apps/script/type/slides/types/slides_addon_manifest.py b/packages/google-apps-script-type/google/apps/script/type/slides/types/slides_addon_manifest.py index a8398c601fbe..9b778ee4d7ae 100644 --- a/packages/google-apps-script-type/google/apps/script/type/slides/types/slides_addon_manifest.py +++ b/packages/google-apps-script-type/google/apps/script/type/slides/types/slides_addon_manifest.py @@ -19,7 +19,7 @@ import proto # type: ignore -import google.apps.script.type.types # type: ignore +from google.apps.script.type.types import extension_point __protobuf__ = proto.module( package="google.apps.script.type.slides", @@ -43,12 +43,10 @@ class SlidesAddOnManifest(proto.Message): pair. """ - homepage_trigger: google.apps.script.type.types.HomepageExtensionPoint = ( - proto.Field( - proto.MESSAGE, - number=1, - message=google.apps.script.type.types.HomepageExtensionPoint, - ) + homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( + proto.MESSAGE, + number=1, + message=extension_point.HomepageExtensionPoint, ) on_file_scope_granted_trigger: "SlidesExtensionPoint" = proto.Field( proto.MESSAGE, diff --git a/packages/google-apps-script-type/noxfile.py b/packages/google-apps-script-type/noxfile.py index 6f5debd52f23..9a2acd8b6787 100644 --- a/packages/google-apps-script-type/noxfile.py +++ b/packages/google-apps-script-type/noxfile.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright 2018 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-apps-script-type/scripts/decrypt-secrets.sh b/packages/google-apps-script-type/scripts/decrypt-secrets.sh index 21f6d2a26d90..0018b421ddf8 100755 --- a/packages/google-apps-script-type/scripts/decrypt-secrets.sh +++ b/packages/google-apps-script-type/scripts/decrypt-secrets.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2015 Google Inc. All rights reserved. +# Copyright 2023 Google LLC All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-apps-script-type/setup.py b/packages/google-apps-script-type/setup.py index d98177c270d5..d0172ffac85d 100644 --- a/packages/google-apps-script-type/setup.py +++ b/packages/google-apps-script-type/setup.py @@ -20,13 +20,15 @@ package_root = os.path.abspath(os.path.dirname(__file__)) -name = "google-apps-script-type" +name = "google-apps-script-type-slides" -description = "Google Apps Script Type API client library" +description = "Google Apps Script Type Slides API client library" version = {} -with open(os.path.join(package_root, "google/apps/script/type/gapic_version.py")) as fp: +with open( + os.path.join(package_root, "google/apps/script/type/slides/gapic_version.py") +) as fp: exec(fp.read(), version) version = version["__version__"] @@ -40,6 +42,7 @@ "proto-plus >= 1.22.0, <2.0.0dev", "proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'", "protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", + "google-apps-script-type >= 0.2.0, <1.0.0dev", ] url = "https://github.com/googleapis/google-cloud-python" @@ -55,7 +58,7 @@ if package.startswith("google") ] -namespaces = ["google", "google.apps", "google.apps.script"] +namespaces = ["google", "google.apps", "google.apps.script", "google.apps.script.type"] setuptools.setup( name=name, diff --git a/packages/google-apps-script-type/testing/constraints-3.7.txt b/packages/google-apps-script-type/testing/constraints-3.7.txt index 6c44adfea7ee..4ae34ff40304 100644 --- a/packages/google-apps-script-type/testing/constraints-3.7.txt +++ b/packages/google-apps-script-type/testing/constraints-3.7.txt @@ -7,3 +7,4 @@ google-api-core==1.34.0 proto-plus==1.22.0 protobuf==3.19.5 +google-apps-script-type==0.2.0 From a909ab713b49024264d6c55d78f6b8ca3b892201 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 26 Sep 2023 18:51:33 +0000 Subject: [PATCH 3/3] chore(python): Update build rules for google/apps/script/type chore(python): Update build rules for google/apps/script/type/calendar chore(python): Update build rules for google/apps/script/type/docs chore(python): Update build rules for google/apps/script/type/drive chore(python): Update build rules for google/apps/script/type/gmail chore(python): Update build rules for google/apps/script/type/sheets chore(python): Update build rules for google/apps/script/type/slides PiperOrigin-RevId: 568570701 Source-Link: https://github.com/googleapis/googleapis/commit/4899fc0b6235b2f0dc873e59fcc0b9a468cba2a1 Source-Link: https://github.com/googleapis/googleapis-gen/commit/7cdda38f7cae1ab2d12cf0cd542c6406c16f4499 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWFwcHMtc2NyaXB0LXR5cGUvLk93bEJvdC55YW1sIiwiaCI6IjdjZGRhMzhmN2NhZTFhYjJkMTJjZjBjZDU0MmM2NDA2YzE2ZjQ0OTkifQ== --- .../calendar/calendar-py/.coveragerc | 13 + .../calendar/calendar-py/.flake8 | 33 ++ .../calendar/calendar-py/MANIFEST.in | 2 + .../calendar/calendar-py/README.rst | 49 +++ .../calendar-py/docs/_static/custom.css | 3 + .../calendar-py/docs/calendar/services.rst | 4 + .../calendar-py/docs/calendar/types.rst | 6 + .../calendar/calendar-py/docs/conf.py | 376 ++++++++++++++++++ .../calendar/calendar-py/docs/index.rst | 7 + .../apps/script/type/calendar/__init__.py | 30 ++ .../script/type/calendar/gapic_metadata.json | 7 + .../script/type/calendar/gapic_version.py | 16 + .../google/apps/script/type/calendar/py.typed | 2 + .../script/type/calendar/services/__init__.py | 15 + .../script/type/calendar/types/__init__.py | 26 ++ .../calendar/types/calendar_addon_manifest.py | 184 +++++++++ .../calendar/calendar-py/mypy.ini | 3 + .../calendar/calendar-py/noxfile.py | 184 +++++++++ .../scripts/fixup_calendar_keywords.py | 175 ++++++++ .../calendar/calendar-py/setup.py | 91 +++++ .../calendar-py/testing/constraints-3.10.txt | 7 + .../calendar-py/testing/constraints-3.11.txt | 7 + .../calendar-py/testing/constraints-3.12.txt | 7 + .../calendar-py/testing/constraints-3.7.txt | 10 + .../calendar-py/testing/constraints-3.8.txt | 7 + .../calendar-py/testing/constraints-3.9.txt | 7 + .../calendar/calendar-py/tests/__init__.py | 16 + .../calendar-py/tests/unit/__init__.py | 16 + .../calendar-py/tests/unit/gapic/__init__.py | 16 + .../tests/unit/gapic/calendar/__init__.py | 16 + .../docs/docs-py/.coveragerc | 13 + .../docs/docs-py/.flake8 | 33 ++ .../docs/docs-py/MANIFEST.in | 2 + .../docs/docs-py/README.rst | 49 +++ .../docs/docs-py/docs/_static/custom.css | 3 + .../docs/docs-py/docs/conf.py | 376 ++++++++++++++++++ .../docs/docs-py/docs/docs/services.rst | 4 + .../docs/docs-py/docs/docs/types.rst | 6 + .../docs/docs-py/docs/index.rst | 7 + .../google/apps/script/type/docs/__init__.py | 28 ++ .../apps/script/type/docs/gapic_metadata.json | 7 + .../apps/script/type/docs/gapic_version.py | 16 + .../google/apps/script/type/docs/py.typed | 2 + .../script/type/docs/services/__init__.py | 15 + .../apps/script/type/docs/types/__init__.py | 24 ++ .../type/docs/types/docs_addon_manifest.py | 74 ++++ .../docs/docs-py/mypy.ini | 3 + .../docs/docs-py/noxfile.py | 184 +++++++++ .../docs-py/scripts/fixup_docs_keywords.py | 175 ++++++++ .../docs/docs-py/setup.py | 91 +++++ .../docs/docs-py/testing/constraints-3.10.txt | 7 + .../docs/docs-py/testing/constraints-3.11.txt | 7 + .../docs/docs-py/testing/constraints-3.12.txt | 7 + .../docs/docs-py/testing/constraints-3.7.txt | 10 + .../docs/docs-py/testing/constraints-3.8.txt | 7 + .../docs/docs-py/testing/constraints-3.9.txt | 7 + .../docs/docs-py/tests/__init__.py | 16 + .../docs/docs-py/tests/unit/__init__.py | 16 + .../docs/docs-py/tests/unit/gapic/__init__.py | 16 + .../docs-py/tests/unit/gapic/docs/__init__.py | 16 + .../drive/drive-py/.coveragerc | 13 + .../drive/drive-py/.flake8 | 33 ++ .../drive/drive-py/MANIFEST.in | 2 + .../drive/drive-py/README.rst | 49 +++ .../drive/drive-py/docs/_static/custom.css | 3 + .../drive/drive-py/docs/conf.py | 376 ++++++++++++++++++ .../drive/drive-py/docs/drive/services.rst | 4 + .../drive/drive-py/docs/drive/types.rst | 6 + .../drive/drive-py/docs/index.rst | 7 + .../google/apps/script/type/drive/__init__.py | 28 ++ .../script/type/drive/gapic_metadata.json | 7 + .../apps/script/type/drive/gapic_version.py | 16 + .../google/apps/script/type/drive/py.typed | 2 + .../script/type/drive/services/__init__.py | 15 + .../apps/script/type/drive/types/__init__.py | 24 ++ .../type/drive/types/drive_addon_manifest.py | 76 ++++ .../drive/drive-py/mypy.ini | 3 + .../drive/drive-py/noxfile.py | 184 +++++++++ .../drive-py/scripts/fixup_drive_keywords.py | 175 ++++++++ .../drive/drive-py/setup.py | 91 +++++ .../drive-py/testing/constraints-3.10.txt | 7 + .../drive-py/testing/constraints-3.11.txt | 7 + .../drive-py/testing/constraints-3.12.txt | 7 + .../drive-py/testing/constraints-3.7.txt | 10 + .../drive-py/testing/constraints-3.8.txt | 7 + .../drive-py/testing/constraints-3.9.txt | 7 + .../drive/drive-py/tests/__init__.py | 16 + .../drive/drive-py/tests/unit/__init__.py | 16 + .../drive-py/tests/unit/gapic/__init__.py | 16 + .../tests/unit/gapic/drive/__init__.py | 16 + .../gmail/gmail-py/.coveragerc | 13 + .../gmail/gmail-py/.flake8 | 33 ++ .../gmail/gmail-py/MANIFEST.in | 2 + .../gmail/gmail-py/README.rst | 49 +++ .../gmail/gmail-py/docs/_static/custom.css | 3 + .../gmail/gmail-py/docs/conf.py | 376 ++++++++++++++++++ .../gmail/gmail-py/docs/gmail/services.rst | 4 + .../gmail/gmail-py/docs/gmail/types.rst | 6 + .../gmail/gmail-py/docs/index.rst | 7 + .../google/apps/script/type/gmail/__init__.py | 34 ++ .../script/type/gmail/gapic_metadata.json | 7 + .../apps/script/type/gmail/gapic_version.py | 16 + .../google/apps/script/type/gmail/py.typed | 2 + .../script/type/gmail/services/__init__.py | 15 + .../apps/script/type/gmail/types/__init__.py | 30 ++ .../type/gmail/types/gmail_addon_manifest.py | 232 +++++++++++ .../gmail/gmail-py/mypy.ini | 3 + .../gmail/gmail-py/noxfile.py | 184 +++++++++ .../gmail-py/scripts/fixup_gmail_keywords.py | 175 ++++++++ .../gmail/gmail-py/setup.py | 91 +++++ .../gmail-py/testing/constraints-3.10.txt | 7 + .../gmail-py/testing/constraints-3.11.txt | 7 + .../gmail-py/testing/constraints-3.12.txt | 7 + .../gmail-py/testing/constraints-3.7.txt | 10 + .../gmail-py/testing/constraints-3.8.txt | 7 + .../gmail-py/testing/constraints-3.9.txt | 7 + .../gmail/gmail-py/tests/__init__.py | 16 + .../gmail/gmail-py/tests/unit/__init__.py | 16 + .../gmail-py/tests/unit/gapic/__init__.py | 16 + .../tests/unit/gapic/gmail/__init__.py | 16 + .../sheets/sheets-py/.coveragerc | 13 + .../sheets/sheets-py/.flake8 | 33 ++ .../sheets/sheets-py/MANIFEST.in | 2 + .../sheets/sheets-py/README.rst | 49 +++ .../sheets/sheets-py/docs/_static/custom.css | 3 + .../sheets/sheets-py/docs/conf.py | 376 ++++++++++++++++++ .../sheets/sheets-py/docs/index.rst | 7 + .../sheets/sheets-py/docs/sheets/services.rst | 4 + .../sheets/sheets-py/docs/sheets/types.rst | 6 + .../apps/script/type/sheets/__init__.py | 28 ++ .../script/type/sheets/gapic_metadata.json | 7 + .../apps/script/type/sheets/gapic_version.py | 16 + .../google/apps/script/type/sheets/py.typed | 2 + .../script/type/sheets/services/__init__.py | 15 + .../apps/script/type/sheets/types/__init__.py | 24 ++ .../sheets/types/sheets_addon_manifest.py | 74 ++++ .../sheets/sheets-py/mypy.ini | 3 + .../sheets/sheets-py/noxfile.py | 184 +++++++++ .../scripts/fixup_sheets_keywords.py | 175 ++++++++ .../sheets/sheets-py/setup.py | 91 +++++ .../sheets-py/testing/constraints-3.10.txt | 7 + .../sheets-py/testing/constraints-3.11.txt | 7 + .../sheets-py/testing/constraints-3.12.txt | 7 + .../sheets-py/testing/constraints-3.7.txt | 10 + .../sheets-py/testing/constraints-3.8.txt | 7 + .../sheets-py/testing/constraints-3.9.txt | 7 + .../sheets/sheets-py/tests/__init__.py | 16 + .../sheets/sheets-py/tests/unit/__init__.py | 16 + .../sheets-py/tests/unit/gapic/__init__.py | 16 + .../tests/unit/gapic/sheets/__init__.py | 16 + .../slides/slides-py/.coveragerc | 13 + .../slides/slides-py/.flake8 | 33 ++ .../slides/slides-py/MANIFEST.in | 2 + .../slides/slides-py/README.rst | 49 +++ .../slides/slides-py/docs/_static/custom.css | 3 + .../slides/slides-py/docs/conf.py | 376 ++++++++++++++++++ .../slides/slides-py/docs/index.rst | 7 + .../slides/slides-py/docs/slides/services.rst | 4 + .../slides/slides-py/docs/slides/types.rst | 6 + .../apps/script/type/slides/__init__.py | 28 ++ .../script/type/slides/gapic_metadata.json | 7 + .../apps/script/type/slides/gapic_version.py | 16 + .../google/apps/script/type/slides/py.typed | 2 + .../script/type/slides/services/__init__.py | 15 + .../apps/script/type/slides/types/__init__.py | 24 ++ .../slides/types/slides_addon_manifest.py | 74 ++++ .../slides/slides-py/mypy.ini | 3 + .../slides/slides-py/noxfile.py | 184 +++++++++ .../scripts/fixup_slides_keywords.py | 175 ++++++++ .../slides/slides-py/setup.py | 91 +++++ .../slides-py/testing/constraints-3.10.txt | 7 + .../slides-py/testing/constraints-3.11.txt | 7 + .../slides-py/testing/constraints-3.12.txt | 7 + .../slides-py/testing/constraints-3.7.txt | 10 + .../slides-py/testing/constraints-3.8.txt | 7 + .../slides-py/testing/constraints-3.9.txt | 7 + .../slides/slides-py/tests/__init__.py | 16 + .../slides/slides-py/tests/unit/__init__.py | 16 + .../slides-py/tests/unit/gapic/__init__.py | 16 + .../tests/unit/gapic/slides/__init__.py | 16 + .../type-py/.coveragerc | 13 + .../google-apps-script-type/type-py/.flake8 | 33 ++ .../type-py/MANIFEST.in | 2 + .../type-py/README.rst | 49 +++ .../type-py/docs/_static/custom.css | 3 + .../type-py/docs/conf.py | 376 ++++++++++++++++++ .../type-py/docs/index.rst | 7 + .../type-py/docs/type/services.rst | 4 + .../type-py/docs/type/types.rst | 6 + .../google/apps/script/type/__init__.py | 40 ++ .../apps/script/type/gapic_metadata.json | 7 + .../google/apps/script/type/gapic_version.py | 16 + .../type-py/google/apps/script/type/py.typed | 2 + .../apps/script/type/services/__init__.py | 15 + .../google/apps/script/type/types/__init__.py | 40 ++ .../script/type/types/addon_widget_set.py | 78 ++++ .../apps/script/type/types/extension_point.py | 139 +++++++ .../apps/script/type/types/script_manifest.py | 186 +++++++++ .../google-apps-script-type/type-py/mypy.ini | 3 + .../type-py/noxfile.py | 184 +++++++++ .../type-py/scripts/fixup_type_keywords.py | 175 ++++++++ .../google-apps-script-type/type-py/setup.py | 90 +++++ .../type-py/testing/constraints-3.10.txt | 6 + .../type-py/testing/constraints-3.11.txt | 6 + .../type-py/testing/constraints-3.12.txt | 6 + .../type-py/testing/constraints-3.7.txt | 9 + .../type-py/testing/constraints-3.8.txt | 6 + .../type-py/testing/constraints-3.9.txt | 6 + .../type-py/tests/__init__.py | 16 + .../type-py/tests/unit/__init__.py | 16 + .../type-py/tests/unit/gapic/__init__.py | 16 + .../type-py/tests/unit/gapic/type/__init__.py | 16 + 212 files changed, 9183 insertions(+) create mode 100644 owl-bot-staging/google-apps-script-type/calendar/calendar-py/.coveragerc create mode 100644 owl-bot-staging/google-apps-script-type/calendar/calendar-py/.flake8 create mode 100644 owl-bot-staging/google-apps-script-type/calendar/calendar-py/MANIFEST.in create mode 100644 owl-bot-staging/google-apps-script-type/calendar/calendar-py/README.rst create mode 100644 owl-bot-staging/google-apps-script-type/calendar/calendar-py/docs/_static/custom.css create mode 100644 owl-bot-staging/google-apps-script-type/calendar/calendar-py/docs/calendar/services.rst create mode 100644 owl-bot-staging/google-apps-script-type/calendar/calendar-py/docs/calendar/types.rst create mode 100644 owl-bot-staging/google-apps-script-type/calendar/calendar-py/docs/conf.py create mode 100644 owl-bot-staging/google-apps-script-type/calendar/calendar-py/docs/index.rst create mode 100644 owl-bot-staging/google-apps-script-type/calendar/calendar-py/google/apps/script/type/calendar/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/calendar/calendar-py/google/apps/script/type/calendar/gapic_metadata.json create mode 100644 owl-bot-staging/google-apps-script-type/calendar/calendar-py/google/apps/script/type/calendar/gapic_version.py create mode 100644 owl-bot-staging/google-apps-script-type/calendar/calendar-py/google/apps/script/type/calendar/py.typed create mode 100644 owl-bot-staging/google-apps-script-type/calendar/calendar-py/google/apps/script/type/calendar/services/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/calendar/calendar-py/google/apps/script/type/calendar/types/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/calendar/calendar-py/google/apps/script/type/calendar/types/calendar_addon_manifest.py create mode 100644 owl-bot-staging/google-apps-script-type/calendar/calendar-py/mypy.ini create mode 100644 owl-bot-staging/google-apps-script-type/calendar/calendar-py/noxfile.py create mode 100644 owl-bot-staging/google-apps-script-type/calendar/calendar-py/scripts/fixup_calendar_keywords.py create mode 100644 owl-bot-staging/google-apps-script-type/calendar/calendar-py/setup.py create mode 100644 owl-bot-staging/google-apps-script-type/calendar/calendar-py/testing/constraints-3.10.txt create mode 100644 owl-bot-staging/google-apps-script-type/calendar/calendar-py/testing/constraints-3.11.txt create mode 100644 owl-bot-staging/google-apps-script-type/calendar/calendar-py/testing/constraints-3.12.txt create mode 100644 owl-bot-staging/google-apps-script-type/calendar/calendar-py/testing/constraints-3.7.txt create mode 100644 owl-bot-staging/google-apps-script-type/calendar/calendar-py/testing/constraints-3.8.txt create mode 100644 owl-bot-staging/google-apps-script-type/calendar/calendar-py/testing/constraints-3.9.txt create mode 100644 owl-bot-staging/google-apps-script-type/calendar/calendar-py/tests/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/calendar/calendar-py/tests/unit/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/calendar/calendar-py/tests/unit/gapic/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/calendar/calendar-py/tests/unit/gapic/calendar/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/docs/docs-py/.coveragerc create mode 100644 owl-bot-staging/google-apps-script-type/docs/docs-py/.flake8 create mode 100644 owl-bot-staging/google-apps-script-type/docs/docs-py/MANIFEST.in create mode 100644 owl-bot-staging/google-apps-script-type/docs/docs-py/README.rst create mode 100644 owl-bot-staging/google-apps-script-type/docs/docs-py/docs/_static/custom.css create mode 100644 owl-bot-staging/google-apps-script-type/docs/docs-py/docs/conf.py create mode 100644 owl-bot-staging/google-apps-script-type/docs/docs-py/docs/docs/services.rst create mode 100644 owl-bot-staging/google-apps-script-type/docs/docs-py/docs/docs/types.rst create mode 100644 owl-bot-staging/google-apps-script-type/docs/docs-py/docs/index.rst create mode 100644 owl-bot-staging/google-apps-script-type/docs/docs-py/google/apps/script/type/docs/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/docs/docs-py/google/apps/script/type/docs/gapic_metadata.json create mode 100644 owl-bot-staging/google-apps-script-type/docs/docs-py/google/apps/script/type/docs/gapic_version.py create mode 100644 owl-bot-staging/google-apps-script-type/docs/docs-py/google/apps/script/type/docs/py.typed create mode 100644 owl-bot-staging/google-apps-script-type/docs/docs-py/google/apps/script/type/docs/services/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/docs/docs-py/google/apps/script/type/docs/types/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/docs/docs-py/google/apps/script/type/docs/types/docs_addon_manifest.py create mode 100644 owl-bot-staging/google-apps-script-type/docs/docs-py/mypy.ini create mode 100644 owl-bot-staging/google-apps-script-type/docs/docs-py/noxfile.py create mode 100644 owl-bot-staging/google-apps-script-type/docs/docs-py/scripts/fixup_docs_keywords.py create mode 100644 owl-bot-staging/google-apps-script-type/docs/docs-py/setup.py create mode 100644 owl-bot-staging/google-apps-script-type/docs/docs-py/testing/constraints-3.10.txt create mode 100644 owl-bot-staging/google-apps-script-type/docs/docs-py/testing/constraints-3.11.txt create mode 100644 owl-bot-staging/google-apps-script-type/docs/docs-py/testing/constraints-3.12.txt create mode 100644 owl-bot-staging/google-apps-script-type/docs/docs-py/testing/constraints-3.7.txt create mode 100644 owl-bot-staging/google-apps-script-type/docs/docs-py/testing/constraints-3.8.txt create mode 100644 owl-bot-staging/google-apps-script-type/docs/docs-py/testing/constraints-3.9.txt create mode 100644 owl-bot-staging/google-apps-script-type/docs/docs-py/tests/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/docs/docs-py/tests/unit/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/docs/docs-py/tests/unit/gapic/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/docs/docs-py/tests/unit/gapic/docs/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/drive/drive-py/.coveragerc create mode 100644 owl-bot-staging/google-apps-script-type/drive/drive-py/.flake8 create mode 100644 owl-bot-staging/google-apps-script-type/drive/drive-py/MANIFEST.in create mode 100644 owl-bot-staging/google-apps-script-type/drive/drive-py/README.rst create mode 100644 owl-bot-staging/google-apps-script-type/drive/drive-py/docs/_static/custom.css create mode 100644 owl-bot-staging/google-apps-script-type/drive/drive-py/docs/conf.py create mode 100644 owl-bot-staging/google-apps-script-type/drive/drive-py/docs/drive/services.rst create mode 100644 owl-bot-staging/google-apps-script-type/drive/drive-py/docs/drive/types.rst create mode 100644 owl-bot-staging/google-apps-script-type/drive/drive-py/docs/index.rst create mode 100644 owl-bot-staging/google-apps-script-type/drive/drive-py/google/apps/script/type/drive/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/drive/drive-py/google/apps/script/type/drive/gapic_metadata.json create mode 100644 owl-bot-staging/google-apps-script-type/drive/drive-py/google/apps/script/type/drive/gapic_version.py create mode 100644 owl-bot-staging/google-apps-script-type/drive/drive-py/google/apps/script/type/drive/py.typed create mode 100644 owl-bot-staging/google-apps-script-type/drive/drive-py/google/apps/script/type/drive/services/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/drive/drive-py/google/apps/script/type/drive/types/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/drive/drive-py/google/apps/script/type/drive/types/drive_addon_manifest.py create mode 100644 owl-bot-staging/google-apps-script-type/drive/drive-py/mypy.ini create mode 100644 owl-bot-staging/google-apps-script-type/drive/drive-py/noxfile.py create mode 100644 owl-bot-staging/google-apps-script-type/drive/drive-py/scripts/fixup_drive_keywords.py create mode 100644 owl-bot-staging/google-apps-script-type/drive/drive-py/setup.py create mode 100644 owl-bot-staging/google-apps-script-type/drive/drive-py/testing/constraints-3.10.txt create mode 100644 owl-bot-staging/google-apps-script-type/drive/drive-py/testing/constraints-3.11.txt create mode 100644 owl-bot-staging/google-apps-script-type/drive/drive-py/testing/constraints-3.12.txt create mode 100644 owl-bot-staging/google-apps-script-type/drive/drive-py/testing/constraints-3.7.txt create mode 100644 owl-bot-staging/google-apps-script-type/drive/drive-py/testing/constraints-3.8.txt create mode 100644 owl-bot-staging/google-apps-script-type/drive/drive-py/testing/constraints-3.9.txt create mode 100644 owl-bot-staging/google-apps-script-type/drive/drive-py/tests/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/drive/drive-py/tests/unit/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/drive/drive-py/tests/unit/gapic/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/drive/drive-py/tests/unit/gapic/drive/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/gmail/gmail-py/.coveragerc create mode 100644 owl-bot-staging/google-apps-script-type/gmail/gmail-py/.flake8 create mode 100644 owl-bot-staging/google-apps-script-type/gmail/gmail-py/MANIFEST.in create mode 100644 owl-bot-staging/google-apps-script-type/gmail/gmail-py/README.rst create mode 100644 owl-bot-staging/google-apps-script-type/gmail/gmail-py/docs/_static/custom.css create mode 100644 owl-bot-staging/google-apps-script-type/gmail/gmail-py/docs/conf.py create mode 100644 owl-bot-staging/google-apps-script-type/gmail/gmail-py/docs/gmail/services.rst create mode 100644 owl-bot-staging/google-apps-script-type/gmail/gmail-py/docs/gmail/types.rst create mode 100644 owl-bot-staging/google-apps-script-type/gmail/gmail-py/docs/index.rst create mode 100644 owl-bot-staging/google-apps-script-type/gmail/gmail-py/google/apps/script/type/gmail/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/gmail/gmail-py/google/apps/script/type/gmail/gapic_metadata.json create mode 100644 owl-bot-staging/google-apps-script-type/gmail/gmail-py/google/apps/script/type/gmail/gapic_version.py create mode 100644 owl-bot-staging/google-apps-script-type/gmail/gmail-py/google/apps/script/type/gmail/py.typed create mode 100644 owl-bot-staging/google-apps-script-type/gmail/gmail-py/google/apps/script/type/gmail/services/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/gmail/gmail-py/google/apps/script/type/gmail/types/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/gmail/gmail-py/google/apps/script/type/gmail/types/gmail_addon_manifest.py create mode 100644 owl-bot-staging/google-apps-script-type/gmail/gmail-py/mypy.ini create mode 100644 owl-bot-staging/google-apps-script-type/gmail/gmail-py/noxfile.py create mode 100644 owl-bot-staging/google-apps-script-type/gmail/gmail-py/scripts/fixup_gmail_keywords.py create mode 100644 owl-bot-staging/google-apps-script-type/gmail/gmail-py/setup.py create mode 100644 owl-bot-staging/google-apps-script-type/gmail/gmail-py/testing/constraints-3.10.txt create mode 100644 owl-bot-staging/google-apps-script-type/gmail/gmail-py/testing/constraints-3.11.txt create mode 100644 owl-bot-staging/google-apps-script-type/gmail/gmail-py/testing/constraints-3.12.txt create mode 100644 owl-bot-staging/google-apps-script-type/gmail/gmail-py/testing/constraints-3.7.txt create mode 100644 owl-bot-staging/google-apps-script-type/gmail/gmail-py/testing/constraints-3.8.txt create mode 100644 owl-bot-staging/google-apps-script-type/gmail/gmail-py/testing/constraints-3.9.txt create mode 100644 owl-bot-staging/google-apps-script-type/gmail/gmail-py/tests/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/gmail/gmail-py/tests/unit/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/gmail/gmail-py/tests/unit/gapic/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/gmail/gmail-py/tests/unit/gapic/gmail/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/sheets/sheets-py/.coveragerc create mode 100644 owl-bot-staging/google-apps-script-type/sheets/sheets-py/.flake8 create mode 100644 owl-bot-staging/google-apps-script-type/sheets/sheets-py/MANIFEST.in create mode 100644 owl-bot-staging/google-apps-script-type/sheets/sheets-py/README.rst create mode 100644 owl-bot-staging/google-apps-script-type/sheets/sheets-py/docs/_static/custom.css create mode 100644 owl-bot-staging/google-apps-script-type/sheets/sheets-py/docs/conf.py create mode 100644 owl-bot-staging/google-apps-script-type/sheets/sheets-py/docs/index.rst create mode 100644 owl-bot-staging/google-apps-script-type/sheets/sheets-py/docs/sheets/services.rst create mode 100644 owl-bot-staging/google-apps-script-type/sheets/sheets-py/docs/sheets/types.rst create mode 100644 owl-bot-staging/google-apps-script-type/sheets/sheets-py/google/apps/script/type/sheets/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/sheets/sheets-py/google/apps/script/type/sheets/gapic_metadata.json create mode 100644 owl-bot-staging/google-apps-script-type/sheets/sheets-py/google/apps/script/type/sheets/gapic_version.py create mode 100644 owl-bot-staging/google-apps-script-type/sheets/sheets-py/google/apps/script/type/sheets/py.typed create mode 100644 owl-bot-staging/google-apps-script-type/sheets/sheets-py/google/apps/script/type/sheets/services/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/sheets/sheets-py/google/apps/script/type/sheets/types/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/sheets/sheets-py/google/apps/script/type/sheets/types/sheets_addon_manifest.py create mode 100644 owl-bot-staging/google-apps-script-type/sheets/sheets-py/mypy.ini create mode 100644 owl-bot-staging/google-apps-script-type/sheets/sheets-py/noxfile.py create mode 100644 owl-bot-staging/google-apps-script-type/sheets/sheets-py/scripts/fixup_sheets_keywords.py create mode 100644 owl-bot-staging/google-apps-script-type/sheets/sheets-py/setup.py create mode 100644 owl-bot-staging/google-apps-script-type/sheets/sheets-py/testing/constraints-3.10.txt create mode 100644 owl-bot-staging/google-apps-script-type/sheets/sheets-py/testing/constraints-3.11.txt create mode 100644 owl-bot-staging/google-apps-script-type/sheets/sheets-py/testing/constraints-3.12.txt create mode 100644 owl-bot-staging/google-apps-script-type/sheets/sheets-py/testing/constraints-3.7.txt create mode 100644 owl-bot-staging/google-apps-script-type/sheets/sheets-py/testing/constraints-3.8.txt create mode 100644 owl-bot-staging/google-apps-script-type/sheets/sheets-py/testing/constraints-3.9.txt create mode 100644 owl-bot-staging/google-apps-script-type/sheets/sheets-py/tests/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/sheets/sheets-py/tests/unit/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/sheets/sheets-py/tests/unit/gapic/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/sheets/sheets-py/tests/unit/gapic/sheets/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/slides/slides-py/.coveragerc create mode 100644 owl-bot-staging/google-apps-script-type/slides/slides-py/.flake8 create mode 100644 owl-bot-staging/google-apps-script-type/slides/slides-py/MANIFEST.in create mode 100644 owl-bot-staging/google-apps-script-type/slides/slides-py/README.rst create mode 100644 owl-bot-staging/google-apps-script-type/slides/slides-py/docs/_static/custom.css create mode 100644 owl-bot-staging/google-apps-script-type/slides/slides-py/docs/conf.py create mode 100644 owl-bot-staging/google-apps-script-type/slides/slides-py/docs/index.rst create mode 100644 owl-bot-staging/google-apps-script-type/slides/slides-py/docs/slides/services.rst create mode 100644 owl-bot-staging/google-apps-script-type/slides/slides-py/docs/slides/types.rst create mode 100644 owl-bot-staging/google-apps-script-type/slides/slides-py/google/apps/script/type/slides/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/slides/slides-py/google/apps/script/type/slides/gapic_metadata.json create mode 100644 owl-bot-staging/google-apps-script-type/slides/slides-py/google/apps/script/type/slides/gapic_version.py create mode 100644 owl-bot-staging/google-apps-script-type/slides/slides-py/google/apps/script/type/slides/py.typed create mode 100644 owl-bot-staging/google-apps-script-type/slides/slides-py/google/apps/script/type/slides/services/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/slides/slides-py/google/apps/script/type/slides/types/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/slides/slides-py/google/apps/script/type/slides/types/slides_addon_manifest.py create mode 100644 owl-bot-staging/google-apps-script-type/slides/slides-py/mypy.ini create mode 100644 owl-bot-staging/google-apps-script-type/slides/slides-py/noxfile.py create mode 100644 owl-bot-staging/google-apps-script-type/slides/slides-py/scripts/fixup_slides_keywords.py create mode 100644 owl-bot-staging/google-apps-script-type/slides/slides-py/setup.py create mode 100644 owl-bot-staging/google-apps-script-type/slides/slides-py/testing/constraints-3.10.txt create mode 100644 owl-bot-staging/google-apps-script-type/slides/slides-py/testing/constraints-3.11.txt create mode 100644 owl-bot-staging/google-apps-script-type/slides/slides-py/testing/constraints-3.12.txt create mode 100644 owl-bot-staging/google-apps-script-type/slides/slides-py/testing/constraints-3.7.txt create mode 100644 owl-bot-staging/google-apps-script-type/slides/slides-py/testing/constraints-3.8.txt create mode 100644 owl-bot-staging/google-apps-script-type/slides/slides-py/testing/constraints-3.9.txt create mode 100644 owl-bot-staging/google-apps-script-type/slides/slides-py/tests/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/slides/slides-py/tests/unit/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/slides/slides-py/tests/unit/gapic/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/slides/slides-py/tests/unit/gapic/slides/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/.coveragerc create mode 100644 owl-bot-staging/google-apps-script-type/type-py/.flake8 create mode 100644 owl-bot-staging/google-apps-script-type/type-py/MANIFEST.in create mode 100644 owl-bot-staging/google-apps-script-type/type-py/README.rst create mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/_static/custom.css create mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/conf.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/index.rst create mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/type/services.rst create mode 100644 owl-bot-staging/google-apps-script-type/type-py/docs/type/types.rst create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_metadata.json create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_version.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/py.typed create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/services/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/addon_widget_set.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/extension_point.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/script_manifest.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/mypy.ini create mode 100644 owl-bot-staging/google-apps-script-type/type-py/noxfile.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_type_keywords.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/setup.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.10.txt create mode 100644 owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.11.txt create mode 100644 owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.12.txt create mode 100644 owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.7.txt create mode 100644 owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.8.txt create mode 100644 owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.9.txt create mode 100644 owl-bot-staging/google-apps-script-type/type-py/tests/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/tests/unit/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/__init__.py create mode 100644 owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/type/__init__.py diff --git a/owl-bot-staging/google-apps-script-type/calendar/calendar-py/.coveragerc b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/.coveragerc new file mode 100644 index 000000000000..d4b802b28cd6 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/.coveragerc @@ -0,0 +1,13 @@ +[run] +branch = True + +[report] +show_missing = True +omit = + google/apps/script/type/calendar/__init__.py + google/apps/script/type/calendar/gapic_version.py +exclude_lines = + # Re-enable the standard pragma + pragma: NO COVER + # Ignore debug-only repr + def __repr__ diff --git a/owl-bot-staging/google-apps-script-type/calendar/calendar-py/.flake8 b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/.flake8 new file mode 100644 index 000000000000..29227d4cf419 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/.flake8 @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Generated by synthtool. DO NOT EDIT! +[flake8] +ignore = E203, E266, E501, W503 +exclude = + # Exclude generated code. + **/proto/** + **/gapic/** + **/services/** + **/types/** + *_pb2.py + + # Standard linting exemptions. + **/.nox/** + __pycache__, + .git, + *.pyc, + conf.py diff --git a/owl-bot-staging/google-apps-script-type/calendar/calendar-py/MANIFEST.in b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/MANIFEST.in new file mode 100644 index 000000000000..cf01681dbb35 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/MANIFEST.in @@ -0,0 +1,2 @@ +recursive-include google/apps/script/type/calendar *.py +recursive-include google/apps/script/type/calendar *.py diff --git a/owl-bot-staging/google-apps-script-type/calendar/calendar-py/README.rst b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/README.rst new file mode 100644 index 000000000000..199f54ef3956 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/README.rst @@ -0,0 +1,49 @@ +Python Client for Google Apps Script Type Calendar API +================================================= + +Quick Start +----------- + +In order to use this library, you first need to go through the following steps: + +1. `Select or create a Cloud Platform project.`_ +2. `Enable billing for your project.`_ +3. Enable the Google Apps Script Type Calendar API. +4. `Setup Authentication.`_ + +.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project +.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project +.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html + +Installation +~~~~~~~~~~~~ + +Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to +create isolated Python environments. The basic problem it addresses is one of +dependencies and versions, and indirectly permissions. + +With `virtualenv`_, it's possible to install this library without needing system +install permissions, and without clashing with the installed system +dependencies. + +.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ + + +Mac/Linux +^^^^^^^^^ + +.. code-block:: console + + python3 -m venv + source /bin/activate + /bin/pip install /path/to/library + + +Windows +^^^^^^^ + +.. code-block:: console + + python3 -m venv + \Scripts\activate + \Scripts\pip.exe install \path\to\library diff --git a/owl-bot-staging/google-apps-script-type/calendar/calendar-py/docs/_static/custom.css b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/docs/_static/custom.css new file mode 100644 index 000000000000..06423be0b592 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/docs/_static/custom.css @@ -0,0 +1,3 @@ +dl.field-list > dt { + min-width: 100px +} diff --git a/owl-bot-staging/google-apps-script-type/calendar/calendar-py/docs/calendar/services.rst b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/docs/calendar/services.rst new file mode 100644 index 000000000000..3f8cdc1e081a --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/docs/calendar/services.rst @@ -0,0 +1,4 @@ +Services for Google Apps Script Type Calendar API +================================================== +.. toctree:: + :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/calendar/calendar-py/docs/calendar/types.rst b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/docs/calendar/types.rst new file mode 100644 index 000000000000..5d78802c53ab --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/docs/calendar/types.rst @@ -0,0 +1,6 @@ +Types for Google Apps Script Type Calendar API +=============================================== + +.. automodule:: google.apps.script.type.calendar.types + :members: + :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/calendar/calendar-py/docs/conf.py b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/docs/conf.py new file mode 100644 index 000000000000..796ad47ecc75 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/docs/conf.py @@ -0,0 +1,376 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# google-apps-script-type-calendar documentation build configuration file +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys +import os +import shlex + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +sys.path.insert(0, os.path.abspath("..")) + +__version__ = "0.1.0" + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +needs_sphinx = "4.0.1" + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.intersphinx", + "sphinx.ext.coverage", + "sphinx.ext.napoleon", + "sphinx.ext.todo", + "sphinx.ext.viewcode", +] + +# autodoc/autosummary flags +autoclass_content = "both" +autodoc_default_flags = ["members"] +autosummary_generate = True + + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# Allow markdown includes (so releases.md can include CHANGLEOG.md) +# http://www.sphinx-doc.org/en/master/markdown.html +source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +source_suffix = [".rst", ".md"] + +# The encoding of source files. +# source_encoding = 'utf-8-sig' + +# The root toctree document. +root_doc = "index" + +# General information about the project. +project = u"google-apps-script-type-calendar" +copyright = u"2023, Google, LLC" +author = u"Google APIs" # TODO: autogenerate this bit + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The full version, including alpha/beta/rc tags. +release = __version__ +# The short X.Y version. +version = ".".join(release.split(".")[0:2]) + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = 'en' + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +# today = '' +# Else, today_fmt is used as the format for a strftime call. +# today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ["_build"] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +# default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +# add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +# add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +# show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = "sphinx" + +# A list of ignored prefixes for module index sorting. +# modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +# keep_warnings = False + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = True + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = "alabaster" + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +html_theme_options = { + "description": "Google Apps Script Type Client Libraries for Python", + "github_user": "googleapis", + "github_repo": "google-cloud-python", + "github_banner": True, + "font_family": "'Roboto', Georgia, sans", + "head_font_family": "'Roboto', Georgia, serif", + "code_font_family": "'Roboto Mono', 'Consolas', monospace", +} + +# Add any paths that contain custom themes here, relative to this directory. +# html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +# html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +# html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +# html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +# html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ["_static"] + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +# html_extra_path = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +# html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +# html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +# html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +# html_additional_pages = {} + +# If false, no module index is generated. +# html_domain_indices = True + +# If false, no index is generated. +# html_use_index = True + +# If true, the index is split into individual pages for each letter. +# html_split_index = False + +# If true, links to the reST sources are added to the pages. +# html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +# html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +# html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +# html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +# html_file_suffix = None + +# Language to be used for generating the HTML full-text search index. +# Sphinx supports the following languages: +# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' +# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' +# html_search_language = 'en' + +# A dictionary with options for the search language support, empty by default. +# Now only 'ja' uses this config value +# html_search_options = {'type': 'default'} + +# The name of a javascript file (relative to the configuration directory) that +# implements a search results scorer. If empty, the default will be used. +# html_search_scorer = 'scorer.js' + +# Output file base name for HTML help builder. +htmlhelp_basename = "google-apps-script-type-calendar-doc" + +# -- Options for warnings ------------------------------------------------------ + + +suppress_warnings = [ + # Temporarily suppress this to avoid "more than one target found for + # cross-reference" warning, which are intractable for us to avoid while in + # a mono-repo. + # See https://github.com/sphinx-doc/sphinx/blob + # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 + "ref.python" +] + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # 'papersize': 'letterpaper', + # The font size ('10pt', '11pt' or '12pt'). + # 'pointsize': '10pt', + # Additional stuff for the LaTeX preamble. + # 'preamble': '', + # Latex figure (float) alignment + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + ( + root_doc, + "google-apps-script-type-calendar.tex", + u"google-apps-script-type-calendar Documentation", + author, + "manual", + ) +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +# latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +# latex_use_parts = False + +# If true, show page references after internal links. +# latex_show_pagerefs = False + +# If true, show URL addresses after external links. +# latex_show_urls = False + +# Documents to append as an appendix to all manuals. +# latex_appendices = [] + +# If false, no module index is generated. +# latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ( + root_doc, + "google-apps-script-type-calendar", + u"Google Apps Script Type Calendar Documentation", + [author], + 1, + ) +] + +# If true, show URL addresses after external links. +# man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ( + root_doc, + "google-apps-script-type-calendar", + u"google-apps-script-type-calendar Documentation", + author, + "google-apps-script-type-calendar", + "GAPIC library for Google Apps Script Type Calendar API", + "APIs", + ) +] + +# Documents to append as an appendix to all manuals. +# texinfo_appendices = [] + +# If false, no module index is generated. +# texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +# texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +# texinfo_no_detailmenu = False + + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = { + "python": ("http://python.readthedocs.org/en/latest/", None), + "gax": ("https://gax-python.readthedocs.org/en/latest/", None), + "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), + "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), + "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None), + "grpc": ("https://grpc.io/grpc/python/", None), + "requests": ("http://requests.kennethreitz.org/en/stable/", None), + "proto": ("https://proto-plus-python.readthedocs.io/en/stable", None), + "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), +} + + +# Napoleon settings +napoleon_google_docstring = True +napoleon_numpy_docstring = True +napoleon_include_private_with_doc = False +napoleon_include_special_with_doc = True +napoleon_use_admonition_for_examples = False +napoleon_use_admonition_for_notes = False +napoleon_use_admonition_for_references = False +napoleon_use_ivar = False +napoleon_use_param = True +napoleon_use_rtype = True diff --git a/owl-bot-staging/google-apps-script-type/calendar/calendar-py/docs/index.rst b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/docs/index.rst new file mode 100644 index 000000000000..53768b561f81 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/docs/index.rst @@ -0,0 +1,7 @@ +API Reference +------------- +.. toctree:: + :maxdepth: 2 + + calendar/services + calendar/types diff --git a/owl-bot-staging/google-apps-script-type/calendar/calendar-py/google/apps/script/type/calendar/__init__.py b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/google/apps/script/type/calendar/__init__.py new file mode 100644 index 000000000000..0a55085d9603 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/google/apps/script/type/calendar/__init__.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from google.apps.script.type.calendar import gapic_version as package_version + +__version__ = package_version.__version__ + + + +from .types.calendar_addon_manifest import CalendarAddOnManifest +from .types.calendar_addon_manifest import CalendarExtensionPoint +from .types.calendar_addon_manifest import ConferenceSolution + +__all__ = ( +'CalendarAddOnManifest', +'CalendarExtensionPoint', +'ConferenceSolution', +) diff --git a/owl-bot-staging/google-apps-script-type/calendar/calendar-py/google/apps/script/type/calendar/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/google/apps/script/type/calendar/gapic_metadata.json new file mode 100644 index 000000000000..c2cc763ffc99 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/google/apps/script/type/calendar/gapic_metadata.json @@ -0,0 +1,7 @@ + { + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "python", + "libraryPackage": "google.apps.script.type.calendar", + "protoPackage": "google.apps.script.type.calendar", + "schema": "1.0" +} diff --git a/owl-bot-staging/google-apps-script-type/calendar/calendar-py/google/apps/script/type/calendar/gapic_version.py b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/google/apps/script/type/calendar/gapic_version.py new file mode 100644 index 000000000000..360a0d13ebdd --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/google/apps/script/type/calendar/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/calendar/calendar-py/google/apps/script/type/calendar/py.typed b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/google/apps/script/type/calendar/py.typed new file mode 100644 index 000000000000..c8179d505670 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/google/apps/script/type/calendar/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-apps-script-type-calendar package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/calendar/calendar-py/google/apps/script/type/calendar/services/__init__.py b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/google/apps/script/type/calendar/services/__init__.py new file mode 100644 index 000000000000..89a37dc92c5a --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/google/apps/script/type/calendar/services/__init__.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/calendar/calendar-py/google/apps/script/type/calendar/types/__init__.py b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/google/apps/script/type/calendar/types/__init__.py new file mode 100644 index 000000000000..a1c8bfcb36ab --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/google/apps/script/type/calendar/types/__init__.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from .calendar_addon_manifest import ( + CalendarAddOnManifest, + CalendarExtensionPoint, + ConferenceSolution, +) + +__all__ = ( + 'CalendarAddOnManifest', + 'CalendarExtensionPoint', + 'ConferenceSolution', +) diff --git a/owl-bot-staging/google-apps-script-type/calendar/calendar-py/google/apps/script/type/calendar/types/calendar_addon_manifest.py b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/google/apps/script/type/calendar/types/calendar_addon_manifest.py new file mode 100644 index 000000000000..c3e457798e5b --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/google/apps/script/type/calendar/types/calendar_addon_manifest.py @@ -0,0 +1,184 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.apps.script.type.types import extension_point + + +__protobuf__ = proto.module( + package='google.apps.script.type.calendar', + manifest={ + 'CalendarAddOnManifest', + 'ConferenceSolution', + 'CalendarExtensionPoint', + }, +) + + +class CalendarAddOnManifest(proto.Message): + r"""Calendar add-on manifest. + + Attributes: + homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): + Defines an endpoint that will be executed contexts that + don't match a declared contextual trigger. Any cards + generated by this function will always be available to the + user, but may be eclipsed by contextual content when this + add-on declares more targeted triggers. + + If present, this overrides the configuration from + ``addOns.common.homepageTrigger``. + conference_solution (MutableSequence[google.apps.script.type.calendar.types.ConferenceSolution]): + Defines conference solutions provided by this + add-on. + create_settings_url_function (str): + An endpoint to execute that creates a URL to + the add-on's settings page. + event_open_trigger (google.apps.script.type.calendar.types.CalendarExtensionPoint): + An endpoint to trigger when an event is + opened (viewed/edited). + event_update_trigger (google.apps.script.type.calendar.types.CalendarExtensionPoint): + An endpoint to trigger when the open event is + updated. + current_event_access (google.apps.script.type.calendar.types.CalendarAddOnManifest.EventAccess): + Define the level of data access when an event + addon is triggered. + """ + class EventAccess(proto.Enum): + r"""An enum defining the level of data access event triggers + require. + + Values: + UNSPECIFIED (0): + Default value when nothing is set for + EventAccess. + METADATA (1): + METADATA gives event triggers the permission + to access the metadata of events such as event + id and calendar id. + READ (3): + READ gives event triggers access to all + provided event fields including the metadata, + attendees, and conference data. + WRITE (4): + WRITE gives event triggers access to the + metadata of events and the ability to perform + all actions, including adding attendees and + setting conference data. + READ_WRITE (5): + READ_WRITE gives event triggers access to all provided event + fields including the metadata, attendees, and conference + data and the ability to perform all actions. + """ + UNSPECIFIED = 0 + METADATA = 1 + READ = 3 + WRITE = 4 + READ_WRITE = 5 + + homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( + proto.MESSAGE, + number=6, + message=extension_point.HomepageExtensionPoint, + ) + conference_solution: MutableSequence['ConferenceSolution'] = proto.RepeatedField( + proto.MESSAGE, + number=3, + message='ConferenceSolution', + ) + create_settings_url_function: str = proto.Field( + proto.STRING, + number=5, + ) + event_open_trigger: 'CalendarExtensionPoint' = proto.Field( + proto.MESSAGE, + number=10, + message='CalendarExtensionPoint', + ) + event_update_trigger: 'CalendarExtensionPoint' = proto.Field( + proto.MESSAGE, + number=11, + message='CalendarExtensionPoint', + ) + current_event_access: EventAccess = proto.Field( + proto.ENUM, + number=12, + enum=EventAccess, + ) + + +class ConferenceSolution(proto.Message): + r"""Defines conference related values. + + Attributes: + on_create_function (str): + Required. The endpoint to call when + ConferenceData should be created. + id (str): + Required. IDs should be unique across + ConferenceSolutions within one add-on, but this + is not strictly enforced. It is up to the add-on + developer to assign them uniquely, otherwise the + wrong ConferenceSolution may be used when the + add-on is triggered. While the developer may + change the display name of an add-on, the ID + should not be changed. + name (str): + Required. The display name of the + ConferenceSolution. + logo_url (str): + Required. The URL for the logo image of the + ConferenceSolution. + """ + + on_create_function: str = proto.Field( + proto.STRING, + number=1, + ) + id: str = proto.Field( + proto.STRING, + number=4, + ) + name: str = proto.Field( + proto.STRING, + number=5, + ) + logo_url: str = proto.Field( + proto.STRING, + number=6, + ) + + +class CalendarExtensionPoint(proto.Message): + r"""Common format for declaring a calendar add-on's triggers. + + Attributes: + run_function (str): + Required. The endpoint to execute when this + extension point is activated. + """ + + run_function: str = proto.Field( + proto.STRING, + number=1, + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/calendar/calendar-py/mypy.ini b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/mypy.ini new file mode 100644 index 000000000000..574c5aed394b --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/mypy.ini @@ -0,0 +1,3 @@ +[mypy] +python_version = 3.7 +namespace_packages = True diff --git a/owl-bot-staging/google-apps-script-type/calendar/calendar-py/noxfile.py b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/noxfile.py new file mode 100644 index 000000000000..4c3e81e8ffe0 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/noxfile.py @@ -0,0 +1,184 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import os +import pathlib +import shutil +import subprocess +import sys + + +import nox # type: ignore + +ALL_PYTHON = [ + "3.7", + "3.8", + "3.9", + "3.10", + "3.11", +] + +CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() + +LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt" +PACKAGE_NAME = subprocess.check_output([sys.executable, "setup.py", "--name"], encoding="utf-8") + +BLACK_VERSION = "black==22.3.0" +BLACK_PATHS = ["docs", "google", "tests", "samples", "noxfile.py", "setup.py"] +DEFAULT_PYTHON_VERSION = "3.11" + +nox.sessions = [ + "unit", + "cover", + "mypy", + "check_lower_bounds" + # exclude update_lower_bounds from default + "docs", + "blacken", + "lint", + "lint_setup_py", +] + +@nox.session(python=ALL_PYTHON) +def unit(session): + """Run the unit test suite.""" + + session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') + session.install('-e', '.') + + session.run( + 'py.test', + '--quiet', + '--cov=google/apps/script/type/calendar/', + '--cov=tests/', + '--cov-config=.coveragerc', + '--cov-report=term', + '--cov-report=html', + os.path.join('tests', 'unit', ''.join(session.posargs)) + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def cover(session): + """Run the final coverage report. + This outputs the coverage report aggregating coverage from the unit + test runs (not system test runs), and then erases coverage data. + """ + session.install("coverage", "pytest-cov") + session.run("coverage", "report", "--show-missing", "--fail-under=100") + + session.run("coverage", "erase") + + +@nox.session(python=ALL_PYTHON) +def mypy(session): + """Run the type checker.""" + session.install( + 'mypy', + 'types-requests', + 'types-protobuf' + ) + session.install('.') + session.run( + 'mypy', + '--explicit-package-bases', + 'google', + ) + + +@nox.session +def update_lower_bounds(session): + """Update lower bounds in constraints.txt to match setup.py""" + session.install('google-cloud-testutils') + session.install('.') + + session.run( + 'lower-bound-checker', + 'update', + '--package-name', + PACKAGE_NAME, + '--constraints-file', + str(LOWER_BOUND_CONSTRAINTS_FILE), + ) + + +@nox.session +def check_lower_bounds(session): + """Check lower bounds in setup.py are reflected in constraints file""" + session.install('google-cloud-testutils') + session.install('.') + + session.run( + 'lower-bound-checker', + 'check', + '--package-name', + PACKAGE_NAME, + '--constraints-file', + str(LOWER_BOUND_CONSTRAINTS_FILE), + ) + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def docs(session): + """Build the docs for this library.""" + + session.install("-e", ".") + session.install("sphinx==7.0.1", "alabaster", "recommonmark") + + shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) + session.run( + "sphinx-build", + "-W", # warnings as errors + "-T", # show full traceback on exception + "-N", # no colors + "-b", + "html", + "-d", + os.path.join("docs", "_build", "doctrees", ""), + os.path.join("docs", ""), + os.path.join("docs", "_build", "html", ""), + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def lint(session): + """Run linters. + + Returns a failure if the linters find linting errors or sufficiently + serious code quality issues. + """ + session.install("flake8", BLACK_VERSION) + session.run( + "black", + "--check", + *BLACK_PATHS, + ) + session.run("flake8", "google", "tests", "samples") + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def blacken(session): + """Run black. Format code to uniform standard.""" + session.install(BLACK_VERSION) + session.run( + "black", + *BLACK_PATHS, + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def lint_setup_py(session): + """Verify that setup.py is valid (including RST check).""" + session.install("docutils", "pygments") + session.run("python", "setup.py", "check", "--restructuredtext", "--strict") diff --git a/owl-bot-staging/google-apps-script-type/calendar/calendar-py/scripts/fixup_calendar_keywords.py b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/scripts/fixup_calendar_keywords.py new file mode 100644 index 000000000000..1ed0cfa7a38b --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/scripts/fixup_calendar_keywords.py @@ -0,0 +1,175 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import argparse +import os +import libcst as cst +import pathlib +import sys +from typing import (Any, Callable, Dict, List, Sequence, Tuple) + + +def partition( + predicate: Callable[[Any], bool], + iterator: Sequence[Any] +) -> Tuple[List[Any], List[Any]]: + """A stable, out-of-place partition.""" + results = ([], []) + + for i in iterator: + results[int(predicate(i))].append(i) + + # Returns trueList, falseList + return results[1], results[0] + + +class calendarCallTransformer(cst.CSTTransformer): + CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') + METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { + } + + def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: + try: + key = original.func.attr.value + kword_params = self.METHOD_TO_PARAMS[key] + except (AttributeError, KeyError): + # Either not a method from the API or too convoluted to be sure. + return updated + + # If the existing code is valid, keyword args come after positional args. + # Therefore, all positional args must map to the first parameters. + args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) + if any(k.keyword.value == "request" for k in kwargs): + # We've already fixed this file, don't fix it again. + return updated + + kwargs, ctrl_kwargs = partition( + lambda a: a.keyword.value not in self.CTRL_PARAMS, + kwargs + ) + + args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] + ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) + for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) + + request_arg = cst.Arg( + value=cst.Dict([ + cst.DictElement( + cst.SimpleString("'{}'".format(name)), +cst.Element(value=arg.value) + ) + # Note: the args + kwargs looks silly, but keep in mind that + # the control parameters had to be stripped out, and that + # those could have been passed positionally or by keyword. + for name, arg in zip(kword_params, args + kwargs)]), + keyword=cst.Name("request") + ) + + return updated.with_changes( + args=[request_arg] + ctrl_kwargs + ) + + +def fix_files( + in_dir: pathlib.Path, + out_dir: pathlib.Path, + *, + transformer=calendarCallTransformer(), +): + """Duplicate the input dir to the output dir, fixing file method calls. + + Preconditions: + * in_dir is a real directory + * out_dir is a real, empty directory + """ + pyfile_gen = ( + pathlib.Path(os.path.join(root, f)) + for root, _, files in os.walk(in_dir) + for f in files if os.path.splitext(f)[1] == ".py" + ) + + for fpath in pyfile_gen: + with open(fpath, 'r') as f: + src = f.read() + + # Parse the code and insert method call fixes. + tree = cst.parse_module(src) + updated = tree.visit(transformer) + + # Create the path and directory structure for the new file. + updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) + updated_path.parent.mkdir(parents=True, exist_ok=True) + + # Generate the updated source file at the corresponding path. + with open(updated_path, 'w') as f: + f.write(updated.code) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser( + description="""Fix up source that uses the calendar client library. + +The existing sources are NOT overwritten but are copied to output_dir with changes made. + +Note: This tool operates at a best-effort level at converting positional + parameters in client method calls to keyword based parameters. + Cases where it WILL FAIL include + A) * or ** expansion in a method call. + B) Calls via function or method alias (includes free function calls) + C) Indirect or dispatched calls (e.g. the method is looked up dynamically) + + These all constitute false negatives. The tool will also detect false + positives when an API method shares a name with another method. +""") + parser.add_argument( + '-d', + '--input-directory', + required=True, + dest='input_dir', + help='the input directory to walk for python files to fix up', + ) + parser.add_argument( + '-o', + '--output-directory', + required=True, + dest='output_dir', + help='the directory to output files fixed via un-flattening', + ) + args = parser.parse_args() + input_dir = pathlib.Path(args.input_dir) + output_dir = pathlib.Path(args.output_dir) + if not input_dir.is_dir(): + print( + f"input directory '{input_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if not output_dir.is_dir(): + print( + f"output directory '{output_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if os.listdir(output_dir): + print( + f"output directory '{output_dir}' is not empty", + file=sys.stderr, + ) + sys.exit(-1) + + fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/calendar/calendar-py/setup.py b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/setup.py new file mode 100644 index 000000000000..46c005db216b --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/setup.py @@ -0,0 +1,91 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import io +import os + +import setuptools # type: ignore + +package_root = os.path.abspath(os.path.dirname(__file__)) + +name = 'google-apps-script-type-calendar' + + +description = "Google Apps Script Type Calendar API client library" + +version = {} +with open(os.path.join(package_root, 'google/apps/script/type/calendar/gapic_version.py')) as fp: + exec(fp.read(), version) +version = version["__version__"] + +if version[0] == "0": + release_status = "Development Status :: 4 - Beta" +else: + release_status = "Development Status :: 5 - Production/Stable" + +dependencies = [ + "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", + "proto-plus >= 1.22.0, <2.0.0dev", + "proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'", + "protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", + "google-apps-script-type >= 0.2.0, <1.0.0dev", +] +url = "https://github.com/googleapis/python-apps-script-type-calendar" + +package_root = os.path.abspath(os.path.dirname(__file__)) + +readme_filename = os.path.join(package_root, "README.rst") +with io.open(readme_filename, encoding="utf-8") as readme_file: + readme = readme_file.read() + +packages = [ + package + for package in setuptools.PEP420PackageFinder.find() + if package.startswith("google") +] + +namespaces = ["google", "google.apps", "google.apps.script", "google.apps.script.type"] + +setuptools.setup( + name=name, + version=version, + description=description, + long_description=readme, + author="Google LLC", + author_email="googleapis-packages@google.com", + license="Apache 2.0", + url=url, + classifiers=[ + release_status, + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Operating System :: OS Independent", + "Topic :: Internet", + ], + platforms="Posix; MacOS X; Windows", + packages=packages, + python_requires=">=3.7", + namespace_packages=namespaces, + install_requires=dependencies, + include_package_data=True, + zip_safe=False, +) diff --git a/owl-bot-staging/google-apps-script-type/calendar/calendar-py/testing/constraints-3.10.txt b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/testing/constraints-3.10.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/testing/constraints-3.10.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/calendar/calendar-py/testing/constraints-3.11.txt b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/testing/constraints-3.11.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/testing/constraints-3.11.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/calendar/calendar-py/testing/constraints-3.12.txt b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/testing/constraints-3.12.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/testing/constraints-3.12.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/calendar/calendar-py/testing/constraints-3.7.txt b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/testing/constraints-3.7.txt new file mode 100644 index 000000000000..4ae34ff40304 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/testing/constraints-3.7.txt @@ -0,0 +1,10 @@ +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file. +# Pin the version to the lower bound. +# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", +# Then this file should have google-cloud-foo==1.14.0 +google-api-core==1.34.0 +proto-plus==1.22.0 +protobuf==3.19.5 +google-apps-script-type==0.2.0 diff --git a/owl-bot-staging/google-apps-script-type/calendar/calendar-py/testing/constraints-3.8.txt b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/testing/constraints-3.8.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/testing/constraints-3.8.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/calendar/calendar-py/testing/constraints-3.9.txt b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/testing/constraints-3.9.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/testing/constraints-3.9.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/calendar/calendar-py/tests/__init__.py b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/tests/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/tests/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/calendar/calendar-py/tests/unit/__init__.py b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/tests/unit/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/tests/unit/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/calendar/calendar-py/tests/unit/gapic/__init__.py b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/tests/unit/gapic/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/tests/unit/gapic/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/calendar/calendar-py/tests/unit/gapic/calendar/__init__.py b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/tests/unit/gapic/calendar/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/calendar/calendar-py/tests/unit/gapic/calendar/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/docs/docs-py/.coveragerc b/owl-bot-staging/google-apps-script-type/docs/docs-py/.coveragerc new file mode 100644 index 000000000000..ead63ec35413 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs/docs-py/.coveragerc @@ -0,0 +1,13 @@ +[run] +branch = True + +[report] +show_missing = True +omit = + google/apps/script/type/docs/__init__.py + google/apps/script/type/docs/gapic_version.py +exclude_lines = + # Re-enable the standard pragma + pragma: NO COVER + # Ignore debug-only repr + def __repr__ diff --git a/owl-bot-staging/google-apps-script-type/docs/docs-py/.flake8 b/owl-bot-staging/google-apps-script-type/docs/docs-py/.flake8 new file mode 100644 index 000000000000..29227d4cf419 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs/docs-py/.flake8 @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Generated by synthtool. DO NOT EDIT! +[flake8] +ignore = E203, E266, E501, W503 +exclude = + # Exclude generated code. + **/proto/** + **/gapic/** + **/services/** + **/types/** + *_pb2.py + + # Standard linting exemptions. + **/.nox/** + __pycache__, + .git, + *.pyc, + conf.py diff --git a/owl-bot-staging/google-apps-script-type/docs/docs-py/MANIFEST.in b/owl-bot-staging/google-apps-script-type/docs/docs-py/MANIFEST.in new file mode 100644 index 000000000000..8089481e3476 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs/docs-py/MANIFEST.in @@ -0,0 +1,2 @@ +recursive-include google/apps/script/type/docs *.py +recursive-include google/apps/script/type/docs *.py diff --git a/owl-bot-staging/google-apps-script-type/docs/docs-py/README.rst b/owl-bot-staging/google-apps-script-type/docs/docs-py/README.rst new file mode 100644 index 000000000000..bddbe0cafc22 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs/docs-py/README.rst @@ -0,0 +1,49 @@ +Python Client for Google Apps Script Type Docs API +================================================= + +Quick Start +----------- + +In order to use this library, you first need to go through the following steps: + +1. `Select or create a Cloud Platform project.`_ +2. `Enable billing for your project.`_ +3. Enable the Google Apps Script Type Docs API. +4. `Setup Authentication.`_ + +.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project +.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project +.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html + +Installation +~~~~~~~~~~~~ + +Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to +create isolated Python environments. The basic problem it addresses is one of +dependencies and versions, and indirectly permissions. + +With `virtualenv`_, it's possible to install this library without needing system +install permissions, and without clashing with the installed system +dependencies. + +.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ + + +Mac/Linux +^^^^^^^^^ + +.. code-block:: console + + python3 -m venv + source /bin/activate + /bin/pip install /path/to/library + + +Windows +^^^^^^^ + +.. code-block:: console + + python3 -m venv + \Scripts\activate + \Scripts\pip.exe install \path\to\library diff --git a/owl-bot-staging/google-apps-script-type/docs/docs-py/docs/_static/custom.css b/owl-bot-staging/google-apps-script-type/docs/docs-py/docs/_static/custom.css new file mode 100644 index 000000000000..06423be0b592 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs/docs-py/docs/_static/custom.css @@ -0,0 +1,3 @@ +dl.field-list > dt { + min-width: 100px +} diff --git a/owl-bot-staging/google-apps-script-type/docs/docs-py/docs/conf.py b/owl-bot-staging/google-apps-script-type/docs/docs-py/docs/conf.py new file mode 100644 index 000000000000..b446e51ce266 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs/docs-py/docs/conf.py @@ -0,0 +1,376 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# google-apps-script-type-docs documentation build configuration file +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys +import os +import shlex + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +sys.path.insert(0, os.path.abspath("..")) + +__version__ = "0.1.0" + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +needs_sphinx = "4.0.1" + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.intersphinx", + "sphinx.ext.coverage", + "sphinx.ext.napoleon", + "sphinx.ext.todo", + "sphinx.ext.viewcode", +] + +# autodoc/autosummary flags +autoclass_content = "both" +autodoc_default_flags = ["members"] +autosummary_generate = True + + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# Allow markdown includes (so releases.md can include CHANGLEOG.md) +# http://www.sphinx-doc.org/en/master/markdown.html +source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +source_suffix = [".rst", ".md"] + +# The encoding of source files. +# source_encoding = 'utf-8-sig' + +# The root toctree document. +root_doc = "index" + +# General information about the project. +project = u"google-apps-script-type-docs" +copyright = u"2023, Google, LLC" +author = u"Google APIs" # TODO: autogenerate this bit + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The full version, including alpha/beta/rc tags. +release = __version__ +# The short X.Y version. +version = ".".join(release.split(".")[0:2]) + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = 'en' + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +# today = '' +# Else, today_fmt is used as the format for a strftime call. +# today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ["_build"] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +# default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +# add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +# add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +# show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = "sphinx" + +# A list of ignored prefixes for module index sorting. +# modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +# keep_warnings = False + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = True + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = "alabaster" + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +html_theme_options = { + "description": "Google Apps Script Type Client Libraries for Python", + "github_user": "googleapis", + "github_repo": "google-cloud-python", + "github_banner": True, + "font_family": "'Roboto', Georgia, sans", + "head_font_family": "'Roboto', Georgia, serif", + "code_font_family": "'Roboto Mono', 'Consolas', monospace", +} + +# Add any paths that contain custom themes here, relative to this directory. +# html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +# html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +# html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +# html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +# html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ["_static"] + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +# html_extra_path = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +# html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +# html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +# html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +# html_additional_pages = {} + +# If false, no module index is generated. +# html_domain_indices = True + +# If false, no index is generated. +# html_use_index = True + +# If true, the index is split into individual pages for each letter. +# html_split_index = False + +# If true, links to the reST sources are added to the pages. +# html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +# html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +# html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +# html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +# html_file_suffix = None + +# Language to be used for generating the HTML full-text search index. +# Sphinx supports the following languages: +# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' +# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' +# html_search_language = 'en' + +# A dictionary with options for the search language support, empty by default. +# Now only 'ja' uses this config value +# html_search_options = {'type': 'default'} + +# The name of a javascript file (relative to the configuration directory) that +# implements a search results scorer. If empty, the default will be used. +# html_search_scorer = 'scorer.js' + +# Output file base name for HTML help builder. +htmlhelp_basename = "google-apps-script-type-docs-doc" + +# -- Options for warnings ------------------------------------------------------ + + +suppress_warnings = [ + # Temporarily suppress this to avoid "more than one target found for + # cross-reference" warning, which are intractable for us to avoid while in + # a mono-repo. + # See https://github.com/sphinx-doc/sphinx/blob + # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 + "ref.python" +] + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # 'papersize': 'letterpaper', + # The font size ('10pt', '11pt' or '12pt'). + # 'pointsize': '10pt', + # Additional stuff for the LaTeX preamble. + # 'preamble': '', + # Latex figure (float) alignment + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + ( + root_doc, + "google-apps-script-type-docs.tex", + u"google-apps-script-type-docs Documentation", + author, + "manual", + ) +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +# latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +# latex_use_parts = False + +# If true, show page references after internal links. +# latex_show_pagerefs = False + +# If true, show URL addresses after external links. +# latex_show_urls = False + +# Documents to append as an appendix to all manuals. +# latex_appendices = [] + +# If false, no module index is generated. +# latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ( + root_doc, + "google-apps-script-type-docs", + u"Google Apps Script Type Docs Documentation", + [author], + 1, + ) +] + +# If true, show URL addresses after external links. +# man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ( + root_doc, + "google-apps-script-type-docs", + u"google-apps-script-type-docs Documentation", + author, + "google-apps-script-type-docs", + "GAPIC library for Google Apps Script Type Docs API", + "APIs", + ) +] + +# Documents to append as an appendix to all manuals. +# texinfo_appendices = [] + +# If false, no module index is generated. +# texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +# texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +# texinfo_no_detailmenu = False + + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = { + "python": ("http://python.readthedocs.org/en/latest/", None), + "gax": ("https://gax-python.readthedocs.org/en/latest/", None), + "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), + "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), + "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None), + "grpc": ("https://grpc.io/grpc/python/", None), + "requests": ("http://requests.kennethreitz.org/en/stable/", None), + "proto": ("https://proto-plus-python.readthedocs.io/en/stable", None), + "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), +} + + +# Napoleon settings +napoleon_google_docstring = True +napoleon_numpy_docstring = True +napoleon_include_private_with_doc = False +napoleon_include_special_with_doc = True +napoleon_use_admonition_for_examples = False +napoleon_use_admonition_for_notes = False +napoleon_use_admonition_for_references = False +napoleon_use_ivar = False +napoleon_use_param = True +napoleon_use_rtype = True diff --git a/owl-bot-staging/google-apps-script-type/docs/docs-py/docs/docs/services.rst b/owl-bot-staging/google-apps-script-type/docs/docs-py/docs/docs/services.rst new file mode 100644 index 000000000000..4af412e533c2 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs/docs-py/docs/docs/services.rst @@ -0,0 +1,4 @@ +Services for Google Apps Script Type Docs API +============================================== +.. toctree:: + :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/docs/docs-py/docs/docs/types.rst b/owl-bot-staging/google-apps-script-type/docs/docs-py/docs/docs/types.rst new file mode 100644 index 000000000000..3f47df031446 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs/docs-py/docs/docs/types.rst @@ -0,0 +1,6 @@ +Types for Google Apps Script Type Docs API +=========================================== + +.. automodule:: google.apps.script.type.docs.types + :members: + :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/docs/docs-py/docs/index.rst b/owl-bot-staging/google-apps-script-type/docs/docs-py/docs/index.rst new file mode 100644 index 000000000000..5f04c66f17e2 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs/docs-py/docs/index.rst @@ -0,0 +1,7 @@ +API Reference +------------- +.. toctree:: + :maxdepth: 2 + + docs/services + docs/types diff --git a/owl-bot-staging/google-apps-script-type/docs/docs-py/google/apps/script/type/docs/__init__.py b/owl-bot-staging/google-apps-script-type/docs/docs-py/google/apps/script/type/docs/__init__.py new file mode 100644 index 000000000000..74558807cc62 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs/docs-py/google/apps/script/type/docs/__init__.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from google.apps.script.type.docs import gapic_version as package_version + +__version__ = package_version.__version__ + + + +from .types.docs_addon_manifest import DocsAddOnManifest +from .types.docs_addon_manifest import DocsExtensionPoint + +__all__ = ( +'DocsAddOnManifest', +'DocsExtensionPoint', +) diff --git a/owl-bot-staging/google-apps-script-type/docs/docs-py/google/apps/script/type/docs/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/docs/docs-py/google/apps/script/type/docs/gapic_metadata.json new file mode 100644 index 000000000000..5df2a0423a5e --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs/docs-py/google/apps/script/type/docs/gapic_metadata.json @@ -0,0 +1,7 @@ + { + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "python", + "libraryPackage": "google.apps.script.type.docs", + "protoPackage": "google.apps.script.type.docs", + "schema": "1.0" +} diff --git a/owl-bot-staging/google-apps-script-type/docs/docs-py/google/apps/script/type/docs/gapic_version.py b/owl-bot-staging/google-apps-script-type/docs/docs-py/google/apps/script/type/docs/gapic_version.py new file mode 100644 index 000000000000..360a0d13ebdd --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs/docs-py/google/apps/script/type/docs/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/docs/docs-py/google/apps/script/type/docs/py.typed b/owl-bot-staging/google-apps-script-type/docs/docs-py/google/apps/script/type/docs/py.typed new file mode 100644 index 000000000000..a954439caa66 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs/docs-py/google/apps/script/type/docs/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-apps-script-type-docs package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/docs/docs-py/google/apps/script/type/docs/services/__init__.py b/owl-bot-staging/google-apps-script-type/docs/docs-py/google/apps/script/type/docs/services/__init__.py new file mode 100644 index 000000000000..89a37dc92c5a --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs/docs-py/google/apps/script/type/docs/services/__init__.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/docs/docs-py/google/apps/script/type/docs/types/__init__.py b/owl-bot-staging/google-apps-script-type/docs/docs-py/google/apps/script/type/docs/types/__init__.py new file mode 100644 index 000000000000..1dbe144fc8ff --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs/docs-py/google/apps/script/type/docs/types/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from .docs_addon_manifest import ( + DocsAddOnManifest, + DocsExtensionPoint, +) + +__all__ = ( + 'DocsAddOnManifest', + 'DocsExtensionPoint', +) diff --git a/owl-bot-staging/google-apps-script-type/docs/docs-py/google/apps/script/type/docs/types/docs_addon_manifest.py b/owl-bot-staging/google-apps-script-type/docs/docs-py/google/apps/script/type/docs/types/docs_addon_manifest.py new file mode 100644 index 000000000000..db2d01ed2b4c --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs/docs-py/google/apps/script/type/docs/types/docs_addon_manifest.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.apps.script.type.types import extension_point + + +__protobuf__ = proto.module( + package='google.apps.script.type.docs', + manifest={ + 'DocsAddOnManifest', + 'DocsExtensionPoint', + }, +) + + +class DocsAddOnManifest(proto.Message): + r"""Docs add-on manifest. + + Attributes: + homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): + If present, this overrides the configuration from + ``addOns.common.homepageTrigger``. + on_file_scope_granted_trigger (google.apps.script.type.docs.types.DocsExtensionPoint): + Endpoint to execute when file scope + authorization is granted for this document/user + pair. + """ + + homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( + proto.MESSAGE, + number=1, + message=extension_point.HomepageExtensionPoint, + ) + on_file_scope_granted_trigger: 'DocsExtensionPoint' = proto.Field( + proto.MESSAGE, + number=2, + message='DocsExtensionPoint', + ) + + +class DocsExtensionPoint(proto.Message): + r"""Common format for declaring a Docs add-on's triggers. + + Attributes: + run_function (str): + Required. The endpoint to execute when this + extension point is activated. + """ + + run_function: str = proto.Field( + proto.STRING, + number=1, + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/docs/docs-py/mypy.ini b/owl-bot-staging/google-apps-script-type/docs/docs-py/mypy.ini new file mode 100644 index 000000000000..574c5aed394b --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs/docs-py/mypy.ini @@ -0,0 +1,3 @@ +[mypy] +python_version = 3.7 +namespace_packages = True diff --git a/owl-bot-staging/google-apps-script-type/docs/docs-py/noxfile.py b/owl-bot-staging/google-apps-script-type/docs/docs-py/noxfile.py new file mode 100644 index 000000000000..c33f83a33c39 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs/docs-py/noxfile.py @@ -0,0 +1,184 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import os +import pathlib +import shutil +import subprocess +import sys + + +import nox # type: ignore + +ALL_PYTHON = [ + "3.7", + "3.8", + "3.9", + "3.10", + "3.11", +] + +CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() + +LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt" +PACKAGE_NAME = subprocess.check_output([sys.executable, "setup.py", "--name"], encoding="utf-8") + +BLACK_VERSION = "black==22.3.0" +BLACK_PATHS = ["docs", "google", "tests", "samples", "noxfile.py", "setup.py"] +DEFAULT_PYTHON_VERSION = "3.11" + +nox.sessions = [ + "unit", + "cover", + "mypy", + "check_lower_bounds" + # exclude update_lower_bounds from default + "docs", + "blacken", + "lint", + "lint_setup_py", +] + +@nox.session(python=ALL_PYTHON) +def unit(session): + """Run the unit test suite.""" + + session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') + session.install('-e', '.') + + session.run( + 'py.test', + '--quiet', + '--cov=google/apps/script/type/docs/', + '--cov=tests/', + '--cov-config=.coveragerc', + '--cov-report=term', + '--cov-report=html', + os.path.join('tests', 'unit', ''.join(session.posargs)) + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def cover(session): + """Run the final coverage report. + This outputs the coverage report aggregating coverage from the unit + test runs (not system test runs), and then erases coverage data. + """ + session.install("coverage", "pytest-cov") + session.run("coverage", "report", "--show-missing", "--fail-under=100") + + session.run("coverage", "erase") + + +@nox.session(python=ALL_PYTHON) +def mypy(session): + """Run the type checker.""" + session.install( + 'mypy', + 'types-requests', + 'types-protobuf' + ) + session.install('.') + session.run( + 'mypy', + '--explicit-package-bases', + 'google', + ) + + +@nox.session +def update_lower_bounds(session): + """Update lower bounds in constraints.txt to match setup.py""" + session.install('google-cloud-testutils') + session.install('.') + + session.run( + 'lower-bound-checker', + 'update', + '--package-name', + PACKAGE_NAME, + '--constraints-file', + str(LOWER_BOUND_CONSTRAINTS_FILE), + ) + + +@nox.session +def check_lower_bounds(session): + """Check lower bounds in setup.py are reflected in constraints file""" + session.install('google-cloud-testutils') + session.install('.') + + session.run( + 'lower-bound-checker', + 'check', + '--package-name', + PACKAGE_NAME, + '--constraints-file', + str(LOWER_BOUND_CONSTRAINTS_FILE), + ) + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def docs(session): + """Build the docs for this library.""" + + session.install("-e", ".") + session.install("sphinx==7.0.1", "alabaster", "recommonmark") + + shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) + session.run( + "sphinx-build", + "-W", # warnings as errors + "-T", # show full traceback on exception + "-N", # no colors + "-b", + "html", + "-d", + os.path.join("docs", "_build", "doctrees", ""), + os.path.join("docs", ""), + os.path.join("docs", "_build", "html", ""), + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def lint(session): + """Run linters. + + Returns a failure if the linters find linting errors or sufficiently + serious code quality issues. + """ + session.install("flake8", BLACK_VERSION) + session.run( + "black", + "--check", + *BLACK_PATHS, + ) + session.run("flake8", "google", "tests", "samples") + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def blacken(session): + """Run black. Format code to uniform standard.""" + session.install(BLACK_VERSION) + session.run( + "black", + *BLACK_PATHS, + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def lint_setup_py(session): + """Verify that setup.py is valid (including RST check).""" + session.install("docutils", "pygments") + session.run("python", "setup.py", "check", "--restructuredtext", "--strict") diff --git a/owl-bot-staging/google-apps-script-type/docs/docs-py/scripts/fixup_docs_keywords.py b/owl-bot-staging/google-apps-script-type/docs/docs-py/scripts/fixup_docs_keywords.py new file mode 100644 index 000000000000..d48b7b2fa613 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs/docs-py/scripts/fixup_docs_keywords.py @@ -0,0 +1,175 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import argparse +import os +import libcst as cst +import pathlib +import sys +from typing import (Any, Callable, Dict, List, Sequence, Tuple) + + +def partition( + predicate: Callable[[Any], bool], + iterator: Sequence[Any] +) -> Tuple[List[Any], List[Any]]: + """A stable, out-of-place partition.""" + results = ([], []) + + for i in iterator: + results[int(predicate(i))].append(i) + + # Returns trueList, falseList + return results[1], results[0] + + +class docsCallTransformer(cst.CSTTransformer): + CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') + METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { + } + + def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: + try: + key = original.func.attr.value + kword_params = self.METHOD_TO_PARAMS[key] + except (AttributeError, KeyError): + # Either not a method from the API or too convoluted to be sure. + return updated + + # If the existing code is valid, keyword args come after positional args. + # Therefore, all positional args must map to the first parameters. + args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) + if any(k.keyword.value == "request" for k in kwargs): + # We've already fixed this file, don't fix it again. + return updated + + kwargs, ctrl_kwargs = partition( + lambda a: a.keyword.value not in self.CTRL_PARAMS, + kwargs + ) + + args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] + ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) + for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) + + request_arg = cst.Arg( + value=cst.Dict([ + cst.DictElement( + cst.SimpleString("'{}'".format(name)), +cst.Element(value=arg.value) + ) + # Note: the args + kwargs looks silly, but keep in mind that + # the control parameters had to be stripped out, and that + # those could have been passed positionally or by keyword. + for name, arg in zip(kword_params, args + kwargs)]), + keyword=cst.Name("request") + ) + + return updated.with_changes( + args=[request_arg] + ctrl_kwargs + ) + + +def fix_files( + in_dir: pathlib.Path, + out_dir: pathlib.Path, + *, + transformer=docsCallTransformer(), +): + """Duplicate the input dir to the output dir, fixing file method calls. + + Preconditions: + * in_dir is a real directory + * out_dir is a real, empty directory + """ + pyfile_gen = ( + pathlib.Path(os.path.join(root, f)) + for root, _, files in os.walk(in_dir) + for f in files if os.path.splitext(f)[1] == ".py" + ) + + for fpath in pyfile_gen: + with open(fpath, 'r') as f: + src = f.read() + + # Parse the code and insert method call fixes. + tree = cst.parse_module(src) + updated = tree.visit(transformer) + + # Create the path and directory structure for the new file. + updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) + updated_path.parent.mkdir(parents=True, exist_ok=True) + + # Generate the updated source file at the corresponding path. + with open(updated_path, 'w') as f: + f.write(updated.code) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser( + description="""Fix up source that uses the docs client library. + +The existing sources are NOT overwritten but are copied to output_dir with changes made. + +Note: This tool operates at a best-effort level at converting positional + parameters in client method calls to keyword based parameters. + Cases where it WILL FAIL include + A) * or ** expansion in a method call. + B) Calls via function or method alias (includes free function calls) + C) Indirect or dispatched calls (e.g. the method is looked up dynamically) + + These all constitute false negatives. The tool will also detect false + positives when an API method shares a name with another method. +""") + parser.add_argument( + '-d', + '--input-directory', + required=True, + dest='input_dir', + help='the input directory to walk for python files to fix up', + ) + parser.add_argument( + '-o', + '--output-directory', + required=True, + dest='output_dir', + help='the directory to output files fixed via un-flattening', + ) + args = parser.parse_args() + input_dir = pathlib.Path(args.input_dir) + output_dir = pathlib.Path(args.output_dir) + if not input_dir.is_dir(): + print( + f"input directory '{input_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if not output_dir.is_dir(): + print( + f"output directory '{output_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if os.listdir(output_dir): + print( + f"output directory '{output_dir}' is not empty", + file=sys.stderr, + ) + sys.exit(-1) + + fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/docs/docs-py/setup.py b/owl-bot-staging/google-apps-script-type/docs/docs-py/setup.py new file mode 100644 index 000000000000..ccf3ed2c0466 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs/docs-py/setup.py @@ -0,0 +1,91 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import io +import os + +import setuptools # type: ignore + +package_root = os.path.abspath(os.path.dirname(__file__)) + +name = 'google-apps-script-type-docs' + + +description = "Google Apps Script Type Docs API client library" + +version = {} +with open(os.path.join(package_root, 'google/apps/script/type/docs/gapic_version.py')) as fp: + exec(fp.read(), version) +version = version["__version__"] + +if version[0] == "0": + release_status = "Development Status :: 4 - Beta" +else: + release_status = "Development Status :: 5 - Production/Stable" + +dependencies = [ + "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", + "proto-plus >= 1.22.0, <2.0.0dev", + "proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'", + "protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", + "google-apps-script-type >= 0.2.0, <1.0.0dev", +] +url = "https://github.com/googleapis/python-apps-script-type-docs" + +package_root = os.path.abspath(os.path.dirname(__file__)) + +readme_filename = os.path.join(package_root, "README.rst") +with io.open(readme_filename, encoding="utf-8") as readme_file: + readme = readme_file.read() + +packages = [ + package + for package in setuptools.PEP420PackageFinder.find() + if package.startswith("google") +] + +namespaces = ["google", "google.apps", "google.apps.script", "google.apps.script.type"] + +setuptools.setup( + name=name, + version=version, + description=description, + long_description=readme, + author="Google LLC", + author_email="googleapis-packages@google.com", + license="Apache 2.0", + url=url, + classifiers=[ + release_status, + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Operating System :: OS Independent", + "Topic :: Internet", + ], + platforms="Posix; MacOS X; Windows", + packages=packages, + python_requires=">=3.7", + namespace_packages=namespaces, + install_requires=dependencies, + include_package_data=True, + zip_safe=False, +) diff --git a/owl-bot-staging/google-apps-script-type/docs/docs-py/testing/constraints-3.10.txt b/owl-bot-staging/google-apps-script-type/docs/docs-py/testing/constraints-3.10.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs/docs-py/testing/constraints-3.10.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/docs/docs-py/testing/constraints-3.11.txt b/owl-bot-staging/google-apps-script-type/docs/docs-py/testing/constraints-3.11.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs/docs-py/testing/constraints-3.11.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/docs/docs-py/testing/constraints-3.12.txt b/owl-bot-staging/google-apps-script-type/docs/docs-py/testing/constraints-3.12.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs/docs-py/testing/constraints-3.12.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/docs/docs-py/testing/constraints-3.7.txt b/owl-bot-staging/google-apps-script-type/docs/docs-py/testing/constraints-3.7.txt new file mode 100644 index 000000000000..4ae34ff40304 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs/docs-py/testing/constraints-3.7.txt @@ -0,0 +1,10 @@ +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file. +# Pin the version to the lower bound. +# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", +# Then this file should have google-cloud-foo==1.14.0 +google-api-core==1.34.0 +proto-plus==1.22.0 +protobuf==3.19.5 +google-apps-script-type==0.2.0 diff --git a/owl-bot-staging/google-apps-script-type/docs/docs-py/testing/constraints-3.8.txt b/owl-bot-staging/google-apps-script-type/docs/docs-py/testing/constraints-3.8.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs/docs-py/testing/constraints-3.8.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/docs/docs-py/testing/constraints-3.9.txt b/owl-bot-staging/google-apps-script-type/docs/docs-py/testing/constraints-3.9.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs/docs-py/testing/constraints-3.9.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/docs/docs-py/tests/__init__.py b/owl-bot-staging/google-apps-script-type/docs/docs-py/tests/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs/docs-py/tests/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/docs/docs-py/tests/unit/__init__.py b/owl-bot-staging/google-apps-script-type/docs/docs-py/tests/unit/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs/docs-py/tests/unit/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/docs/docs-py/tests/unit/gapic/__init__.py b/owl-bot-staging/google-apps-script-type/docs/docs-py/tests/unit/gapic/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs/docs-py/tests/unit/gapic/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/docs/docs-py/tests/unit/gapic/docs/__init__.py b/owl-bot-staging/google-apps-script-type/docs/docs-py/tests/unit/gapic/docs/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/docs/docs-py/tests/unit/gapic/docs/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/drive/drive-py/.coveragerc b/owl-bot-staging/google-apps-script-type/drive/drive-py/.coveragerc new file mode 100644 index 000000000000..ab4cf2da754a --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive/drive-py/.coveragerc @@ -0,0 +1,13 @@ +[run] +branch = True + +[report] +show_missing = True +omit = + google/apps/script/type/drive/__init__.py + google/apps/script/type/drive/gapic_version.py +exclude_lines = + # Re-enable the standard pragma + pragma: NO COVER + # Ignore debug-only repr + def __repr__ diff --git a/owl-bot-staging/google-apps-script-type/drive/drive-py/.flake8 b/owl-bot-staging/google-apps-script-type/drive/drive-py/.flake8 new file mode 100644 index 000000000000..29227d4cf419 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive/drive-py/.flake8 @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Generated by synthtool. DO NOT EDIT! +[flake8] +ignore = E203, E266, E501, W503 +exclude = + # Exclude generated code. + **/proto/** + **/gapic/** + **/services/** + **/types/** + *_pb2.py + + # Standard linting exemptions. + **/.nox/** + __pycache__, + .git, + *.pyc, + conf.py diff --git a/owl-bot-staging/google-apps-script-type/drive/drive-py/MANIFEST.in b/owl-bot-staging/google-apps-script-type/drive/drive-py/MANIFEST.in new file mode 100644 index 000000000000..22ebbed5ba4a --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive/drive-py/MANIFEST.in @@ -0,0 +1,2 @@ +recursive-include google/apps/script/type/drive *.py +recursive-include google/apps/script/type/drive *.py diff --git a/owl-bot-staging/google-apps-script-type/drive/drive-py/README.rst b/owl-bot-staging/google-apps-script-type/drive/drive-py/README.rst new file mode 100644 index 000000000000..a9662a9269da --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive/drive-py/README.rst @@ -0,0 +1,49 @@ +Python Client for Google Apps Script Type Drive API +================================================= + +Quick Start +----------- + +In order to use this library, you first need to go through the following steps: + +1. `Select or create a Cloud Platform project.`_ +2. `Enable billing for your project.`_ +3. Enable the Google Apps Script Type Drive API. +4. `Setup Authentication.`_ + +.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project +.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project +.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html + +Installation +~~~~~~~~~~~~ + +Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to +create isolated Python environments. The basic problem it addresses is one of +dependencies and versions, and indirectly permissions. + +With `virtualenv`_, it's possible to install this library without needing system +install permissions, and without clashing with the installed system +dependencies. + +.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ + + +Mac/Linux +^^^^^^^^^ + +.. code-block:: console + + python3 -m venv + source /bin/activate + /bin/pip install /path/to/library + + +Windows +^^^^^^^ + +.. code-block:: console + + python3 -m venv + \Scripts\activate + \Scripts\pip.exe install \path\to\library diff --git a/owl-bot-staging/google-apps-script-type/drive/drive-py/docs/_static/custom.css b/owl-bot-staging/google-apps-script-type/drive/drive-py/docs/_static/custom.css new file mode 100644 index 000000000000..06423be0b592 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive/drive-py/docs/_static/custom.css @@ -0,0 +1,3 @@ +dl.field-list > dt { + min-width: 100px +} diff --git a/owl-bot-staging/google-apps-script-type/drive/drive-py/docs/conf.py b/owl-bot-staging/google-apps-script-type/drive/drive-py/docs/conf.py new file mode 100644 index 000000000000..42b47783c3a0 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive/drive-py/docs/conf.py @@ -0,0 +1,376 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# google-apps-script-type-drive documentation build configuration file +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys +import os +import shlex + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +sys.path.insert(0, os.path.abspath("..")) + +__version__ = "0.1.0" + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +needs_sphinx = "4.0.1" + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.intersphinx", + "sphinx.ext.coverage", + "sphinx.ext.napoleon", + "sphinx.ext.todo", + "sphinx.ext.viewcode", +] + +# autodoc/autosummary flags +autoclass_content = "both" +autodoc_default_flags = ["members"] +autosummary_generate = True + + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# Allow markdown includes (so releases.md can include CHANGLEOG.md) +# http://www.sphinx-doc.org/en/master/markdown.html +source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +source_suffix = [".rst", ".md"] + +# The encoding of source files. +# source_encoding = 'utf-8-sig' + +# The root toctree document. +root_doc = "index" + +# General information about the project. +project = u"google-apps-script-type-drive" +copyright = u"2023, Google, LLC" +author = u"Google APIs" # TODO: autogenerate this bit + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The full version, including alpha/beta/rc tags. +release = __version__ +# The short X.Y version. +version = ".".join(release.split(".")[0:2]) + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = 'en' + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +# today = '' +# Else, today_fmt is used as the format for a strftime call. +# today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ["_build"] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +# default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +# add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +# add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +# show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = "sphinx" + +# A list of ignored prefixes for module index sorting. +# modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +# keep_warnings = False + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = True + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = "alabaster" + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +html_theme_options = { + "description": "Google Apps Script Type Client Libraries for Python", + "github_user": "googleapis", + "github_repo": "google-cloud-python", + "github_banner": True, + "font_family": "'Roboto', Georgia, sans", + "head_font_family": "'Roboto', Georgia, serif", + "code_font_family": "'Roboto Mono', 'Consolas', monospace", +} + +# Add any paths that contain custom themes here, relative to this directory. +# html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +# html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +# html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +# html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +# html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ["_static"] + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +# html_extra_path = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +# html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +# html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +# html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +# html_additional_pages = {} + +# If false, no module index is generated. +# html_domain_indices = True + +# If false, no index is generated. +# html_use_index = True + +# If true, the index is split into individual pages for each letter. +# html_split_index = False + +# If true, links to the reST sources are added to the pages. +# html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +# html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +# html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +# html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +# html_file_suffix = None + +# Language to be used for generating the HTML full-text search index. +# Sphinx supports the following languages: +# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' +# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' +# html_search_language = 'en' + +# A dictionary with options for the search language support, empty by default. +# Now only 'ja' uses this config value +# html_search_options = {'type': 'default'} + +# The name of a javascript file (relative to the configuration directory) that +# implements a search results scorer. If empty, the default will be used. +# html_search_scorer = 'scorer.js' + +# Output file base name for HTML help builder. +htmlhelp_basename = "google-apps-script-type-drive-doc" + +# -- Options for warnings ------------------------------------------------------ + + +suppress_warnings = [ + # Temporarily suppress this to avoid "more than one target found for + # cross-reference" warning, which are intractable for us to avoid while in + # a mono-repo. + # See https://github.com/sphinx-doc/sphinx/blob + # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 + "ref.python" +] + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # 'papersize': 'letterpaper', + # The font size ('10pt', '11pt' or '12pt'). + # 'pointsize': '10pt', + # Additional stuff for the LaTeX preamble. + # 'preamble': '', + # Latex figure (float) alignment + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + ( + root_doc, + "google-apps-script-type-drive.tex", + u"google-apps-script-type-drive Documentation", + author, + "manual", + ) +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +# latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +# latex_use_parts = False + +# If true, show page references after internal links. +# latex_show_pagerefs = False + +# If true, show URL addresses after external links. +# latex_show_urls = False + +# Documents to append as an appendix to all manuals. +# latex_appendices = [] + +# If false, no module index is generated. +# latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ( + root_doc, + "google-apps-script-type-drive", + u"Google Apps Script Type Drive Documentation", + [author], + 1, + ) +] + +# If true, show URL addresses after external links. +# man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ( + root_doc, + "google-apps-script-type-drive", + u"google-apps-script-type-drive Documentation", + author, + "google-apps-script-type-drive", + "GAPIC library for Google Apps Script Type Drive API", + "APIs", + ) +] + +# Documents to append as an appendix to all manuals. +# texinfo_appendices = [] + +# If false, no module index is generated. +# texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +# texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +# texinfo_no_detailmenu = False + + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = { + "python": ("http://python.readthedocs.org/en/latest/", None), + "gax": ("https://gax-python.readthedocs.org/en/latest/", None), + "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), + "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), + "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None), + "grpc": ("https://grpc.io/grpc/python/", None), + "requests": ("http://requests.kennethreitz.org/en/stable/", None), + "proto": ("https://proto-plus-python.readthedocs.io/en/stable", None), + "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), +} + + +# Napoleon settings +napoleon_google_docstring = True +napoleon_numpy_docstring = True +napoleon_include_private_with_doc = False +napoleon_include_special_with_doc = True +napoleon_use_admonition_for_examples = False +napoleon_use_admonition_for_notes = False +napoleon_use_admonition_for_references = False +napoleon_use_ivar = False +napoleon_use_param = True +napoleon_use_rtype = True diff --git a/owl-bot-staging/google-apps-script-type/drive/drive-py/docs/drive/services.rst b/owl-bot-staging/google-apps-script-type/drive/drive-py/docs/drive/services.rst new file mode 100644 index 000000000000..8ff18c898331 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive/drive-py/docs/drive/services.rst @@ -0,0 +1,4 @@ +Services for Google Apps Script Type Drive API +=============================================== +.. toctree:: + :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/drive/drive-py/docs/drive/types.rst b/owl-bot-staging/google-apps-script-type/drive/drive-py/docs/drive/types.rst new file mode 100644 index 000000000000..b7b1423eb9ea --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive/drive-py/docs/drive/types.rst @@ -0,0 +1,6 @@ +Types for Google Apps Script Type Drive API +============================================ + +.. automodule:: google.apps.script.type.drive.types + :members: + :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/drive/drive-py/docs/index.rst b/owl-bot-staging/google-apps-script-type/drive/drive-py/docs/index.rst new file mode 100644 index 000000000000..3c5e26492b43 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive/drive-py/docs/index.rst @@ -0,0 +1,7 @@ +API Reference +------------- +.. toctree:: + :maxdepth: 2 + + drive/services + drive/types diff --git a/owl-bot-staging/google-apps-script-type/drive/drive-py/google/apps/script/type/drive/__init__.py b/owl-bot-staging/google-apps-script-type/drive/drive-py/google/apps/script/type/drive/__init__.py new file mode 100644 index 000000000000..85f4fe7c43ca --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive/drive-py/google/apps/script/type/drive/__init__.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from google.apps.script.type.drive import gapic_version as package_version + +__version__ = package_version.__version__ + + + +from .types.drive_addon_manifest import DriveAddOnManifest +from .types.drive_addon_manifest import DriveExtensionPoint + +__all__ = ( +'DriveAddOnManifest', +'DriveExtensionPoint', +) diff --git a/owl-bot-staging/google-apps-script-type/drive/drive-py/google/apps/script/type/drive/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/drive/drive-py/google/apps/script/type/drive/gapic_metadata.json new file mode 100644 index 000000000000..89577093651d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive/drive-py/google/apps/script/type/drive/gapic_metadata.json @@ -0,0 +1,7 @@ + { + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "python", + "libraryPackage": "google.apps.script.type.drive", + "protoPackage": "google.apps.script.type.drive", + "schema": "1.0" +} diff --git a/owl-bot-staging/google-apps-script-type/drive/drive-py/google/apps/script/type/drive/gapic_version.py b/owl-bot-staging/google-apps-script-type/drive/drive-py/google/apps/script/type/drive/gapic_version.py new file mode 100644 index 000000000000..360a0d13ebdd --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive/drive-py/google/apps/script/type/drive/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/drive/drive-py/google/apps/script/type/drive/py.typed b/owl-bot-staging/google-apps-script-type/drive/drive-py/google/apps/script/type/drive/py.typed new file mode 100644 index 000000000000..bbb573f18f73 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive/drive-py/google/apps/script/type/drive/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-apps-script-type-drive package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/drive/drive-py/google/apps/script/type/drive/services/__init__.py b/owl-bot-staging/google-apps-script-type/drive/drive-py/google/apps/script/type/drive/services/__init__.py new file mode 100644 index 000000000000..89a37dc92c5a --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive/drive-py/google/apps/script/type/drive/services/__init__.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/drive/drive-py/google/apps/script/type/drive/types/__init__.py b/owl-bot-staging/google-apps-script-type/drive/drive-py/google/apps/script/type/drive/types/__init__.py new file mode 100644 index 000000000000..85a4d7c4c5d6 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive/drive-py/google/apps/script/type/drive/types/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from .drive_addon_manifest import ( + DriveAddOnManifest, + DriveExtensionPoint, +) + +__all__ = ( + 'DriveAddOnManifest', + 'DriveExtensionPoint', +) diff --git a/owl-bot-staging/google-apps-script-type/drive/drive-py/google/apps/script/type/drive/types/drive_addon_manifest.py b/owl-bot-staging/google-apps-script-type/drive/drive-py/google/apps/script/type/drive/types/drive_addon_manifest.py new file mode 100644 index 000000000000..b3c25a891c92 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive/drive-py/google/apps/script/type/drive/types/drive_addon_manifest.py @@ -0,0 +1,76 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.apps.script.type.types import extension_point + + +__protobuf__ = proto.module( + package='google.apps.script.type.drive', + manifest={ + 'DriveAddOnManifest', + 'DriveExtensionPoint', + }, +) + + +class DriveAddOnManifest(proto.Message): + r"""Drive add-on manifest. + + Attributes: + homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): + If present, this overrides the configuration from + ``addOns.common.homepageTrigger``. + on_items_selected_trigger (google.apps.script.type.drive.types.DriveExtensionPoint): + Corresponds to behvior that should execute + when items are selected in relevant Drive view + (e.g. the My Drive Doclist). + """ + + homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( + proto.MESSAGE, + number=1, + message=extension_point.HomepageExtensionPoint, + ) + on_items_selected_trigger: 'DriveExtensionPoint' = proto.Field( + proto.MESSAGE, + number=2, + message='DriveExtensionPoint', + ) + + +class DriveExtensionPoint(proto.Message): + r"""A generic extension point with common features, e.g. + something that simply needs a corresponding run function to + work. + + Attributes: + run_function (str): + Required. The endpoint to execute when this + extension point is activated. + """ + + run_function: str = proto.Field( + proto.STRING, + number=1, + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/drive/drive-py/mypy.ini b/owl-bot-staging/google-apps-script-type/drive/drive-py/mypy.ini new file mode 100644 index 000000000000..574c5aed394b --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive/drive-py/mypy.ini @@ -0,0 +1,3 @@ +[mypy] +python_version = 3.7 +namespace_packages = True diff --git a/owl-bot-staging/google-apps-script-type/drive/drive-py/noxfile.py b/owl-bot-staging/google-apps-script-type/drive/drive-py/noxfile.py new file mode 100644 index 000000000000..181e401f2266 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive/drive-py/noxfile.py @@ -0,0 +1,184 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import os +import pathlib +import shutil +import subprocess +import sys + + +import nox # type: ignore + +ALL_PYTHON = [ + "3.7", + "3.8", + "3.9", + "3.10", + "3.11", +] + +CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() + +LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt" +PACKAGE_NAME = subprocess.check_output([sys.executable, "setup.py", "--name"], encoding="utf-8") + +BLACK_VERSION = "black==22.3.0" +BLACK_PATHS = ["docs", "google", "tests", "samples", "noxfile.py", "setup.py"] +DEFAULT_PYTHON_VERSION = "3.11" + +nox.sessions = [ + "unit", + "cover", + "mypy", + "check_lower_bounds" + # exclude update_lower_bounds from default + "docs", + "blacken", + "lint", + "lint_setup_py", +] + +@nox.session(python=ALL_PYTHON) +def unit(session): + """Run the unit test suite.""" + + session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') + session.install('-e', '.') + + session.run( + 'py.test', + '--quiet', + '--cov=google/apps/script/type/drive/', + '--cov=tests/', + '--cov-config=.coveragerc', + '--cov-report=term', + '--cov-report=html', + os.path.join('tests', 'unit', ''.join(session.posargs)) + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def cover(session): + """Run the final coverage report. + This outputs the coverage report aggregating coverage from the unit + test runs (not system test runs), and then erases coverage data. + """ + session.install("coverage", "pytest-cov") + session.run("coverage", "report", "--show-missing", "--fail-under=100") + + session.run("coverage", "erase") + + +@nox.session(python=ALL_PYTHON) +def mypy(session): + """Run the type checker.""" + session.install( + 'mypy', + 'types-requests', + 'types-protobuf' + ) + session.install('.') + session.run( + 'mypy', + '--explicit-package-bases', + 'google', + ) + + +@nox.session +def update_lower_bounds(session): + """Update lower bounds in constraints.txt to match setup.py""" + session.install('google-cloud-testutils') + session.install('.') + + session.run( + 'lower-bound-checker', + 'update', + '--package-name', + PACKAGE_NAME, + '--constraints-file', + str(LOWER_BOUND_CONSTRAINTS_FILE), + ) + + +@nox.session +def check_lower_bounds(session): + """Check lower bounds in setup.py are reflected in constraints file""" + session.install('google-cloud-testutils') + session.install('.') + + session.run( + 'lower-bound-checker', + 'check', + '--package-name', + PACKAGE_NAME, + '--constraints-file', + str(LOWER_BOUND_CONSTRAINTS_FILE), + ) + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def docs(session): + """Build the docs for this library.""" + + session.install("-e", ".") + session.install("sphinx==7.0.1", "alabaster", "recommonmark") + + shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) + session.run( + "sphinx-build", + "-W", # warnings as errors + "-T", # show full traceback on exception + "-N", # no colors + "-b", + "html", + "-d", + os.path.join("docs", "_build", "doctrees", ""), + os.path.join("docs", ""), + os.path.join("docs", "_build", "html", ""), + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def lint(session): + """Run linters. + + Returns a failure if the linters find linting errors or sufficiently + serious code quality issues. + """ + session.install("flake8", BLACK_VERSION) + session.run( + "black", + "--check", + *BLACK_PATHS, + ) + session.run("flake8", "google", "tests", "samples") + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def blacken(session): + """Run black. Format code to uniform standard.""" + session.install(BLACK_VERSION) + session.run( + "black", + *BLACK_PATHS, + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def lint_setup_py(session): + """Verify that setup.py is valid (including RST check).""" + session.install("docutils", "pygments") + session.run("python", "setup.py", "check", "--restructuredtext", "--strict") diff --git a/owl-bot-staging/google-apps-script-type/drive/drive-py/scripts/fixup_drive_keywords.py b/owl-bot-staging/google-apps-script-type/drive/drive-py/scripts/fixup_drive_keywords.py new file mode 100644 index 000000000000..7928863678e4 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive/drive-py/scripts/fixup_drive_keywords.py @@ -0,0 +1,175 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import argparse +import os +import libcst as cst +import pathlib +import sys +from typing import (Any, Callable, Dict, List, Sequence, Tuple) + + +def partition( + predicate: Callable[[Any], bool], + iterator: Sequence[Any] +) -> Tuple[List[Any], List[Any]]: + """A stable, out-of-place partition.""" + results = ([], []) + + for i in iterator: + results[int(predicate(i))].append(i) + + # Returns trueList, falseList + return results[1], results[0] + + +class driveCallTransformer(cst.CSTTransformer): + CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') + METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { + } + + def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: + try: + key = original.func.attr.value + kword_params = self.METHOD_TO_PARAMS[key] + except (AttributeError, KeyError): + # Either not a method from the API or too convoluted to be sure. + return updated + + # If the existing code is valid, keyword args come after positional args. + # Therefore, all positional args must map to the first parameters. + args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) + if any(k.keyword.value == "request" for k in kwargs): + # We've already fixed this file, don't fix it again. + return updated + + kwargs, ctrl_kwargs = partition( + lambda a: a.keyword.value not in self.CTRL_PARAMS, + kwargs + ) + + args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] + ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) + for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) + + request_arg = cst.Arg( + value=cst.Dict([ + cst.DictElement( + cst.SimpleString("'{}'".format(name)), +cst.Element(value=arg.value) + ) + # Note: the args + kwargs looks silly, but keep in mind that + # the control parameters had to be stripped out, and that + # those could have been passed positionally or by keyword. + for name, arg in zip(kword_params, args + kwargs)]), + keyword=cst.Name("request") + ) + + return updated.with_changes( + args=[request_arg] + ctrl_kwargs + ) + + +def fix_files( + in_dir: pathlib.Path, + out_dir: pathlib.Path, + *, + transformer=driveCallTransformer(), +): + """Duplicate the input dir to the output dir, fixing file method calls. + + Preconditions: + * in_dir is a real directory + * out_dir is a real, empty directory + """ + pyfile_gen = ( + pathlib.Path(os.path.join(root, f)) + for root, _, files in os.walk(in_dir) + for f in files if os.path.splitext(f)[1] == ".py" + ) + + for fpath in pyfile_gen: + with open(fpath, 'r') as f: + src = f.read() + + # Parse the code and insert method call fixes. + tree = cst.parse_module(src) + updated = tree.visit(transformer) + + # Create the path and directory structure for the new file. + updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) + updated_path.parent.mkdir(parents=True, exist_ok=True) + + # Generate the updated source file at the corresponding path. + with open(updated_path, 'w') as f: + f.write(updated.code) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser( + description="""Fix up source that uses the drive client library. + +The existing sources are NOT overwritten but are copied to output_dir with changes made. + +Note: This tool operates at a best-effort level at converting positional + parameters in client method calls to keyword based parameters. + Cases where it WILL FAIL include + A) * or ** expansion in a method call. + B) Calls via function or method alias (includes free function calls) + C) Indirect or dispatched calls (e.g. the method is looked up dynamically) + + These all constitute false negatives. The tool will also detect false + positives when an API method shares a name with another method. +""") + parser.add_argument( + '-d', + '--input-directory', + required=True, + dest='input_dir', + help='the input directory to walk for python files to fix up', + ) + parser.add_argument( + '-o', + '--output-directory', + required=True, + dest='output_dir', + help='the directory to output files fixed via un-flattening', + ) + args = parser.parse_args() + input_dir = pathlib.Path(args.input_dir) + output_dir = pathlib.Path(args.output_dir) + if not input_dir.is_dir(): + print( + f"input directory '{input_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if not output_dir.is_dir(): + print( + f"output directory '{output_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if os.listdir(output_dir): + print( + f"output directory '{output_dir}' is not empty", + file=sys.stderr, + ) + sys.exit(-1) + + fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/drive/drive-py/setup.py b/owl-bot-staging/google-apps-script-type/drive/drive-py/setup.py new file mode 100644 index 000000000000..c8bfbc06cc15 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive/drive-py/setup.py @@ -0,0 +1,91 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import io +import os + +import setuptools # type: ignore + +package_root = os.path.abspath(os.path.dirname(__file__)) + +name = 'google-apps-script-type-drive' + + +description = "Google Apps Script Type Drive API client library" + +version = {} +with open(os.path.join(package_root, 'google/apps/script/type/drive/gapic_version.py')) as fp: + exec(fp.read(), version) +version = version["__version__"] + +if version[0] == "0": + release_status = "Development Status :: 4 - Beta" +else: + release_status = "Development Status :: 5 - Production/Stable" + +dependencies = [ + "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", + "proto-plus >= 1.22.0, <2.0.0dev", + "proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'", + "protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", + "google-apps-script-type >= 0.2.0, <1.0.0dev", +] +url = "https://github.com/googleapis/python-apps-script-type-drive" + +package_root = os.path.abspath(os.path.dirname(__file__)) + +readme_filename = os.path.join(package_root, "README.rst") +with io.open(readme_filename, encoding="utf-8") as readme_file: + readme = readme_file.read() + +packages = [ + package + for package in setuptools.PEP420PackageFinder.find() + if package.startswith("google") +] + +namespaces = ["google", "google.apps", "google.apps.script", "google.apps.script.type"] + +setuptools.setup( + name=name, + version=version, + description=description, + long_description=readme, + author="Google LLC", + author_email="googleapis-packages@google.com", + license="Apache 2.0", + url=url, + classifiers=[ + release_status, + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Operating System :: OS Independent", + "Topic :: Internet", + ], + platforms="Posix; MacOS X; Windows", + packages=packages, + python_requires=">=3.7", + namespace_packages=namespaces, + install_requires=dependencies, + include_package_data=True, + zip_safe=False, +) diff --git a/owl-bot-staging/google-apps-script-type/drive/drive-py/testing/constraints-3.10.txt b/owl-bot-staging/google-apps-script-type/drive/drive-py/testing/constraints-3.10.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive/drive-py/testing/constraints-3.10.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/drive/drive-py/testing/constraints-3.11.txt b/owl-bot-staging/google-apps-script-type/drive/drive-py/testing/constraints-3.11.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive/drive-py/testing/constraints-3.11.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/drive/drive-py/testing/constraints-3.12.txt b/owl-bot-staging/google-apps-script-type/drive/drive-py/testing/constraints-3.12.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive/drive-py/testing/constraints-3.12.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/drive/drive-py/testing/constraints-3.7.txt b/owl-bot-staging/google-apps-script-type/drive/drive-py/testing/constraints-3.7.txt new file mode 100644 index 000000000000..4ae34ff40304 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive/drive-py/testing/constraints-3.7.txt @@ -0,0 +1,10 @@ +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file. +# Pin the version to the lower bound. +# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", +# Then this file should have google-cloud-foo==1.14.0 +google-api-core==1.34.0 +proto-plus==1.22.0 +protobuf==3.19.5 +google-apps-script-type==0.2.0 diff --git a/owl-bot-staging/google-apps-script-type/drive/drive-py/testing/constraints-3.8.txt b/owl-bot-staging/google-apps-script-type/drive/drive-py/testing/constraints-3.8.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive/drive-py/testing/constraints-3.8.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/drive/drive-py/testing/constraints-3.9.txt b/owl-bot-staging/google-apps-script-type/drive/drive-py/testing/constraints-3.9.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive/drive-py/testing/constraints-3.9.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/drive/drive-py/tests/__init__.py b/owl-bot-staging/google-apps-script-type/drive/drive-py/tests/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive/drive-py/tests/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/drive/drive-py/tests/unit/__init__.py b/owl-bot-staging/google-apps-script-type/drive/drive-py/tests/unit/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive/drive-py/tests/unit/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/drive/drive-py/tests/unit/gapic/__init__.py b/owl-bot-staging/google-apps-script-type/drive/drive-py/tests/unit/gapic/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive/drive-py/tests/unit/gapic/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/drive/drive-py/tests/unit/gapic/drive/__init__.py b/owl-bot-staging/google-apps-script-type/drive/drive-py/tests/unit/gapic/drive/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/drive/drive-py/tests/unit/gapic/drive/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/gmail/gmail-py/.coveragerc b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/.coveragerc new file mode 100644 index 000000000000..7a2aa0a8bb10 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/.coveragerc @@ -0,0 +1,13 @@ +[run] +branch = True + +[report] +show_missing = True +omit = + google/apps/script/type/gmail/__init__.py + google/apps/script/type/gmail/gapic_version.py +exclude_lines = + # Re-enable the standard pragma + pragma: NO COVER + # Ignore debug-only repr + def __repr__ diff --git a/owl-bot-staging/google-apps-script-type/gmail/gmail-py/.flake8 b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/.flake8 new file mode 100644 index 000000000000..29227d4cf419 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/.flake8 @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Generated by synthtool. DO NOT EDIT! +[flake8] +ignore = E203, E266, E501, W503 +exclude = + # Exclude generated code. + **/proto/** + **/gapic/** + **/services/** + **/types/** + *_pb2.py + + # Standard linting exemptions. + **/.nox/** + __pycache__, + .git, + *.pyc, + conf.py diff --git a/owl-bot-staging/google-apps-script-type/gmail/gmail-py/MANIFEST.in b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/MANIFEST.in new file mode 100644 index 000000000000..a7ee24e07f5d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/MANIFEST.in @@ -0,0 +1,2 @@ +recursive-include google/apps/script/type/gmail *.py +recursive-include google/apps/script/type/gmail *.py diff --git a/owl-bot-staging/google-apps-script-type/gmail/gmail-py/README.rst b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/README.rst new file mode 100644 index 000000000000..bb9177599c32 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/README.rst @@ -0,0 +1,49 @@ +Python Client for Google Apps Script Type Gmail API +================================================= + +Quick Start +----------- + +In order to use this library, you first need to go through the following steps: + +1. `Select or create a Cloud Platform project.`_ +2. `Enable billing for your project.`_ +3. Enable the Google Apps Script Type Gmail API. +4. `Setup Authentication.`_ + +.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project +.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project +.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html + +Installation +~~~~~~~~~~~~ + +Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to +create isolated Python environments. The basic problem it addresses is one of +dependencies and versions, and indirectly permissions. + +With `virtualenv`_, it's possible to install this library without needing system +install permissions, and without clashing with the installed system +dependencies. + +.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ + + +Mac/Linux +^^^^^^^^^ + +.. code-block:: console + + python3 -m venv + source /bin/activate + /bin/pip install /path/to/library + + +Windows +^^^^^^^ + +.. code-block:: console + + python3 -m venv + \Scripts\activate + \Scripts\pip.exe install \path\to\library diff --git a/owl-bot-staging/google-apps-script-type/gmail/gmail-py/docs/_static/custom.css b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/docs/_static/custom.css new file mode 100644 index 000000000000..06423be0b592 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/docs/_static/custom.css @@ -0,0 +1,3 @@ +dl.field-list > dt { + min-width: 100px +} diff --git a/owl-bot-staging/google-apps-script-type/gmail/gmail-py/docs/conf.py b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/docs/conf.py new file mode 100644 index 000000000000..cfa3bb39cc1e --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/docs/conf.py @@ -0,0 +1,376 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# google-apps-script-type-gmail documentation build configuration file +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys +import os +import shlex + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +sys.path.insert(0, os.path.abspath("..")) + +__version__ = "0.1.0" + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +needs_sphinx = "4.0.1" + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.intersphinx", + "sphinx.ext.coverage", + "sphinx.ext.napoleon", + "sphinx.ext.todo", + "sphinx.ext.viewcode", +] + +# autodoc/autosummary flags +autoclass_content = "both" +autodoc_default_flags = ["members"] +autosummary_generate = True + + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# Allow markdown includes (so releases.md can include CHANGLEOG.md) +# http://www.sphinx-doc.org/en/master/markdown.html +source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +source_suffix = [".rst", ".md"] + +# The encoding of source files. +# source_encoding = 'utf-8-sig' + +# The root toctree document. +root_doc = "index" + +# General information about the project. +project = u"google-apps-script-type-gmail" +copyright = u"2023, Google, LLC" +author = u"Google APIs" # TODO: autogenerate this bit + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The full version, including alpha/beta/rc tags. +release = __version__ +# The short X.Y version. +version = ".".join(release.split(".")[0:2]) + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = 'en' + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +# today = '' +# Else, today_fmt is used as the format for a strftime call. +# today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ["_build"] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +# default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +# add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +# add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +# show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = "sphinx" + +# A list of ignored prefixes for module index sorting. +# modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +# keep_warnings = False + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = True + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = "alabaster" + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +html_theme_options = { + "description": "Google Apps Script Type Client Libraries for Python", + "github_user": "googleapis", + "github_repo": "google-cloud-python", + "github_banner": True, + "font_family": "'Roboto', Georgia, sans", + "head_font_family": "'Roboto', Georgia, serif", + "code_font_family": "'Roboto Mono', 'Consolas', monospace", +} + +# Add any paths that contain custom themes here, relative to this directory. +# html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +# html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +# html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +# html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +# html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ["_static"] + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +# html_extra_path = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +# html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +# html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +# html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +# html_additional_pages = {} + +# If false, no module index is generated. +# html_domain_indices = True + +# If false, no index is generated. +# html_use_index = True + +# If true, the index is split into individual pages for each letter. +# html_split_index = False + +# If true, links to the reST sources are added to the pages. +# html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +# html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +# html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +# html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +# html_file_suffix = None + +# Language to be used for generating the HTML full-text search index. +# Sphinx supports the following languages: +# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' +# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' +# html_search_language = 'en' + +# A dictionary with options for the search language support, empty by default. +# Now only 'ja' uses this config value +# html_search_options = {'type': 'default'} + +# The name of a javascript file (relative to the configuration directory) that +# implements a search results scorer. If empty, the default will be used. +# html_search_scorer = 'scorer.js' + +# Output file base name for HTML help builder. +htmlhelp_basename = "google-apps-script-type-gmail-doc" + +# -- Options for warnings ------------------------------------------------------ + + +suppress_warnings = [ + # Temporarily suppress this to avoid "more than one target found for + # cross-reference" warning, which are intractable for us to avoid while in + # a mono-repo. + # See https://github.com/sphinx-doc/sphinx/blob + # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 + "ref.python" +] + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # 'papersize': 'letterpaper', + # The font size ('10pt', '11pt' or '12pt'). + # 'pointsize': '10pt', + # Additional stuff for the LaTeX preamble. + # 'preamble': '', + # Latex figure (float) alignment + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + ( + root_doc, + "google-apps-script-type-gmail.tex", + u"google-apps-script-type-gmail Documentation", + author, + "manual", + ) +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +# latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +# latex_use_parts = False + +# If true, show page references after internal links. +# latex_show_pagerefs = False + +# If true, show URL addresses after external links. +# latex_show_urls = False + +# Documents to append as an appendix to all manuals. +# latex_appendices = [] + +# If false, no module index is generated. +# latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ( + root_doc, + "google-apps-script-type-gmail", + u"Google Apps Script Type Gmail Documentation", + [author], + 1, + ) +] + +# If true, show URL addresses after external links. +# man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ( + root_doc, + "google-apps-script-type-gmail", + u"google-apps-script-type-gmail Documentation", + author, + "google-apps-script-type-gmail", + "GAPIC library for Google Apps Script Type Gmail API", + "APIs", + ) +] + +# Documents to append as an appendix to all manuals. +# texinfo_appendices = [] + +# If false, no module index is generated. +# texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +# texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +# texinfo_no_detailmenu = False + + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = { + "python": ("http://python.readthedocs.org/en/latest/", None), + "gax": ("https://gax-python.readthedocs.org/en/latest/", None), + "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), + "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), + "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None), + "grpc": ("https://grpc.io/grpc/python/", None), + "requests": ("http://requests.kennethreitz.org/en/stable/", None), + "proto": ("https://proto-plus-python.readthedocs.io/en/stable", None), + "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), +} + + +# Napoleon settings +napoleon_google_docstring = True +napoleon_numpy_docstring = True +napoleon_include_private_with_doc = False +napoleon_include_special_with_doc = True +napoleon_use_admonition_for_examples = False +napoleon_use_admonition_for_notes = False +napoleon_use_admonition_for_references = False +napoleon_use_ivar = False +napoleon_use_param = True +napoleon_use_rtype = True diff --git a/owl-bot-staging/google-apps-script-type/gmail/gmail-py/docs/gmail/services.rst b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/docs/gmail/services.rst new file mode 100644 index 000000000000..7df066840e3f --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/docs/gmail/services.rst @@ -0,0 +1,4 @@ +Services for Google Apps Script Type Gmail API +=============================================== +.. toctree:: + :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/gmail/gmail-py/docs/gmail/types.rst b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/docs/gmail/types.rst new file mode 100644 index 000000000000..bc0bef9f5807 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/docs/gmail/types.rst @@ -0,0 +1,6 @@ +Types for Google Apps Script Type Gmail API +============================================ + +.. automodule:: google.apps.script.type.gmail.types + :members: + :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/gmail/gmail-py/docs/index.rst b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/docs/index.rst new file mode 100644 index 000000000000..b27be2940c1b --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/docs/index.rst @@ -0,0 +1,7 @@ +API Reference +------------- +.. toctree:: + :maxdepth: 2 + + gmail/services + gmail/types diff --git a/owl-bot-staging/google-apps-script-type/gmail/gmail-py/google/apps/script/type/gmail/__init__.py b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/google/apps/script/type/gmail/__init__.py new file mode 100644 index 000000000000..d7365c75fa24 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/google/apps/script/type/gmail/__init__.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from google.apps.script.type.gmail import gapic_version as package_version + +__version__ = package_version.__version__ + + + +from .types.gmail_addon_manifest import ComposeTrigger +from .types.gmail_addon_manifest import ContextualTrigger +from .types.gmail_addon_manifest import GmailAddOnManifest +from .types.gmail_addon_manifest import UnconditionalTrigger +from .types.gmail_addon_manifest import UniversalAction + +__all__ = ( +'ComposeTrigger', +'ContextualTrigger', +'GmailAddOnManifest', +'UnconditionalTrigger', +'UniversalAction', +) diff --git a/owl-bot-staging/google-apps-script-type/gmail/gmail-py/google/apps/script/type/gmail/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/google/apps/script/type/gmail/gapic_metadata.json new file mode 100644 index 000000000000..7733a14a8ce4 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/google/apps/script/type/gmail/gapic_metadata.json @@ -0,0 +1,7 @@ + { + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "python", + "libraryPackage": "google.apps.script.type.gmail", + "protoPackage": "google.apps.script.type.gmail", + "schema": "1.0" +} diff --git a/owl-bot-staging/google-apps-script-type/gmail/gmail-py/google/apps/script/type/gmail/gapic_version.py b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/google/apps/script/type/gmail/gapic_version.py new file mode 100644 index 000000000000..360a0d13ebdd --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/google/apps/script/type/gmail/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/gmail/gmail-py/google/apps/script/type/gmail/py.typed b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/google/apps/script/type/gmail/py.typed new file mode 100644 index 000000000000..0906e16feda1 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/google/apps/script/type/gmail/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-apps-script-type-gmail package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/gmail/gmail-py/google/apps/script/type/gmail/services/__init__.py b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/google/apps/script/type/gmail/services/__init__.py new file mode 100644 index 000000000000..89a37dc92c5a --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/google/apps/script/type/gmail/services/__init__.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/gmail/gmail-py/google/apps/script/type/gmail/types/__init__.py b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/google/apps/script/type/gmail/types/__init__.py new file mode 100644 index 000000000000..3cc8dd5e9376 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/google/apps/script/type/gmail/types/__init__.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from .gmail_addon_manifest import ( + ComposeTrigger, + ContextualTrigger, + GmailAddOnManifest, + UnconditionalTrigger, + UniversalAction, +) + +__all__ = ( + 'ComposeTrigger', + 'ContextualTrigger', + 'GmailAddOnManifest', + 'UnconditionalTrigger', + 'UniversalAction', +) diff --git a/owl-bot-staging/google-apps-script-type/gmail/gmail-py/google/apps/script/type/gmail/types/gmail_addon_manifest.py b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/google/apps/script/type/gmail/types/gmail_addon_manifest.py new file mode 100644 index 000000000000..e1164e06eb83 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/google/apps/script/type/gmail/types/gmail_addon_manifest.py @@ -0,0 +1,232 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.apps.script.type.types import extension_point + + +__protobuf__ = proto.module( + package='google.apps.script.type.gmail', + manifest={ + 'GmailAddOnManifest', + 'UniversalAction', + 'ComposeTrigger', + 'ContextualTrigger', + 'UnconditionalTrigger', + }, +) + + +class GmailAddOnManifest(proto.Message): + r"""Properties customizing the appearance and execution of a + Gmail add-on. + + Attributes: + homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): + Defines an endpoint that will be executed in contexts that + don't match a declared contextual trigger. Any cards + generated by this function will always be available to the + user, but may be eclipsed by contextual content when this + add-on declares more targeted triggers. + + If present, this overrides the configuration from + ``addOns.common.homepageTrigger``. + contextual_triggers (MutableSequence[google.apps.script.type.gmail.types.ContextualTrigger]): + Defines the set of conditions that trigger + the add-on. + universal_actions (MutableSequence[google.apps.script.type.gmail.types.UniversalAction]): + Defines set of `universal + actions `__ for + the add-on. The user triggers universal actions from the + add-on toolbar menu. + compose_trigger (google.apps.script.type.gmail.types.ComposeTrigger): + Defines the compose time trigger for a + compose time add-on. This is the trigger that + causes an add-on to take action when the user is + composing an email. + All compose time addons are required to have the + gmail.addons.current.action.compose scope even + though it might not edit the draft. + authorization_check_function (str): + The name of an endpoint that verifies that + the add-on has all the required third-party + authorizations, by probing the third-party APIs. + If the probe fails, the function should throw an + exception to initiate the authorization flow. + This function is called before each invocation + of the add-on, in order to ensure a smooth user + experience. + """ + + homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( + proto.MESSAGE, + number=14, + message=extension_point.HomepageExtensionPoint, + ) + contextual_triggers: MutableSequence['ContextualTrigger'] = proto.RepeatedField( + proto.MESSAGE, + number=3, + message='ContextualTrigger', + ) + universal_actions: MutableSequence['UniversalAction'] = proto.RepeatedField( + proto.MESSAGE, + number=4, + message='UniversalAction', + ) + compose_trigger: 'ComposeTrigger' = proto.Field( + proto.MESSAGE, + number=12, + message='ComposeTrigger', + ) + authorization_check_function: str = proto.Field( + proto.STRING, + number=7, + ) + + +class UniversalAction(proto.Message): + r"""An action that is always available in the add-on toolbar menu + regardless of message context. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + text (str): + Required. User-visible text describing the + action, for example, "Add a new contact.". + open_link (str): + A link that is opened by Gmail when the user + triggers the action. + + This field is a member of `oneof`_ ``action_type``. + run_function (str): + An endpoint that is called when the user triggers the + action. See the `universal actions + guide `__ for + details. + + This field is a member of `oneof`_ ``action_type``. + """ + + text: str = proto.Field( + proto.STRING, + number=1, + ) + open_link: str = proto.Field( + proto.STRING, + number=2, + oneof='action_type', + ) + run_function: str = proto.Field( + proto.STRING, + number=3, + oneof='action_type', + ) + + +class ComposeTrigger(proto.Message): + r"""A trigger that activates when user is composing an email. + + Attributes: + actions (MutableSequence[google.apps.script.type.types.MenuItemExtensionPoint]): + Defines the set of actions for compose time + add-on. These are actions that user can trigger + on a compose time addon. + draft_access (google.apps.script.type.gmail.types.ComposeTrigger.DraftAccess): + Define the level of data access when a + compose time addon is triggered. + """ + class DraftAccess(proto.Enum): + r"""An enum defining the level of data access this compose + trigger requires. + + Values: + UNSPECIFIED (0): + Default value when nothing is set for + DraftAccess. + NONE (1): + NONE means compose trigger won't be able to + access any data of the draft when a compose + addon is triggered. + METADATA (2): + METADATA gives compose trigger the permission + to access the metadata of the draft when a + compose addon is triggered. This includes the + audience list (To/cc list) of a draft message. + """ + UNSPECIFIED = 0 + NONE = 1 + METADATA = 2 + + actions: MutableSequence[extension_point.MenuItemExtensionPoint] = proto.RepeatedField( + proto.MESSAGE, + number=5, + message=extension_point.MenuItemExtensionPoint, + ) + draft_access: DraftAccess = proto.Field( + proto.ENUM, + number=4, + enum=DraftAccess, + ) + + +class ContextualTrigger(proto.Message): + r"""Defines a trigger that fires when the open email meets a + specific criteria. When the trigger fires, it executes a + specific endpoint, usually in order to create new cards and + update the UI. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + unconditional (google.apps.script.type.gmail.types.UnconditionalTrigger): + UnconditionalTriggers are executed when any + mail message is opened. + + This field is a member of `oneof`_ ``trigger``. + on_trigger_function (str): + Required. The name of the endpoint to call + when a message matches the trigger. + """ + + unconditional: 'UnconditionalTrigger' = proto.Field( + proto.MESSAGE, + number=1, + oneof='trigger', + message='UnconditionalTrigger', + ) + on_trigger_function: str = proto.Field( + proto.STRING, + number=4, + ) + + +class UnconditionalTrigger(proto.Message): + r"""A trigger that fires when any email message is opened. + """ + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/gmail/gmail-py/mypy.ini b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/mypy.ini new file mode 100644 index 000000000000..574c5aed394b --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/mypy.ini @@ -0,0 +1,3 @@ +[mypy] +python_version = 3.7 +namespace_packages = True diff --git a/owl-bot-staging/google-apps-script-type/gmail/gmail-py/noxfile.py b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/noxfile.py new file mode 100644 index 000000000000..68b59563e3eb --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/noxfile.py @@ -0,0 +1,184 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import os +import pathlib +import shutil +import subprocess +import sys + + +import nox # type: ignore + +ALL_PYTHON = [ + "3.7", + "3.8", + "3.9", + "3.10", + "3.11", +] + +CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() + +LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt" +PACKAGE_NAME = subprocess.check_output([sys.executable, "setup.py", "--name"], encoding="utf-8") + +BLACK_VERSION = "black==22.3.0" +BLACK_PATHS = ["docs", "google", "tests", "samples", "noxfile.py", "setup.py"] +DEFAULT_PYTHON_VERSION = "3.11" + +nox.sessions = [ + "unit", + "cover", + "mypy", + "check_lower_bounds" + # exclude update_lower_bounds from default + "docs", + "blacken", + "lint", + "lint_setup_py", +] + +@nox.session(python=ALL_PYTHON) +def unit(session): + """Run the unit test suite.""" + + session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') + session.install('-e', '.') + + session.run( + 'py.test', + '--quiet', + '--cov=google/apps/script/type/gmail/', + '--cov=tests/', + '--cov-config=.coveragerc', + '--cov-report=term', + '--cov-report=html', + os.path.join('tests', 'unit', ''.join(session.posargs)) + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def cover(session): + """Run the final coverage report. + This outputs the coverage report aggregating coverage from the unit + test runs (not system test runs), and then erases coverage data. + """ + session.install("coverage", "pytest-cov") + session.run("coverage", "report", "--show-missing", "--fail-under=100") + + session.run("coverage", "erase") + + +@nox.session(python=ALL_PYTHON) +def mypy(session): + """Run the type checker.""" + session.install( + 'mypy', + 'types-requests', + 'types-protobuf' + ) + session.install('.') + session.run( + 'mypy', + '--explicit-package-bases', + 'google', + ) + + +@nox.session +def update_lower_bounds(session): + """Update lower bounds in constraints.txt to match setup.py""" + session.install('google-cloud-testutils') + session.install('.') + + session.run( + 'lower-bound-checker', + 'update', + '--package-name', + PACKAGE_NAME, + '--constraints-file', + str(LOWER_BOUND_CONSTRAINTS_FILE), + ) + + +@nox.session +def check_lower_bounds(session): + """Check lower bounds in setup.py are reflected in constraints file""" + session.install('google-cloud-testutils') + session.install('.') + + session.run( + 'lower-bound-checker', + 'check', + '--package-name', + PACKAGE_NAME, + '--constraints-file', + str(LOWER_BOUND_CONSTRAINTS_FILE), + ) + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def docs(session): + """Build the docs for this library.""" + + session.install("-e", ".") + session.install("sphinx==7.0.1", "alabaster", "recommonmark") + + shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) + session.run( + "sphinx-build", + "-W", # warnings as errors + "-T", # show full traceback on exception + "-N", # no colors + "-b", + "html", + "-d", + os.path.join("docs", "_build", "doctrees", ""), + os.path.join("docs", ""), + os.path.join("docs", "_build", "html", ""), + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def lint(session): + """Run linters. + + Returns a failure if the linters find linting errors or sufficiently + serious code quality issues. + """ + session.install("flake8", BLACK_VERSION) + session.run( + "black", + "--check", + *BLACK_PATHS, + ) + session.run("flake8", "google", "tests", "samples") + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def blacken(session): + """Run black. Format code to uniform standard.""" + session.install(BLACK_VERSION) + session.run( + "black", + *BLACK_PATHS, + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def lint_setup_py(session): + """Verify that setup.py is valid (including RST check).""" + session.install("docutils", "pygments") + session.run("python", "setup.py", "check", "--restructuredtext", "--strict") diff --git a/owl-bot-staging/google-apps-script-type/gmail/gmail-py/scripts/fixup_gmail_keywords.py b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/scripts/fixup_gmail_keywords.py new file mode 100644 index 000000000000..c9dad594e8de --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/scripts/fixup_gmail_keywords.py @@ -0,0 +1,175 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import argparse +import os +import libcst as cst +import pathlib +import sys +from typing import (Any, Callable, Dict, List, Sequence, Tuple) + + +def partition( + predicate: Callable[[Any], bool], + iterator: Sequence[Any] +) -> Tuple[List[Any], List[Any]]: + """A stable, out-of-place partition.""" + results = ([], []) + + for i in iterator: + results[int(predicate(i))].append(i) + + # Returns trueList, falseList + return results[1], results[0] + + +class gmailCallTransformer(cst.CSTTransformer): + CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') + METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { + } + + def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: + try: + key = original.func.attr.value + kword_params = self.METHOD_TO_PARAMS[key] + except (AttributeError, KeyError): + # Either not a method from the API or too convoluted to be sure. + return updated + + # If the existing code is valid, keyword args come after positional args. + # Therefore, all positional args must map to the first parameters. + args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) + if any(k.keyword.value == "request" for k in kwargs): + # We've already fixed this file, don't fix it again. + return updated + + kwargs, ctrl_kwargs = partition( + lambda a: a.keyword.value not in self.CTRL_PARAMS, + kwargs + ) + + args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] + ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) + for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) + + request_arg = cst.Arg( + value=cst.Dict([ + cst.DictElement( + cst.SimpleString("'{}'".format(name)), +cst.Element(value=arg.value) + ) + # Note: the args + kwargs looks silly, but keep in mind that + # the control parameters had to be stripped out, and that + # those could have been passed positionally or by keyword. + for name, arg in zip(kword_params, args + kwargs)]), + keyword=cst.Name("request") + ) + + return updated.with_changes( + args=[request_arg] + ctrl_kwargs + ) + + +def fix_files( + in_dir: pathlib.Path, + out_dir: pathlib.Path, + *, + transformer=gmailCallTransformer(), +): + """Duplicate the input dir to the output dir, fixing file method calls. + + Preconditions: + * in_dir is a real directory + * out_dir is a real, empty directory + """ + pyfile_gen = ( + pathlib.Path(os.path.join(root, f)) + for root, _, files in os.walk(in_dir) + for f in files if os.path.splitext(f)[1] == ".py" + ) + + for fpath in pyfile_gen: + with open(fpath, 'r') as f: + src = f.read() + + # Parse the code and insert method call fixes. + tree = cst.parse_module(src) + updated = tree.visit(transformer) + + # Create the path and directory structure for the new file. + updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) + updated_path.parent.mkdir(parents=True, exist_ok=True) + + # Generate the updated source file at the corresponding path. + with open(updated_path, 'w') as f: + f.write(updated.code) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser( + description="""Fix up source that uses the gmail client library. + +The existing sources are NOT overwritten but are copied to output_dir with changes made. + +Note: This tool operates at a best-effort level at converting positional + parameters in client method calls to keyword based parameters. + Cases where it WILL FAIL include + A) * or ** expansion in a method call. + B) Calls via function or method alias (includes free function calls) + C) Indirect or dispatched calls (e.g. the method is looked up dynamically) + + These all constitute false negatives. The tool will also detect false + positives when an API method shares a name with another method. +""") + parser.add_argument( + '-d', + '--input-directory', + required=True, + dest='input_dir', + help='the input directory to walk for python files to fix up', + ) + parser.add_argument( + '-o', + '--output-directory', + required=True, + dest='output_dir', + help='the directory to output files fixed via un-flattening', + ) + args = parser.parse_args() + input_dir = pathlib.Path(args.input_dir) + output_dir = pathlib.Path(args.output_dir) + if not input_dir.is_dir(): + print( + f"input directory '{input_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if not output_dir.is_dir(): + print( + f"output directory '{output_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if os.listdir(output_dir): + print( + f"output directory '{output_dir}' is not empty", + file=sys.stderr, + ) + sys.exit(-1) + + fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/gmail/gmail-py/setup.py b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/setup.py new file mode 100644 index 000000000000..b13fa892e216 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/setup.py @@ -0,0 +1,91 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import io +import os + +import setuptools # type: ignore + +package_root = os.path.abspath(os.path.dirname(__file__)) + +name = 'google-apps-script-type-gmail' + + +description = "Google Apps Script Type Gmail API client library" + +version = {} +with open(os.path.join(package_root, 'google/apps/script/type/gmail/gapic_version.py')) as fp: + exec(fp.read(), version) +version = version["__version__"] + +if version[0] == "0": + release_status = "Development Status :: 4 - Beta" +else: + release_status = "Development Status :: 5 - Production/Stable" + +dependencies = [ + "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", + "proto-plus >= 1.22.0, <2.0.0dev", + "proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'", + "protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", + "google-apps-script-type >= 0.2.0, <1.0.0dev", +] +url = "https://github.com/googleapis/python-apps-script-type-gmail" + +package_root = os.path.abspath(os.path.dirname(__file__)) + +readme_filename = os.path.join(package_root, "README.rst") +with io.open(readme_filename, encoding="utf-8") as readme_file: + readme = readme_file.read() + +packages = [ + package + for package in setuptools.PEP420PackageFinder.find() + if package.startswith("google") +] + +namespaces = ["google", "google.apps", "google.apps.script", "google.apps.script.type"] + +setuptools.setup( + name=name, + version=version, + description=description, + long_description=readme, + author="Google LLC", + author_email="googleapis-packages@google.com", + license="Apache 2.0", + url=url, + classifiers=[ + release_status, + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Operating System :: OS Independent", + "Topic :: Internet", + ], + platforms="Posix; MacOS X; Windows", + packages=packages, + python_requires=">=3.7", + namespace_packages=namespaces, + install_requires=dependencies, + include_package_data=True, + zip_safe=False, +) diff --git a/owl-bot-staging/google-apps-script-type/gmail/gmail-py/testing/constraints-3.10.txt b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/testing/constraints-3.10.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/testing/constraints-3.10.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/gmail/gmail-py/testing/constraints-3.11.txt b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/testing/constraints-3.11.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/testing/constraints-3.11.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/gmail/gmail-py/testing/constraints-3.12.txt b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/testing/constraints-3.12.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/testing/constraints-3.12.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/gmail/gmail-py/testing/constraints-3.7.txt b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/testing/constraints-3.7.txt new file mode 100644 index 000000000000..4ae34ff40304 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/testing/constraints-3.7.txt @@ -0,0 +1,10 @@ +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file. +# Pin the version to the lower bound. +# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", +# Then this file should have google-cloud-foo==1.14.0 +google-api-core==1.34.0 +proto-plus==1.22.0 +protobuf==3.19.5 +google-apps-script-type==0.2.0 diff --git a/owl-bot-staging/google-apps-script-type/gmail/gmail-py/testing/constraints-3.8.txt b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/testing/constraints-3.8.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/testing/constraints-3.8.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/gmail/gmail-py/testing/constraints-3.9.txt b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/testing/constraints-3.9.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/testing/constraints-3.9.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/gmail/gmail-py/tests/__init__.py b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/tests/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/tests/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/gmail/gmail-py/tests/unit/__init__.py b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/tests/unit/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/tests/unit/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/gmail/gmail-py/tests/unit/gapic/__init__.py b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/tests/unit/gapic/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/tests/unit/gapic/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/gmail/gmail-py/tests/unit/gapic/gmail/__init__.py b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/tests/unit/gapic/gmail/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/gmail/gmail-py/tests/unit/gapic/gmail/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/sheets/sheets-py/.coveragerc b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/.coveragerc new file mode 100644 index 000000000000..718f27f1463e --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/.coveragerc @@ -0,0 +1,13 @@ +[run] +branch = True + +[report] +show_missing = True +omit = + google/apps/script/type/sheets/__init__.py + google/apps/script/type/sheets/gapic_version.py +exclude_lines = + # Re-enable the standard pragma + pragma: NO COVER + # Ignore debug-only repr + def __repr__ diff --git a/owl-bot-staging/google-apps-script-type/sheets/sheets-py/.flake8 b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/.flake8 new file mode 100644 index 000000000000..29227d4cf419 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/.flake8 @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Generated by synthtool. DO NOT EDIT! +[flake8] +ignore = E203, E266, E501, W503 +exclude = + # Exclude generated code. + **/proto/** + **/gapic/** + **/services/** + **/types/** + *_pb2.py + + # Standard linting exemptions. + **/.nox/** + __pycache__, + .git, + *.pyc, + conf.py diff --git a/owl-bot-staging/google-apps-script-type/sheets/sheets-py/MANIFEST.in b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/MANIFEST.in new file mode 100644 index 000000000000..fb187de1bffd --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/MANIFEST.in @@ -0,0 +1,2 @@ +recursive-include google/apps/script/type/sheets *.py +recursive-include google/apps/script/type/sheets *.py diff --git a/owl-bot-staging/google-apps-script-type/sheets/sheets-py/README.rst b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/README.rst new file mode 100644 index 000000000000..2e72a247fb1d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/README.rst @@ -0,0 +1,49 @@ +Python Client for Google Apps Script Type Sheets API +================================================= + +Quick Start +----------- + +In order to use this library, you first need to go through the following steps: + +1. `Select or create a Cloud Platform project.`_ +2. `Enable billing for your project.`_ +3. Enable the Google Apps Script Type Sheets API. +4. `Setup Authentication.`_ + +.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project +.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project +.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html + +Installation +~~~~~~~~~~~~ + +Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to +create isolated Python environments. The basic problem it addresses is one of +dependencies and versions, and indirectly permissions. + +With `virtualenv`_, it's possible to install this library without needing system +install permissions, and without clashing with the installed system +dependencies. + +.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ + + +Mac/Linux +^^^^^^^^^ + +.. code-block:: console + + python3 -m venv + source /bin/activate + /bin/pip install /path/to/library + + +Windows +^^^^^^^ + +.. code-block:: console + + python3 -m venv + \Scripts\activate + \Scripts\pip.exe install \path\to\library diff --git a/owl-bot-staging/google-apps-script-type/sheets/sheets-py/docs/_static/custom.css b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/docs/_static/custom.css new file mode 100644 index 000000000000..06423be0b592 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/docs/_static/custom.css @@ -0,0 +1,3 @@ +dl.field-list > dt { + min-width: 100px +} diff --git a/owl-bot-staging/google-apps-script-type/sheets/sheets-py/docs/conf.py b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/docs/conf.py new file mode 100644 index 000000000000..cfb4e8801708 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/docs/conf.py @@ -0,0 +1,376 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# google-apps-script-type-sheets documentation build configuration file +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys +import os +import shlex + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +sys.path.insert(0, os.path.abspath("..")) + +__version__ = "0.1.0" + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +needs_sphinx = "4.0.1" + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.intersphinx", + "sphinx.ext.coverage", + "sphinx.ext.napoleon", + "sphinx.ext.todo", + "sphinx.ext.viewcode", +] + +# autodoc/autosummary flags +autoclass_content = "both" +autodoc_default_flags = ["members"] +autosummary_generate = True + + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# Allow markdown includes (so releases.md can include CHANGLEOG.md) +# http://www.sphinx-doc.org/en/master/markdown.html +source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +source_suffix = [".rst", ".md"] + +# The encoding of source files. +# source_encoding = 'utf-8-sig' + +# The root toctree document. +root_doc = "index" + +# General information about the project. +project = u"google-apps-script-type-sheets" +copyright = u"2023, Google, LLC" +author = u"Google APIs" # TODO: autogenerate this bit + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The full version, including alpha/beta/rc tags. +release = __version__ +# The short X.Y version. +version = ".".join(release.split(".")[0:2]) + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = 'en' + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +# today = '' +# Else, today_fmt is used as the format for a strftime call. +# today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ["_build"] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +# default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +# add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +# add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +# show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = "sphinx" + +# A list of ignored prefixes for module index sorting. +# modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +# keep_warnings = False + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = True + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = "alabaster" + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +html_theme_options = { + "description": "Google Apps Script Type Client Libraries for Python", + "github_user": "googleapis", + "github_repo": "google-cloud-python", + "github_banner": True, + "font_family": "'Roboto', Georgia, sans", + "head_font_family": "'Roboto', Georgia, serif", + "code_font_family": "'Roboto Mono', 'Consolas', monospace", +} + +# Add any paths that contain custom themes here, relative to this directory. +# html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +# html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +# html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +# html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +# html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ["_static"] + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +# html_extra_path = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +# html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +# html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +# html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +# html_additional_pages = {} + +# If false, no module index is generated. +# html_domain_indices = True + +# If false, no index is generated. +# html_use_index = True + +# If true, the index is split into individual pages for each letter. +# html_split_index = False + +# If true, links to the reST sources are added to the pages. +# html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +# html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +# html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +# html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +# html_file_suffix = None + +# Language to be used for generating the HTML full-text search index. +# Sphinx supports the following languages: +# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' +# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' +# html_search_language = 'en' + +# A dictionary with options for the search language support, empty by default. +# Now only 'ja' uses this config value +# html_search_options = {'type': 'default'} + +# The name of a javascript file (relative to the configuration directory) that +# implements a search results scorer. If empty, the default will be used. +# html_search_scorer = 'scorer.js' + +# Output file base name for HTML help builder. +htmlhelp_basename = "google-apps-script-type-sheets-doc" + +# -- Options for warnings ------------------------------------------------------ + + +suppress_warnings = [ + # Temporarily suppress this to avoid "more than one target found for + # cross-reference" warning, which are intractable for us to avoid while in + # a mono-repo. + # See https://github.com/sphinx-doc/sphinx/blob + # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 + "ref.python" +] + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # 'papersize': 'letterpaper', + # The font size ('10pt', '11pt' or '12pt'). + # 'pointsize': '10pt', + # Additional stuff for the LaTeX preamble. + # 'preamble': '', + # Latex figure (float) alignment + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + ( + root_doc, + "google-apps-script-type-sheets.tex", + u"google-apps-script-type-sheets Documentation", + author, + "manual", + ) +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +# latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +# latex_use_parts = False + +# If true, show page references after internal links. +# latex_show_pagerefs = False + +# If true, show URL addresses after external links. +# latex_show_urls = False + +# Documents to append as an appendix to all manuals. +# latex_appendices = [] + +# If false, no module index is generated. +# latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ( + root_doc, + "google-apps-script-type-sheets", + u"Google Apps Script Type Sheets Documentation", + [author], + 1, + ) +] + +# If true, show URL addresses after external links. +# man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ( + root_doc, + "google-apps-script-type-sheets", + u"google-apps-script-type-sheets Documentation", + author, + "google-apps-script-type-sheets", + "GAPIC library for Google Apps Script Type Sheets API", + "APIs", + ) +] + +# Documents to append as an appendix to all manuals. +# texinfo_appendices = [] + +# If false, no module index is generated. +# texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +# texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +# texinfo_no_detailmenu = False + + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = { + "python": ("http://python.readthedocs.org/en/latest/", None), + "gax": ("https://gax-python.readthedocs.org/en/latest/", None), + "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), + "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), + "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None), + "grpc": ("https://grpc.io/grpc/python/", None), + "requests": ("http://requests.kennethreitz.org/en/stable/", None), + "proto": ("https://proto-plus-python.readthedocs.io/en/stable", None), + "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), +} + + +# Napoleon settings +napoleon_google_docstring = True +napoleon_numpy_docstring = True +napoleon_include_private_with_doc = False +napoleon_include_special_with_doc = True +napoleon_use_admonition_for_examples = False +napoleon_use_admonition_for_notes = False +napoleon_use_admonition_for_references = False +napoleon_use_ivar = False +napoleon_use_param = True +napoleon_use_rtype = True diff --git a/owl-bot-staging/google-apps-script-type/sheets/sheets-py/docs/index.rst b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/docs/index.rst new file mode 100644 index 000000000000..74fe36dec4e5 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/docs/index.rst @@ -0,0 +1,7 @@ +API Reference +------------- +.. toctree:: + :maxdepth: 2 + + sheets/services + sheets/types diff --git a/owl-bot-staging/google-apps-script-type/sheets/sheets-py/docs/sheets/services.rst b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/docs/sheets/services.rst new file mode 100644 index 000000000000..8015dea9d07c --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/docs/sheets/services.rst @@ -0,0 +1,4 @@ +Services for Google Apps Script Type Sheets API +================================================ +.. toctree:: + :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/sheets/sheets-py/docs/sheets/types.rst b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/docs/sheets/types.rst new file mode 100644 index 000000000000..299268839314 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/docs/sheets/types.rst @@ -0,0 +1,6 @@ +Types for Google Apps Script Type Sheets API +============================================= + +.. automodule:: google.apps.script.type.sheets.types + :members: + :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/sheets/sheets-py/google/apps/script/type/sheets/__init__.py b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/google/apps/script/type/sheets/__init__.py new file mode 100644 index 000000000000..4188159ee265 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/google/apps/script/type/sheets/__init__.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from google.apps.script.type.sheets import gapic_version as package_version + +__version__ = package_version.__version__ + + + +from .types.sheets_addon_manifest import SheetsAddOnManifest +from .types.sheets_addon_manifest import SheetsExtensionPoint + +__all__ = ( +'SheetsAddOnManifest', +'SheetsExtensionPoint', +) diff --git a/owl-bot-staging/google-apps-script-type/sheets/sheets-py/google/apps/script/type/sheets/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/google/apps/script/type/sheets/gapic_metadata.json new file mode 100644 index 000000000000..f43947aa567d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/google/apps/script/type/sheets/gapic_metadata.json @@ -0,0 +1,7 @@ + { + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "python", + "libraryPackage": "google.apps.script.type.sheets", + "protoPackage": "google.apps.script.type.sheets", + "schema": "1.0" +} diff --git a/owl-bot-staging/google-apps-script-type/sheets/sheets-py/google/apps/script/type/sheets/gapic_version.py b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/google/apps/script/type/sheets/gapic_version.py new file mode 100644 index 000000000000..360a0d13ebdd --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/google/apps/script/type/sheets/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/sheets/sheets-py/google/apps/script/type/sheets/py.typed b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/google/apps/script/type/sheets/py.typed new file mode 100644 index 000000000000..4744d49c1dd6 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/google/apps/script/type/sheets/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-apps-script-type-sheets package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/sheets/sheets-py/google/apps/script/type/sheets/services/__init__.py b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/google/apps/script/type/sheets/services/__init__.py new file mode 100644 index 000000000000..89a37dc92c5a --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/google/apps/script/type/sheets/services/__init__.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/sheets/sheets-py/google/apps/script/type/sheets/types/__init__.py b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/google/apps/script/type/sheets/types/__init__.py new file mode 100644 index 000000000000..3ac5fa0d29c1 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/google/apps/script/type/sheets/types/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from .sheets_addon_manifest import ( + SheetsAddOnManifest, + SheetsExtensionPoint, +) + +__all__ = ( + 'SheetsAddOnManifest', + 'SheetsExtensionPoint', +) diff --git a/owl-bot-staging/google-apps-script-type/sheets/sheets-py/google/apps/script/type/sheets/types/sheets_addon_manifest.py b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/google/apps/script/type/sheets/types/sheets_addon_manifest.py new file mode 100644 index 000000000000..68313b777f64 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/google/apps/script/type/sheets/types/sheets_addon_manifest.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.apps.script.type.types import extension_point + + +__protobuf__ = proto.module( + package='google.apps.script.type.sheets', + manifest={ + 'SheetsAddOnManifest', + 'SheetsExtensionPoint', + }, +) + + +class SheetsAddOnManifest(proto.Message): + r"""Sheets add-on manifest. + + Attributes: + homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): + If present, this overrides the configuration from + ``addOns.common.homepageTrigger``. + on_file_scope_granted_trigger (google.apps.script.type.sheets.types.SheetsExtensionPoint): + Endpoint to execute when file scope + authorization is granted for this document/user + pair. + """ + + homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( + proto.MESSAGE, + number=3, + message=extension_point.HomepageExtensionPoint, + ) + on_file_scope_granted_trigger: 'SheetsExtensionPoint' = proto.Field( + proto.MESSAGE, + number=5, + message='SheetsExtensionPoint', + ) + + +class SheetsExtensionPoint(proto.Message): + r"""Common format for declaring a Sheets add-on's triggers. + + Attributes: + run_function (str): + Required. The endpoint to execute when this + extension point is activated. + """ + + run_function: str = proto.Field( + proto.STRING, + number=1, + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/sheets/sheets-py/mypy.ini b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/mypy.ini new file mode 100644 index 000000000000..574c5aed394b --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/mypy.ini @@ -0,0 +1,3 @@ +[mypy] +python_version = 3.7 +namespace_packages = True diff --git a/owl-bot-staging/google-apps-script-type/sheets/sheets-py/noxfile.py b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/noxfile.py new file mode 100644 index 000000000000..ec182b7773d0 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/noxfile.py @@ -0,0 +1,184 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import os +import pathlib +import shutil +import subprocess +import sys + + +import nox # type: ignore + +ALL_PYTHON = [ + "3.7", + "3.8", + "3.9", + "3.10", + "3.11", +] + +CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() + +LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt" +PACKAGE_NAME = subprocess.check_output([sys.executable, "setup.py", "--name"], encoding="utf-8") + +BLACK_VERSION = "black==22.3.0" +BLACK_PATHS = ["docs", "google", "tests", "samples", "noxfile.py", "setup.py"] +DEFAULT_PYTHON_VERSION = "3.11" + +nox.sessions = [ + "unit", + "cover", + "mypy", + "check_lower_bounds" + # exclude update_lower_bounds from default + "docs", + "blacken", + "lint", + "lint_setup_py", +] + +@nox.session(python=ALL_PYTHON) +def unit(session): + """Run the unit test suite.""" + + session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') + session.install('-e', '.') + + session.run( + 'py.test', + '--quiet', + '--cov=google/apps/script/type/sheets/', + '--cov=tests/', + '--cov-config=.coveragerc', + '--cov-report=term', + '--cov-report=html', + os.path.join('tests', 'unit', ''.join(session.posargs)) + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def cover(session): + """Run the final coverage report. + This outputs the coverage report aggregating coverage from the unit + test runs (not system test runs), and then erases coverage data. + """ + session.install("coverage", "pytest-cov") + session.run("coverage", "report", "--show-missing", "--fail-under=100") + + session.run("coverage", "erase") + + +@nox.session(python=ALL_PYTHON) +def mypy(session): + """Run the type checker.""" + session.install( + 'mypy', + 'types-requests', + 'types-protobuf' + ) + session.install('.') + session.run( + 'mypy', + '--explicit-package-bases', + 'google', + ) + + +@nox.session +def update_lower_bounds(session): + """Update lower bounds in constraints.txt to match setup.py""" + session.install('google-cloud-testutils') + session.install('.') + + session.run( + 'lower-bound-checker', + 'update', + '--package-name', + PACKAGE_NAME, + '--constraints-file', + str(LOWER_BOUND_CONSTRAINTS_FILE), + ) + + +@nox.session +def check_lower_bounds(session): + """Check lower bounds in setup.py are reflected in constraints file""" + session.install('google-cloud-testutils') + session.install('.') + + session.run( + 'lower-bound-checker', + 'check', + '--package-name', + PACKAGE_NAME, + '--constraints-file', + str(LOWER_BOUND_CONSTRAINTS_FILE), + ) + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def docs(session): + """Build the docs for this library.""" + + session.install("-e", ".") + session.install("sphinx==7.0.1", "alabaster", "recommonmark") + + shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) + session.run( + "sphinx-build", + "-W", # warnings as errors + "-T", # show full traceback on exception + "-N", # no colors + "-b", + "html", + "-d", + os.path.join("docs", "_build", "doctrees", ""), + os.path.join("docs", ""), + os.path.join("docs", "_build", "html", ""), + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def lint(session): + """Run linters. + + Returns a failure if the linters find linting errors or sufficiently + serious code quality issues. + """ + session.install("flake8", BLACK_VERSION) + session.run( + "black", + "--check", + *BLACK_PATHS, + ) + session.run("flake8", "google", "tests", "samples") + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def blacken(session): + """Run black. Format code to uniform standard.""" + session.install(BLACK_VERSION) + session.run( + "black", + *BLACK_PATHS, + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def lint_setup_py(session): + """Verify that setup.py is valid (including RST check).""" + session.install("docutils", "pygments") + session.run("python", "setup.py", "check", "--restructuredtext", "--strict") diff --git a/owl-bot-staging/google-apps-script-type/sheets/sheets-py/scripts/fixup_sheets_keywords.py b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/scripts/fixup_sheets_keywords.py new file mode 100644 index 000000000000..4ef43f6bf0e1 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/scripts/fixup_sheets_keywords.py @@ -0,0 +1,175 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import argparse +import os +import libcst as cst +import pathlib +import sys +from typing import (Any, Callable, Dict, List, Sequence, Tuple) + + +def partition( + predicate: Callable[[Any], bool], + iterator: Sequence[Any] +) -> Tuple[List[Any], List[Any]]: + """A stable, out-of-place partition.""" + results = ([], []) + + for i in iterator: + results[int(predicate(i))].append(i) + + # Returns trueList, falseList + return results[1], results[0] + + +class sheetsCallTransformer(cst.CSTTransformer): + CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') + METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { + } + + def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: + try: + key = original.func.attr.value + kword_params = self.METHOD_TO_PARAMS[key] + except (AttributeError, KeyError): + # Either not a method from the API or too convoluted to be sure. + return updated + + # If the existing code is valid, keyword args come after positional args. + # Therefore, all positional args must map to the first parameters. + args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) + if any(k.keyword.value == "request" for k in kwargs): + # We've already fixed this file, don't fix it again. + return updated + + kwargs, ctrl_kwargs = partition( + lambda a: a.keyword.value not in self.CTRL_PARAMS, + kwargs + ) + + args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] + ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) + for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) + + request_arg = cst.Arg( + value=cst.Dict([ + cst.DictElement( + cst.SimpleString("'{}'".format(name)), +cst.Element(value=arg.value) + ) + # Note: the args + kwargs looks silly, but keep in mind that + # the control parameters had to be stripped out, and that + # those could have been passed positionally or by keyword. + for name, arg in zip(kword_params, args + kwargs)]), + keyword=cst.Name("request") + ) + + return updated.with_changes( + args=[request_arg] + ctrl_kwargs + ) + + +def fix_files( + in_dir: pathlib.Path, + out_dir: pathlib.Path, + *, + transformer=sheetsCallTransformer(), +): + """Duplicate the input dir to the output dir, fixing file method calls. + + Preconditions: + * in_dir is a real directory + * out_dir is a real, empty directory + """ + pyfile_gen = ( + pathlib.Path(os.path.join(root, f)) + for root, _, files in os.walk(in_dir) + for f in files if os.path.splitext(f)[1] == ".py" + ) + + for fpath in pyfile_gen: + with open(fpath, 'r') as f: + src = f.read() + + # Parse the code and insert method call fixes. + tree = cst.parse_module(src) + updated = tree.visit(transformer) + + # Create the path and directory structure for the new file. + updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) + updated_path.parent.mkdir(parents=True, exist_ok=True) + + # Generate the updated source file at the corresponding path. + with open(updated_path, 'w') as f: + f.write(updated.code) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser( + description="""Fix up source that uses the sheets client library. + +The existing sources are NOT overwritten but are copied to output_dir with changes made. + +Note: This tool operates at a best-effort level at converting positional + parameters in client method calls to keyword based parameters. + Cases where it WILL FAIL include + A) * or ** expansion in a method call. + B) Calls via function or method alias (includes free function calls) + C) Indirect or dispatched calls (e.g. the method is looked up dynamically) + + These all constitute false negatives. The tool will also detect false + positives when an API method shares a name with another method. +""") + parser.add_argument( + '-d', + '--input-directory', + required=True, + dest='input_dir', + help='the input directory to walk for python files to fix up', + ) + parser.add_argument( + '-o', + '--output-directory', + required=True, + dest='output_dir', + help='the directory to output files fixed via un-flattening', + ) + args = parser.parse_args() + input_dir = pathlib.Path(args.input_dir) + output_dir = pathlib.Path(args.output_dir) + if not input_dir.is_dir(): + print( + f"input directory '{input_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if not output_dir.is_dir(): + print( + f"output directory '{output_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if os.listdir(output_dir): + print( + f"output directory '{output_dir}' is not empty", + file=sys.stderr, + ) + sys.exit(-1) + + fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/sheets/sheets-py/setup.py b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/setup.py new file mode 100644 index 000000000000..84f28dc07955 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/setup.py @@ -0,0 +1,91 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import io +import os + +import setuptools # type: ignore + +package_root = os.path.abspath(os.path.dirname(__file__)) + +name = 'google-apps-script-type-sheets' + + +description = "Google Apps Script Type Sheets API client library" + +version = {} +with open(os.path.join(package_root, 'google/apps/script/type/sheets/gapic_version.py')) as fp: + exec(fp.read(), version) +version = version["__version__"] + +if version[0] == "0": + release_status = "Development Status :: 4 - Beta" +else: + release_status = "Development Status :: 5 - Production/Stable" + +dependencies = [ + "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", + "proto-plus >= 1.22.0, <2.0.0dev", + "proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'", + "protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", + "google-apps-script-type >= 0.2.0, <1.0.0dev", +] +url = "https://github.com/googleapis/python-apps-script-type-sheets" + +package_root = os.path.abspath(os.path.dirname(__file__)) + +readme_filename = os.path.join(package_root, "README.rst") +with io.open(readme_filename, encoding="utf-8") as readme_file: + readme = readme_file.read() + +packages = [ + package + for package in setuptools.PEP420PackageFinder.find() + if package.startswith("google") +] + +namespaces = ["google", "google.apps", "google.apps.script", "google.apps.script.type"] + +setuptools.setup( + name=name, + version=version, + description=description, + long_description=readme, + author="Google LLC", + author_email="googleapis-packages@google.com", + license="Apache 2.0", + url=url, + classifiers=[ + release_status, + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Operating System :: OS Independent", + "Topic :: Internet", + ], + platforms="Posix; MacOS X; Windows", + packages=packages, + python_requires=">=3.7", + namespace_packages=namespaces, + install_requires=dependencies, + include_package_data=True, + zip_safe=False, +) diff --git a/owl-bot-staging/google-apps-script-type/sheets/sheets-py/testing/constraints-3.10.txt b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/testing/constraints-3.10.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/testing/constraints-3.10.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/sheets/sheets-py/testing/constraints-3.11.txt b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/testing/constraints-3.11.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/testing/constraints-3.11.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/sheets/sheets-py/testing/constraints-3.12.txt b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/testing/constraints-3.12.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/testing/constraints-3.12.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/sheets/sheets-py/testing/constraints-3.7.txt b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/testing/constraints-3.7.txt new file mode 100644 index 000000000000..4ae34ff40304 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/testing/constraints-3.7.txt @@ -0,0 +1,10 @@ +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file. +# Pin the version to the lower bound. +# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", +# Then this file should have google-cloud-foo==1.14.0 +google-api-core==1.34.0 +proto-plus==1.22.0 +protobuf==3.19.5 +google-apps-script-type==0.2.0 diff --git a/owl-bot-staging/google-apps-script-type/sheets/sheets-py/testing/constraints-3.8.txt b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/testing/constraints-3.8.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/testing/constraints-3.8.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/sheets/sheets-py/testing/constraints-3.9.txt b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/testing/constraints-3.9.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/testing/constraints-3.9.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/sheets/sheets-py/tests/__init__.py b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/tests/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/tests/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/sheets/sheets-py/tests/unit/__init__.py b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/tests/unit/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/tests/unit/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/sheets/sheets-py/tests/unit/gapic/__init__.py b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/tests/unit/gapic/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/tests/unit/gapic/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/sheets/sheets-py/tests/unit/gapic/sheets/__init__.py b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/tests/unit/gapic/sheets/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/sheets/sheets-py/tests/unit/gapic/sheets/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/slides/slides-py/.coveragerc b/owl-bot-staging/google-apps-script-type/slides/slides-py/.coveragerc new file mode 100644 index 000000000000..5b06ae94a652 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides/slides-py/.coveragerc @@ -0,0 +1,13 @@ +[run] +branch = True + +[report] +show_missing = True +omit = + google/apps/script/type/slides/__init__.py + google/apps/script/type/slides/gapic_version.py +exclude_lines = + # Re-enable the standard pragma + pragma: NO COVER + # Ignore debug-only repr + def __repr__ diff --git a/owl-bot-staging/google-apps-script-type/slides/slides-py/.flake8 b/owl-bot-staging/google-apps-script-type/slides/slides-py/.flake8 new file mode 100644 index 000000000000..29227d4cf419 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides/slides-py/.flake8 @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Generated by synthtool. DO NOT EDIT! +[flake8] +ignore = E203, E266, E501, W503 +exclude = + # Exclude generated code. + **/proto/** + **/gapic/** + **/services/** + **/types/** + *_pb2.py + + # Standard linting exemptions. + **/.nox/** + __pycache__, + .git, + *.pyc, + conf.py diff --git a/owl-bot-staging/google-apps-script-type/slides/slides-py/MANIFEST.in b/owl-bot-staging/google-apps-script-type/slides/slides-py/MANIFEST.in new file mode 100644 index 000000000000..017124b78953 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides/slides-py/MANIFEST.in @@ -0,0 +1,2 @@ +recursive-include google/apps/script/type/slides *.py +recursive-include google/apps/script/type/slides *.py diff --git a/owl-bot-staging/google-apps-script-type/slides/slides-py/README.rst b/owl-bot-staging/google-apps-script-type/slides/slides-py/README.rst new file mode 100644 index 000000000000..8baf4a9e8a16 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides/slides-py/README.rst @@ -0,0 +1,49 @@ +Python Client for Google Apps Script Type Slides API +================================================= + +Quick Start +----------- + +In order to use this library, you first need to go through the following steps: + +1. `Select or create a Cloud Platform project.`_ +2. `Enable billing for your project.`_ +3. Enable the Google Apps Script Type Slides API. +4. `Setup Authentication.`_ + +.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project +.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project +.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html + +Installation +~~~~~~~~~~~~ + +Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to +create isolated Python environments. The basic problem it addresses is one of +dependencies and versions, and indirectly permissions. + +With `virtualenv`_, it's possible to install this library without needing system +install permissions, and without clashing with the installed system +dependencies. + +.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ + + +Mac/Linux +^^^^^^^^^ + +.. code-block:: console + + python3 -m venv + source /bin/activate + /bin/pip install /path/to/library + + +Windows +^^^^^^^ + +.. code-block:: console + + python3 -m venv + \Scripts\activate + \Scripts\pip.exe install \path\to\library diff --git a/owl-bot-staging/google-apps-script-type/slides/slides-py/docs/_static/custom.css b/owl-bot-staging/google-apps-script-type/slides/slides-py/docs/_static/custom.css new file mode 100644 index 000000000000..06423be0b592 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides/slides-py/docs/_static/custom.css @@ -0,0 +1,3 @@ +dl.field-list > dt { + min-width: 100px +} diff --git a/owl-bot-staging/google-apps-script-type/slides/slides-py/docs/conf.py b/owl-bot-staging/google-apps-script-type/slides/slides-py/docs/conf.py new file mode 100644 index 000000000000..04f250485165 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides/slides-py/docs/conf.py @@ -0,0 +1,376 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# google-apps-script-type-slides documentation build configuration file +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys +import os +import shlex + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +sys.path.insert(0, os.path.abspath("..")) + +__version__ = "0.1.0" + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +needs_sphinx = "4.0.1" + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.intersphinx", + "sphinx.ext.coverage", + "sphinx.ext.napoleon", + "sphinx.ext.todo", + "sphinx.ext.viewcode", +] + +# autodoc/autosummary flags +autoclass_content = "both" +autodoc_default_flags = ["members"] +autosummary_generate = True + + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# Allow markdown includes (so releases.md can include CHANGLEOG.md) +# http://www.sphinx-doc.org/en/master/markdown.html +source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +source_suffix = [".rst", ".md"] + +# The encoding of source files. +# source_encoding = 'utf-8-sig' + +# The root toctree document. +root_doc = "index" + +# General information about the project. +project = u"google-apps-script-type-slides" +copyright = u"2023, Google, LLC" +author = u"Google APIs" # TODO: autogenerate this bit + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The full version, including alpha/beta/rc tags. +release = __version__ +# The short X.Y version. +version = ".".join(release.split(".")[0:2]) + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = 'en' + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +# today = '' +# Else, today_fmt is used as the format for a strftime call. +# today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ["_build"] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +# default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +# add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +# add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +# show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = "sphinx" + +# A list of ignored prefixes for module index sorting. +# modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +# keep_warnings = False + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = True + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = "alabaster" + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +html_theme_options = { + "description": "Google Apps Script Type Client Libraries for Python", + "github_user": "googleapis", + "github_repo": "google-cloud-python", + "github_banner": True, + "font_family": "'Roboto', Georgia, sans", + "head_font_family": "'Roboto', Georgia, serif", + "code_font_family": "'Roboto Mono', 'Consolas', monospace", +} + +# Add any paths that contain custom themes here, relative to this directory. +# html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +# html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +# html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +# html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +# html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ["_static"] + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +# html_extra_path = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +# html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +# html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +# html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +# html_additional_pages = {} + +# If false, no module index is generated. +# html_domain_indices = True + +# If false, no index is generated. +# html_use_index = True + +# If true, the index is split into individual pages for each letter. +# html_split_index = False + +# If true, links to the reST sources are added to the pages. +# html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +# html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +# html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +# html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +# html_file_suffix = None + +# Language to be used for generating the HTML full-text search index. +# Sphinx supports the following languages: +# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' +# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' +# html_search_language = 'en' + +# A dictionary with options for the search language support, empty by default. +# Now only 'ja' uses this config value +# html_search_options = {'type': 'default'} + +# The name of a javascript file (relative to the configuration directory) that +# implements a search results scorer. If empty, the default will be used. +# html_search_scorer = 'scorer.js' + +# Output file base name for HTML help builder. +htmlhelp_basename = "google-apps-script-type-slides-doc" + +# -- Options for warnings ------------------------------------------------------ + + +suppress_warnings = [ + # Temporarily suppress this to avoid "more than one target found for + # cross-reference" warning, which are intractable for us to avoid while in + # a mono-repo. + # See https://github.com/sphinx-doc/sphinx/blob + # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 + "ref.python" +] + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # 'papersize': 'letterpaper', + # The font size ('10pt', '11pt' or '12pt'). + # 'pointsize': '10pt', + # Additional stuff for the LaTeX preamble. + # 'preamble': '', + # Latex figure (float) alignment + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + ( + root_doc, + "google-apps-script-type-slides.tex", + u"google-apps-script-type-slides Documentation", + author, + "manual", + ) +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +# latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +# latex_use_parts = False + +# If true, show page references after internal links. +# latex_show_pagerefs = False + +# If true, show URL addresses after external links. +# latex_show_urls = False + +# Documents to append as an appendix to all manuals. +# latex_appendices = [] + +# If false, no module index is generated. +# latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ( + root_doc, + "google-apps-script-type-slides", + u"Google Apps Script Type Slides Documentation", + [author], + 1, + ) +] + +# If true, show URL addresses after external links. +# man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ( + root_doc, + "google-apps-script-type-slides", + u"google-apps-script-type-slides Documentation", + author, + "google-apps-script-type-slides", + "GAPIC library for Google Apps Script Type Slides API", + "APIs", + ) +] + +# Documents to append as an appendix to all manuals. +# texinfo_appendices = [] + +# If false, no module index is generated. +# texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +# texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +# texinfo_no_detailmenu = False + + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = { + "python": ("http://python.readthedocs.org/en/latest/", None), + "gax": ("https://gax-python.readthedocs.org/en/latest/", None), + "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), + "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), + "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None), + "grpc": ("https://grpc.io/grpc/python/", None), + "requests": ("http://requests.kennethreitz.org/en/stable/", None), + "proto": ("https://proto-plus-python.readthedocs.io/en/stable", None), + "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), +} + + +# Napoleon settings +napoleon_google_docstring = True +napoleon_numpy_docstring = True +napoleon_include_private_with_doc = False +napoleon_include_special_with_doc = True +napoleon_use_admonition_for_examples = False +napoleon_use_admonition_for_notes = False +napoleon_use_admonition_for_references = False +napoleon_use_ivar = False +napoleon_use_param = True +napoleon_use_rtype = True diff --git a/owl-bot-staging/google-apps-script-type/slides/slides-py/docs/index.rst b/owl-bot-staging/google-apps-script-type/slides/slides-py/docs/index.rst new file mode 100644 index 000000000000..71c050be8d28 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides/slides-py/docs/index.rst @@ -0,0 +1,7 @@ +API Reference +------------- +.. toctree:: + :maxdepth: 2 + + slides/services + slides/types diff --git a/owl-bot-staging/google-apps-script-type/slides/slides-py/docs/slides/services.rst b/owl-bot-staging/google-apps-script-type/slides/slides-py/docs/slides/services.rst new file mode 100644 index 000000000000..ab06ee6547e5 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides/slides-py/docs/slides/services.rst @@ -0,0 +1,4 @@ +Services for Google Apps Script Type Slides API +================================================ +.. toctree:: + :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/slides/slides-py/docs/slides/types.rst b/owl-bot-staging/google-apps-script-type/slides/slides-py/docs/slides/types.rst new file mode 100644 index 000000000000..8d074bd3c493 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides/slides-py/docs/slides/types.rst @@ -0,0 +1,6 @@ +Types for Google Apps Script Type Slides API +============================================= + +.. automodule:: google.apps.script.type.slides.types + :members: + :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/slides/slides-py/google/apps/script/type/slides/__init__.py b/owl-bot-staging/google-apps-script-type/slides/slides-py/google/apps/script/type/slides/__init__.py new file mode 100644 index 000000000000..f356ec8e3574 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides/slides-py/google/apps/script/type/slides/__init__.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from google.apps.script.type.slides import gapic_version as package_version + +__version__ = package_version.__version__ + + + +from .types.slides_addon_manifest import SlidesAddOnManifest +from .types.slides_addon_manifest import SlidesExtensionPoint + +__all__ = ( +'SlidesAddOnManifest', +'SlidesExtensionPoint', +) diff --git a/owl-bot-staging/google-apps-script-type/slides/slides-py/google/apps/script/type/slides/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/slides/slides-py/google/apps/script/type/slides/gapic_metadata.json new file mode 100644 index 000000000000..dff8f8bbc7bf --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides/slides-py/google/apps/script/type/slides/gapic_metadata.json @@ -0,0 +1,7 @@ + { + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "python", + "libraryPackage": "google.apps.script.type.slides", + "protoPackage": "google.apps.script.type.slides", + "schema": "1.0" +} diff --git a/owl-bot-staging/google-apps-script-type/slides/slides-py/google/apps/script/type/slides/gapic_version.py b/owl-bot-staging/google-apps-script-type/slides/slides-py/google/apps/script/type/slides/gapic_version.py new file mode 100644 index 000000000000..360a0d13ebdd --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides/slides-py/google/apps/script/type/slides/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/slides/slides-py/google/apps/script/type/slides/py.typed b/owl-bot-staging/google-apps-script-type/slides/slides-py/google/apps/script/type/slides/py.typed new file mode 100644 index 000000000000..eee2788b4c55 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides/slides-py/google/apps/script/type/slides/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-apps-script-type-slides package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/slides/slides-py/google/apps/script/type/slides/services/__init__.py b/owl-bot-staging/google-apps-script-type/slides/slides-py/google/apps/script/type/slides/services/__init__.py new file mode 100644 index 000000000000..89a37dc92c5a --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides/slides-py/google/apps/script/type/slides/services/__init__.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/slides/slides-py/google/apps/script/type/slides/types/__init__.py b/owl-bot-staging/google-apps-script-type/slides/slides-py/google/apps/script/type/slides/types/__init__.py new file mode 100644 index 000000000000..eb85bf4a5a46 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides/slides-py/google/apps/script/type/slides/types/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from .slides_addon_manifest import ( + SlidesAddOnManifest, + SlidesExtensionPoint, +) + +__all__ = ( + 'SlidesAddOnManifest', + 'SlidesExtensionPoint', +) diff --git a/owl-bot-staging/google-apps-script-type/slides/slides-py/google/apps/script/type/slides/types/slides_addon_manifest.py b/owl-bot-staging/google-apps-script-type/slides/slides-py/google/apps/script/type/slides/types/slides_addon_manifest.py new file mode 100644 index 000000000000..1b54f5192821 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides/slides-py/google/apps/script/type/slides/types/slides_addon_manifest.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.apps.script.type.types import extension_point + + +__protobuf__ = proto.module( + package='google.apps.script.type.slides', + manifest={ + 'SlidesAddOnManifest', + 'SlidesExtensionPoint', + }, +) + + +class SlidesAddOnManifest(proto.Message): + r"""Slides add-on manifest. + + Attributes: + homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): + If present, this overrides the configuration from + ``addOns.common.homepageTrigger``. + on_file_scope_granted_trigger (google.apps.script.type.slides.types.SlidesExtensionPoint): + Endpoint to execute when file scope + authorization is granted for this document/user + pair. + """ + + homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( + proto.MESSAGE, + number=1, + message=extension_point.HomepageExtensionPoint, + ) + on_file_scope_granted_trigger: 'SlidesExtensionPoint' = proto.Field( + proto.MESSAGE, + number=2, + message='SlidesExtensionPoint', + ) + + +class SlidesExtensionPoint(proto.Message): + r"""Common format for declaring a Slides add-on's triggers. + + Attributes: + run_function (str): + Required. The endpoint to execute when this + extension point is activated. + """ + + run_function: str = proto.Field( + proto.STRING, + number=1, + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/slides/slides-py/mypy.ini b/owl-bot-staging/google-apps-script-type/slides/slides-py/mypy.ini new file mode 100644 index 000000000000..574c5aed394b --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides/slides-py/mypy.ini @@ -0,0 +1,3 @@ +[mypy] +python_version = 3.7 +namespace_packages = True diff --git a/owl-bot-staging/google-apps-script-type/slides/slides-py/noxfile.py b/owl-bot-staging/google-apps-script-type/slides/slides-py/noxfile.py new file mode 100644 index 000000000000..426935428392 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides/slides-py/noxfile.py @@ -0,0 +1,184 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import os +import pathlib +import shutil +import subprocess +import sys + + +import nox # type: ignore + +ALL_PYTHON = [ + "3.7", + "3.8", + "3.9", + "3.10", + "3.11", +] + +CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() + +LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt" +PACKAGE_NAME = subprocess.check_output([sys.executable, "setup.py", "--name"], encoding="utf-8") + +BLACK_VERSION = "black==22.3.0" +BLACK_PATHS = ["docs", "google", "tests", "samples", "noxfile.py", "setup.py"] +DEFAULT_PYTHON_VERSION = "3.11" + +nox.sessions = [ + "unit", + "cover", + "mypy", + "check_lower_bounds" + # exclude update_lower_bounds from default + "docs", + "blacken", + "lint", + "lint_setup_py", +] + +@nox.session(python=ALL_PYTHON) +def unit(session): + """Run the unit test suite.""" + + session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') + session.install('-e', '.') + + session.run( + 'py.test', + '--quiet', + '--cov=google/apps/script/type/slides/', + '--cov=tests/', + '--cov-config=.coveragerc', + '--cov-report=term', + '--cov-report=html', + os.path.join('tests', 'unit', ''.join(session.posargs)) + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def cover(session): + """Run the final coverage report. + This outputs the coverage report aggregating coverage from the unit + test runs (not system test runs), and then erases coverage data. + """ + session.install("coverage", "pytest-cov") + session.run("coverage", "report", "--show-missing", "--fail-under=100") + + session.run("coverage", "erase") + + +@nox.session(python=ALL_PYTHON) +def mypy(session): + """Run the type checker.""" + session.install( + 'mypy', + 'types-requests', + 'types-protobuf' + ) + session.install('.') + session.run( + 'mypy', + '--explicit-package-bases', + 'google', + ) + + +@nox.session +def update_lower_bounds(session): + """Update lower bounds in constraints.txt to match setup.py""" + session.install('google-cloud-testutils') + session.install('.') + + session.run( + 'lower-bound-checker', + 'update', + '--package-name', + PACKAGE_NAME, + '--constraints-file', + str(LOWER_BOUND_CONSTRAINTS_FILE), + ) + + +@nox.session +def check_lower_bounds(session): + """Check lower bounds in setup.py are reflected in constraints file""" + session.install('google-cloud-testutils') + session.install('.') + + session.run( + 'lower-bound-checker', + 'check', + '--package-name', + PACKAGE_NAME, + '--constraints-file', + str(LOWER_BOUND_CONSTRAINTS_FILE), + ) + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def docs(session): + """Build the docs for this library.""" + + session.install("-e", ".") + session.install("sphinx==7.0.1", "alabaster", "recommonmark") + + shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) + session.run( + "sphinx-build", + "-W", # warnings as errors + "-T", # show full traceback on exception + "-N", # no colors + "-b", + "html", + "-d", + os.path.join("docs", "_build", "doctrees", ""), + os.path.join("docs", ""), + os.path.join("docs", "_build", "html", ""), + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def lint(session): + """Run linters. + + Returns a failure if the linters find linting errors or sufficiently + serious code quality issues. + """ + session.install("flake8", BLACK_VERSION) + session.run( + "black", + "--check", + *BLACK_PATHS, + ) + session.run("flake8", "google", "tests", "samples") + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def blacken(session): + """Run black. Format code to uniform standard.""" + session.install(BLACK_VERSION) + session.run( + "black", + *BLACK_PATHS, + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def lint_setup_py(session): + """Verify that setup.py is valid (including RST check).""" + session.install("docutils", "pygments") + session.run("python", "setup.py", "check", "--restructuredtext", "--strict") diff --git a/owl-bot-staging/google-apps-script-type/slides/slides-py/scripts/fixup_slides_keywords.py b/owl-bot-staging/google-apps-script-type/slides/slides-py/scripts/fixup_slides_keywords.py new file mode 100644 index 000000000000..6937fd026deb --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides/slides-py/scripts/fixup_slides_keywords.py @@ -0,0 +1,175 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import argparse +import os +import libcst as cst +import pathlib +import sys +from typing import (Any, Callable, Dict, List, Sequence, Tuple) + + +def partition( + predicate: Callable[[Any], bool], + iterator: Sequence[Any] +) -> Tuple[List[Any], List[Any]]: + """A stable, out-of-place partition.""" + results = ([], []) + + for i in iterator: + results[int(predicate(i))].append(i) + + # Returns trueList, falseList + return results[1], results[0] + + +class slidesCallTransformer(cst.CSTTransformer): + CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') + METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { + } + + def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: + try: + key = original.func.attr.value + kword_params = self.METHOD_TO_PARAMS[key] + except (AttributeError, KeyError): + # Either not a method from the API or too convoluted to be sure. + return updated + + # If the existing code is valid, keyword args come after positional args. + # Therefore, all positional args must map to the first parameters. + args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) + if any(k.keyword.value == "request" for k in kwargs): + # We've already fixed this file, don't fix it again. + return updated + + kwargs, ctrl_kwargs = partition( + lambda a: a.keyword.value not in self.CTRL_PARAMS, + kwargs + ) + + args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] + ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) + for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) + + request_arg = cst.Arg( + value=cst.Dict([ + cst.DictElement( + cst.SimpleString("'{}'".format(name)), +cst.Element(value=arg.value) + ) + # Note: the args + kwargs looks silly, but keep in mind that + # the control parameters had to be stripped out, and that + # those could have been passed positionally or by keyword. + for name, arg in zip(kword_params, args + kwargs)]), + keyword=cst.Name("request") + ) + + return updated.with_changes( + args=[request_arg] + ctrl_kwargs + ) + + +def fix_files( + in_dir: pathlib.Path, + out_dir: pathlib.Path, + *, + transformer=slidesCallTransformer(), +): + """Duplicate the input dir to the output dir, fixing file method calls. + + Preconditions: + * in_dir is a real directory + * out_dir is a real, empty directory + """ + pyfile_gen = ( + pathlib.Path(os.path.join(root, f)) + for root, _, files in os.walk(in_dir) + for f in files if os.path.splitext(f)[1] == ".py" + ) + + for fpath in pyfile_gen: + with open(fpath, 'r') as f: + src = f.read() + + # Parse the code and insert method call fixes. + tree = cst.parse_module(src) + updated = tree.visit(transformer) + + # Create the path and directory structure for the new file. + updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) + updated_path.parent.mkdir(parents=True, exist_ok=True) + + # Generate the updated source file at the corresponding path. + with open(updated_path, 'w') as f: + f.write(updated.code) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser( + description="""Fix up source that uses the slides client library. + +The existing sources are NOT overwritten but are copied to output_dir with changes made. + +Note: This tool operates at a best-effort level at converting positional + parameters in client method calls to keyword based parameters. + Cases where it WILL FAIL include + A) * or ** expansion in a method call. + B) Calls via function or method alias (includes free function calls) + C) Indirect or dispatched calls (e.g. the method is looked up dynamically) + + These all constitute false negatives. The tool will also detect false + positives when an API method shares a name with another method. +""") + parser.add_argument( + '-d', + '--input-directory', + required=True, + dest='input_dir', + help='the input directory to walk for python files to fix up', + ) + parser.add_argument( + '-o', + '--output-directory', + required=True, + dest='output_dir', + help='the directory to output files fixed via un-flattening', + ) + args = parser.parse_args() + input_dir = pathlib.Path(args.input_dir) + output_dir = pathlib.Path(args.output_dir) + if not input_dir.is_dir(): + print( + f"input directory '{input_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if not output_dir.is_dir(): + print( + f"output directory '{output_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if os.listdir(output_dir): + print( + f"output directory '{output_dir}' is not empty", + file=sys.stderr, + ) + sys.exit(-1) + + fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/slides/slides-py/setup.py b/owl-bot-staging/google-apps-script-type/slides/slides-py/setup.py new file mode 100644 index 000000000000..2deee65a5b5a --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides/slides-py/setup.py @@ -0,0 +1,91 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import io +import os + +import setuptools # type: ignore + +package_root = os.path.abspath(os.path.dirname(__file__)) + +name = 'google-apps-script-type-slides' + + +description = "Google Apps Script Type Slides API client library" + +version = {} +with open(os.path.join(package_root, 'google/apps/script/type/slides/gapic_version.py')) as fp: + exec(fp.read(), version) +version = version["__version__"] + +if version[0] == "0": + release_status = "Development Status :: 4 - Beta" +else: + release_status = "Development Status :: 5 - Production/Stable" + +dependencies = [ + "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", + "proto-plus >= 1.22.0, <2.0.0dev", + "proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'", + "protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", + "google-apps-script-type >= 0.2.0, <1.0.0dev", +] +url = "https://github.com/googleapis/python-apps-script-type-slides" + +package_root = os.path.abspath(os.path.dirname(__file__)) + +readme_filename = os.path.join(package_root, "README.rst") +with io.open(readme_filename, encoding="utf-8") as readme_file: + readme = readme_file.read() + +packages = [ + package + for package in setuptools.PEP420PackageFinder.find() + if package.startswith("google") +] + +namespaces = ["google", "google.apps", "google.apps.script", "google.apps.script.type"] + +setuptools.setup( + name=name, + version=version, + description=description, + long_description=readme, + author="Google LLC", + author_email="googleapis-packages@google.com", + license="Apache 2.0", + url=url, + classifiers=[ + release_status, + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Operating System :: OS Independent", + "Topic :: Internet", + ], + platforms="Posix; MacOS X; Windows", + packages=packages, + python_requires=">=3.7", + namespace_packages=namespaces, + install_requires=dependencies, + include_package_data=True, + zip_safe=False, +) diff --git a/owl-bot-staging/google-apps-script-type/slides/slides-py/testing/constraints-3.10.txt b/owl-bot-staging/google-apps-script-type/slides/slides-py/testing/constraints-3.10.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides/slides-py/testing/constraints-3.10.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/slides/slides-py/testing/constraints-3.11.txt b/owl-bot-staging/google-apps-script-type/slides/slides-py/testing/constraints-3.11.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides/slides-py/testing/constraints-3.11.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/slides/slides-py/testing/constraints-3.12.txt b/owl-bot-staging/google-apps-script-type/slides/slides-py/testing/constraints-3.12.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides/slides-py/testing/constraints-3.12.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/slides/slides-py/testing/constraints-3.7.txt b/owl-bot-staging/google-apps-script-type/slides/slides-py/testing/constraints-3.7.txt new file mode 100644 index 000000000000..4ae34ff40304 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides/slides-py/testing/constraints-3.7.txt @@ -0,0 +1,10 @@ +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file. +# Pin the version to the lower bound. +# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", +# Then this file should have google-cloud-foo==1.14.0 +google-api-core==1.34.0 +proto-plus==1.22.0 +protobuf==3.19.5 +google-apps-script-type==0.2.0 diff --git a/owl-bot-staging/google-apps-script-type/slides/slides-py/testing/constraints-3.8.txt b/owl-bot-staging/google-apps-script-type/slides/slides-py/testing/constraints-3.8.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides/slides-py/testing/constraints-3.8.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/slides/slides-py/testing/constraints-3.9.txt b/owl-bot-staging/google-apps-script-type/slides/slides-py/testing/constraints-3.9.txt new file mode 100644 index 000000000000..3a9e27b606ec --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides/slides-py/testing/constraints-3.9.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +google-apps-script-type diff --git a/owl-bot-staging/google-apps-script-type/slides/slides-py/tests/__init__.py b/owl-bot-staging/google-apps-script-type/slides/slides-py/tests/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides/slides-py/tests/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/slides/slides-py/tests/unit/__init__.py b/owl-bot-staging/google-apps-script-type/slides/slides-py/tests/unit/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides/slides-py/tests/unit/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/slides/slides-py/tests/unit/gapic/__init__.py b/owl-bot-staging/google-apps-script-type/slides/slides-py/tests/unit/gapic/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides/slides-py/tests/unit/gapic/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/slides/slides-py/tests/unit/gapic/slides/__init__.py b/owl-bot-staging/google-apps-script-type/slides/slides-py/tests/unit/gapic/slides/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/slides/slides-py/tests/unit/gapic/slides/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/type-py/.coveragerc b/owl-bot-staging/google-apps-script-type/type-py/.coveragerc new file mode 100644 index 000000000000..5c23a812e920 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/.coveragerc @@ -0,0 +1,13 @@ +[run] +branch = True + +[report] +show_missing = True +omit = + google/apps/script/type/__init__.py + google/apps/script/type/gapic_version.py +exclude_lines = + # Re-enable the standard pragma + pragma: NO COVER + # Ignore debug-only repr + def __repr__ diff --git a/owl-bot-staging/google-apps-script-type/type-py/.flake8 b/owl-bot-staging/google-apps-script-type/type-py/.flake8 new file mode 100644 index 000000000000..29227d4cf419 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/.flake8 @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Generated by synthtool. DO NOT EDIT! +[flake8] +ignore = E203, E266, E501, W503 +exclude = + # Exclude generated code. + **/proto/** + **/gapic/** + **/services/** + **/types/** + *_pb2.py + + # Standard linting exemptions. + **/.nox/** + __pycache__, + .git, + *.pyc, + conf.py diff --git a/owl-bot-staging/google-apps-script-type/type-py/MANIFEST.in b/owl-bot-staging/google-apps-script-type/type-py/MANIFEST.in new file mode 100644 index 000000000000..9cf19ae251ad --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/MANIFEST.in @@ -0,0 +1,2 @@ +recursive-include google/apps/script/type *.py +recursive-include google/apps/script/type *.py diff --git a/owl-bot-staging/google-apps-script-type/type-py/README.rst b/owl-bot-staging/google-apps-script-type/type-py/README.rst new file mode 100644 index 000000000000..77f60bb3ab2b --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/README.rst @@ -0,0 +1,49 @@ +Python Client for Google Apps Script Type API +================================================= + +Quick Start +----------- + +In order to use this library, you first need to go through the following steps: + +1. `Select or create a Cloud Platform project.`_ +2. `Enable billing for your project.`_ +3. Enable the Google Apps Script Type API. +4. `Setup Authentication.`_ + +.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project +.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project +.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html + +Installation +~~~~~~~~~~~~ + +Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to +create isolated Python environments. The basic problem it addresses is one of +dependencies and versions, and indirectly permissions. + +With `virtualenv`_, it's possible to install this library without needing system +install permissions, and without clashing with the installed system +dependencies. + +.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ + + +Mac/Linux +^^^^^^^^^ + +.. code-block:: console + + python3 -m venv + source /bin/activate + /bin/pip install /path/to/library + + +Windows +^^^^^^^ + +.. code-block:: console + + python3 -m venv + \Scripts\activate + \Scripts\pip.exe install \path\to\library diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/_static/custom.css b/owl-bot-staging/google-apps-script-type/type-py/docs/_static/custom.css new file mode 100644 index 000000000000..06423be0b592 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/docs/_static/custom.css @@ -0,0 +1,3 @@ +dl.field-list > dt { + min-width: 100px +} diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/conf.py b/owl-bot-staging/google-apps-script-type/type-py/docs/conf.py new file mode 100644 index 000000000000..d95c9f46f443 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/docs/conf.py @@ -0,0 +1,376 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# google-apps-script-type documentation build configuration file +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys +import os +import shlex + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +sys.path.insert(0, os.path.abspath("..")) + +__version__ = "0.1.0" + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +needs_sphinx = "4.0.1" + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.intersphinx", + "sphinx.ext.coverage", + "sphinx.ext.napoleon", + "sphinx.ext.todo", + "sphinx.ext.viewcode", +] + +# autodoc/autosummary flags +autoclass_content = "both" +autodoc_default_flags = ["members"] +autosummary_generate = True + + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# Allow markdown includes (so releases.md can include CHANGLEOG.md) +# http://www.sphinx-doc.org/en/master/markdown.html +source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +source_suffix = [".rst", ".md"] + +# The encoding of source files. +# source_encoding = 'utf-8-sig' + +# The root toctree document. +root_doc = "index" + +# General information about the project. +project = u"google-apps-script-type" +copyright = u"2023, Google, LLC" +author = u"Google APIs" # TODO: autogenerate this bit + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The full version, including alpha/beta/rc tags. +release = __version__ +# The short X.Y version. +version = ".".join(release.split(".")[0:2]) + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = 'en' + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +# today = '' +# Else, today_fmt is used as the format for a strftime call. +# today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ["_build"] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +# default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +# add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +# add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +# show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = "sphinx" + +# A list of ignored prefixes for module index sorting. +# modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +# keep_warnings = False + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = True + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = "alabaster" + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +html_theme_options = { + "description": "Google Apps Script Client Libraries for Python", + "github_user": "googleapis", + "github_repo": "google-cloud-python", + "github_banner": True, + "font_family": "'Roboto', Georgia, sans", + "head_font_family": "'Roboto', Georgia, serif", + "code_font_family": "'Roboto Mono', 'Consolas', monospace", +} + +# Add any paths that contain custom themes here, relative to this directory. +# html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +# html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +# html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +# html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +# html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ["_static"] + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +# html_extra_path = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +# html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +# html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +# html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +# html_additional_pages = {} + +# If false, no module index is generated. +# html_domain_indices = True + +# If false, no index is generated. +# html_use_index = True + +# If true, the index is split into individual pages for each letter. +# html_split_index = False + +# If true, links to the reST sources are added to the pages. +# html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +# html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +# html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +# html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +# html_file_suffix = None + +# Language to be used for generating the HTML full-text search index. +# Sphinx supports the following languages: +# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' +# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' +# html_search_language = 'en' + +# A dictionary with options for the search language support, empty by default. +# Now only 'ja' uses this config value +# html_search_options = {'type': 'default'} + +# The name of a javascript file (relative to the configuration directory) that +# implements a search results scorer. If empty, the default will be used. +# html_search_scorer = 'scorer.js' + +# Output file base name for HTML help builder. +htmlhelp_basename = "google-apps-script-type-doc" + +# -- Options for warnings ------------------------------------------------------ + + +suppress_warnings = [ + # Temporarily suppress this to avoid "more than one target found for + # cross-reference" warning, which are intractable for us to avoid while in + # a mono-repo. + # See https://github.com/sphinx-doc/sphinx/blob + # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 + "ref.python" +] + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # 'papersize': 'letterpaper', + # The font size ('10pt', '11pt' or '12pt'). + # 'pointsize': '10pt', + # Additional stuff for the LaTeX preamble. + # 'preamble': '', + # Latex figure (float) alignment + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + ( + root_doc, + "google-apps-script-type.tex", + u"google-apps-script-type Documentation", + author, + "manual", + ) +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +# latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +# latex_use_parts = False + +# If true, show page references after internal links. +# latex_show_pagerefs = False + +# If true, show URL addresses after external links. +# latex_show_urls = False + +# Documents to append as an appendix to all manuals. +# latex_appendices = [] + +# If false, no module index is generated. +# latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ( + root_doc, + "google-apps-script-type", + u"Google Apps Script Type Documentation", + [author], + 1, + ) +] + +# If true, show URL addresses after external links. +# man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ( + root_doc, + "google-apps-script-type", + u"google-apps-script-type Documentation", + author, + "google-apps-script-type", + "GAPIC library for Google Apps Script Type API", + "APIs", + ) +] + +# Documents to append as an appendix to all manuals. +# texinfo_appendices = [] + +# If false, no module index is generated. +# texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +# texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +# texinfo_no_detailmenu = False + + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = { + "python": ("http://python.readthedocs.org/en/latest/", None), + "gax": ("https://gax-python.readthedocs.org/en/latest/", None), + "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), + "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), + "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None), + "grpc": ("https://grpc.io/grpc/python/", None), + "requests": ("http://requests.kennethreitz.org/en/stable/", None), + "proto": ("https://proto-plus-python.readthedocs.io/en/stable", None), + "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), +} + + +# Napoleon settings +napoleon_google_docstring = True +napoleon_numpy_docstring = True +napoleon_include_private_with_doc = False +napoleon_include_special_with_doc = True +napoleon_use_admonition_for_examples = False +napoleon_use_admonition_for_notes = False +napoleon_use_admonition_for_references = False +napoleon_use_ivar = False +napoleon_use_param = True +napoleon_use_rtype = True diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/index.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/index.rst new file mode 100644 index 000000000000..d058a5e150df --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/docs/index.rst @@ -0,0 +1,7 @@ +API Reference +------------- +.. toctree:: + :maxdepth: 2 + + type/services + type/types diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/type/services.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/type/services.rst new file mode 100644 index 000000000000..2d0581ddccc7 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/docs/type/services.rst @@ -0,0 +1,4 @@ +Services for Google Apps Script Type API +========================================= +.. toctree:: + :maxdepth: 2 diff --git a/owl-bot-staging/google-apps-script-type/type-py/docs/type/types.rst b/owl-bot-staging/google-apps-script-type/type-py/docs/type/types.rst new file mode 100644 index 000000000000..1076ae59ac52 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/docs/type/types.rst @@ -0,0 +1,6 @@ +Types for Google Apps Script Type API +====================================== + +.. automodule:: google.apps.script.type.types + :members: + :show-inheritance: diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/__init__.py new file mode 100644 index 000000000000..392f67a89e6b --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/__init__.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from google.apps.script.type import gapic_version as package_version + +__version__ = package_version.__version__ + + + +from .types.addon_widget_set import AddOnWidgetSet +from .types.extension_point import HomepageExtensionPoint +from .types.extension_point import MenuItemExtensionPoint +from .types.extension_point import UniversalActionExtensionPoint +from .types.script_manifest import CommonAddOnManifest +from .types.script_manifest import HttpOptions +from .types.script_manifest import LayoutProperties +from .types.script_manifest import HttpAuthorizationHeader + +__all__ = ( +'AddOnWidgetSet', +'CommonAddOnManifest', +'HomepageExtensionPoint', +'HttpAuthorizationHeader', +'HttpOptions', +'LayoutProperties', +'MenuItemExtensionPoint', +'UniversalActionExtensionPoint', +) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_metadata.json b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_metadata.json new file mode 100644 index 000000000000..ba4a361d1caf --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_metadata.json @@ -0,0 +1,7 @@ + { + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "python", + "libraryPackage": "google.apps.script.type", + "protoPackage": "google.apps.script.type", + "schema": "1.0" +} diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_version.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_version.py new file mode 100644 index 000000000000..360a0d13ebdd --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "0.0.0" # {x-release-please-version} diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/py.typed b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/py.typed new file mode 100644 index 000000000000..04b9596b161d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/py.typed @@ -0,0 +1,2 @@ +# Marker file for PEP 561. +# The google-apps-script-type package uses inline types. diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/services/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/services/__init__.py new file mode 100644 index 000000000000..89a37dc92c5a --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/services/__init__.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/__init__.py new file mode 100644 index 000000000000..e8ebf1bcb7c6 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/__init__.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from .addon_widget_set import ( + AddOnWidgetSet, +) +from .extension_point import ( + HomepageExtensionPoint, + MenuItemExtensionPoint, + UniversalActionExtensionPoint, +) +from .script_manifest import ( + CommonAddOnManifest, + HttpOptions, + LayoutProperties, + HttpAuthorizationHeader, +) + +__all__ = ( + 'AddOnWidgetSet', + 'HomepageExtensionPoint', + 'MenuItemExtensionPoint', + 'UniversalActionExtensionPoint', + 'CommonAddOnManifest', + 'HttpOptions', + 'LayoutProperties', + 'HttpAuthorizationHeader', +) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/addon_widget_set.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/addon_widget_set.py new file mode 100644 index 000000000000..d6379beb0be6 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/addon_widget_set.py @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + + +__protobuf__ = proto.module( + package='google.apps.script.type', + manifest={ + 'AddOnWidgetSet', + }, +) + + +class AddOnWidgetSet(proto.Message): + r"""The widget subset used by an add-on. + + Attributes: + used_widgets (MutableSequence[google.apps.script.type.types.AddOnWidgetSet.WidgetType]): + The list of widgets used in an add-on. + """ + class WidgetType(proto.Enum): + r"""The Widget type. DEFAULT is the basic widget set. + + Values: + WIDGET_TYPE_UNSPECIFIED (0): + The default widget set. + DATE_PICKER (1): + The date picker. + STYLED_BUTTONS (2): + Styled buttons include filled buttons and + disabled buttons. + PERSISTENT_FORMS (3): + Persistent forms allow persisting form values + during actions. + FIXED_FOOTER (4): + Fixed footer in card. + UPDATE_SUBJECT_AND_RECIPIENTS (5): + Update the subject and recipients of a draft. + GRID_WIDGET (6): + The grid widget. + ADDON_COMPOSE_UI_ACTION (7): + A Gmail add-on action that applies to the + addon compose UI. + """ + WIDGET_TYPE_UNSPECIFIED = 0 + DATE_PICKER = 1 + STYLED_BUTTONS = 2 + PERSISTENT_FORMS = 3 + FIXED_FOOTER = 4 + UPDATE_SUBJECT_AND_RECIPIENTS = 5 + GRID_WIDGET = 6 + ADDON_COMPOSE_UI_ACTION = 7 + + used_widgets: MutableSequence[WidgetType] = proto.RepeatedField( + proto.ENUM, + number=1, + enum=WidgetType, + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/extension_point.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/extension_point.py new file mode 100644 index 000000000000..434e1c01a383 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/extension_point.py @@ -0,0 +1,139 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.protobuf import wrappers_pb2 # type: ignore + + +__protobuf__ = proto.module( + package='google.apps.script.type', + manifest={ + 'MenuItemExtensionPoint', + 'HomepageExtensionPoint', + 'UniversalActionExtensionPoint', + }, +) + + +class MenuItemExtensionPoint(proto.Message): + r"""Common format for declaring a menu item, or button, that + appears within a host app. + + Attributes: + run_function (str): + Required. The endpoint to execute when this + extension point is activated. + label (str): + Required. User-visible text describing the + action taken by activating this extension point. + For example, "Insert invoice". + logo_url (str): + The URL for the logo image shown in the + add-on toolbar. + If not set, defaults to the add-on's primary + logo URL. + """ + + run_function: str = proto.Field( + proto.STRING, + number=1, + ) + label: str = proto.Field( + proto.STRING, + number=2, + ) + logo_url: str = proto.Field( + proto.STRING, + number=3, + ) + + +class HomepageExtensionPoint(proto.Message): + r"""Common format for declaring an add-on's home-page view. + + Attributes: + run_function (str): + Required. The endpoint to execute when this + extension point is activated. + enabled (google.protobuf.wrappers_pb2.BoolValue): + Optional. If set to ``false``, disable the home-page view in + this context. + + Defaults to ``true`` if unset. + + If an add-ons custom home-page view is disabled, an + autogenerated overview card will be provided for users + instead. + """ + + run_function: str = proto.Field( + proto.STRING, + number=1, + ) + enabled: wrappers_pb2.BoolValue = proto.Field( + proto.MESSAGE, + number=2, + message=wrappers_pb2.BoolValue, + ) + + +class UniversalActionExtensionPoint(proto.Message): + r"""Format for declaring a universal action menu item extension + point. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + label (str): + Required. User-visible text describing the + action taken by activating this extension point, + for example, "Add a new contact". + open_link (str): + URL to be opened by the UniversalAction. + + This field is a member of `oneof`_ ``action_type``. + run_function (str): + Endpoint to be run by the UniversalAction. + + This field is a member of `oneof`_ ``action_type``. + """ + + label: str = proto.Field( + proto.STRING, + number=1, + ) + open_link: str = proto.Field( + proto.STRING, + number=2, + oneof='action_type', + ) + run_function: str = proto.Field( + proto.STRING, + number=3, + oneof='action_type', + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/script_manifest.py b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/script_manifest.py new file mode 100644 index 000000000000..57d5b2415f2e --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/google/apps/script/type/types/script_manifest.py @@ -0,0 +1,186 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.apps.script.type.types import addon_widget_set +from google.apps.script.type.types import extension_point +from google.protobuf import struct_pb2 # type: ignore + + +__protobuf__ = proto.module( + package='google.apps.script.type', + manifest={ + 'HttpAuthorizationHeader', + 'CommonAddOnManifest', + 'LayoutProperties', + 'HttpOptions', + }, +) + + +class HttpAuthorizationHeader(proto.Enum): + r"""Authorization header sent in add-on HTTP requests + + Values: + HTTP_AUTHORIZATION_HEADER_UNSPECIFIED (0): + Default value, equivalent to ``SYSTEM_ID_TOKEN`` + SYSTEM_ID_TOKEN (1): + Send an ID token for the project-specific + Google Workspace Add-ons system service account + (default) + USER_ID_TOKEN (2): + Send an ID token for the end user + NONE (3): + Do not send an Authentication header + """ + HTTP_AUTHORIZATION_HEADER_UNSPECIFIED = 0 + SYSTEM_ID_TOKEN = 1 + USER_ID_TOKEN = 2 + NONE = 3 + + +class CommonAddOnManifest(proto.Message): + r"""Add-on configuration that is shared across all add-on host + applications. + + Attributes: + name (str): + Required. The display name of the add-on. + logo_url (str): + Required. The URL for the logo image shown in + the add-on toolbar. + layout_properties (google.apps.script.type.types.LayoutProperties): + Common layout properties for the add-on + cards. + add_on_widget_set (google.apps.script.type.types.AddOnWidgetSet): + The widgets used in the add-on. If this field + is not specified, it indicates that default set + is used. + use_locale_from_app (bool): + Whether to pass locale information from host + app. + homepage_trigger (google.apps.script.type.types.HomepageExtensionPoint): + Defines an endpoint that will be executed in + any context, in any host. Any cards generated by + this function will always be available to the + user, but may be eclipsed by contextual content + when this add-on declares more targeted + triggers. + universal_actions (MutableSequence[google.apps.script.type.types.UniversalActionExtensionPoint]): + Defines a list of extension points in the + universal action menu which serves as a setting + menu for the add-on. The extension point can be + link URL to open or an endpoint to execute as a + form submission. + open_link_url_prefixes (google.protobuf.struct_pb2.ListValue): + An OpenLink action can only use a URL with an HTTPS, MAILTO + or TEL scheme. For HTTPS links, the URL must also + `match `__ + one of the prefixes specified in this whitelist. If the + prefix omits the scheme, HTTPS is assumed. Notice that HTTP + links are automatically rewritten to HTTPS links. + """ + + name: str = proto.Field( + proto.STRING, + number=1, + ) + logo_url: str = proto.Field( + proto.STRING, + number=2, + ) + layout_properties: 'LayoutProperties' = proto.Field( + proto.MESSAGE, + number=3, + message='LayoutProperties', + ) + add_on_widget_set: addon_widget_set.AddOnWidgetSet = proto.Field( + proto.MESSAGE, + number=4, + message=addon_widget_set.AddOnWidgetSet, + ) + use_locale_from_app: bool = proto.Field( + proto.BOOL, + number=5, + ) + homepage_trigger: extension_point.HomepageExtensionPoint = proto.Field( + proto.MESSAGE, + number=6, + message=extension_point.HomepageExtensionPoint, + ) + universal_actions: MutableSequence[extension_point.UniversalActionExtensionPoint] = proto.RepeatedField( + proto.MESSAGE, + number=7, + message=extension_point.UniversalActionExtensionPoint, + ) + open_link_url_prefixes: struct_pb2.ListValue = proto.Field( + proto.MESSAGE, + number=8, + message=struct_pb2.ListValue, + ) + + +class LayoutProperties(proto.Message): + r"""Card layout properties shared across all add-on host + applications. + + Attributes: + primary_color (str): + The primary color of the add-on. It sets the + color of toolbar. If no primary color is set + explicitly, the default value provided by the + framework is used. + secondary_color (str): + The secondary color of the add-on. It sets + the color of buttons. If primary color is set + but no secondary color is set, the secondary + color is the same as the primary color. If + neither primary color nor secondary color is + set, the default value provided by the framework + is used. + """ + + primary_color: str = proto.Field( + proto.STRING, + number=1, + ) + secondary_color: str = proto.Field( + proto.STRING, + number=2, + ) + + +class HttpOptions(proto.Message): + r"""Options for sending requests to add-on HTTP endpoints + + Attributes: + authorization_header (google.apps.script.type.types.HttpAuthorizationHeader): + Configuration for the token sent in the HTTP + Authorization header + """ + + authorization_header: 'HttpAuthorizationHeader' = proto.Field( + proto.ENUM, + number=1, + enum='HttpAuthorizationHeader', + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/owl-bot-staging/google-apps-script-type/type-py/mypy.ini b/owl-bot-staging/google-apps-script-type/type-py/mypy.ini new file mode 100644 index 000000000000..574c5aed394b --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/mypy.ini @@ -0,0 +1,3 @@ +[mypy] +python_version = 3.7 +namespace_packages = True diff --git a/owl-bot-staging/google-apps-script-type/type-py/noxfile.py b/owl-bot-staging/google-apps-script-type/type-py/noxfile.py new file mode 100644 index 000000000000..258a99b0aa92 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/noxfile.py @@ -0,0 +1,184 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import os +import pathlib +import shutil +import subprocess +import sys + + +import nox # type: ignore + +ALL_PYTHON = [ + "3.7", + "3.8", + "3.9", + "3.10", + "3.11", +] + +CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() + +LOWER_BOUND_CONSTRAINTS_FILE = CURRENT_DIRECTORY / "constraints.txt" +PACKAGE_NAME = subprocess.check_output([sys.executable, "setup.py", "--name"], encoding="utf-8") + +BLACK_VERSION = "black==22.3.0" +BLACK_PATHS = ["docs", "google", "tests", "samples", "noxfile.py", "setup.py"] +DEFAULT_PYTHON_VERSION = "3.11" + +nox.sessions = [ + "unit", + "cover", + "mypy", + "check_lower_bounds" + # exclude update_lower_bounds from default + "docs", + "blacken", + "lint", + "lint_setup_py", +] + +@nox.session(python=ALL_PYTHON) +def unit(session): + """Run the unit test suite.""" + + session.install('coverage', 'pytest', 'pytest-cov', 'pytest-asyncio', 'asyncmock; python_version < "3.8"') + session.install('-e', '.') + + session.run( + 'py.test', + '--quiet', + '--cov=google/apps/script/type/', + '--cov=tests/', + '--cov-config=.coveragerc', + '--cov-report=term', + '--cov-report=html', + os.path.join('tests', 'unit', ''.join(session.posargs)) + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def cover(session): + """Run the final coverage report. + This outputs the coverage report aggregating coverage from the unit + test runs (not system test runs), and then erases coverage data. + """ + session.install("coverage", "pytest-cov") + session.run("coverage", "report", "--show-missing", "--fail-under=100") + + session.run("coverage", "erase") + + +@nox.session(python=ALL_PYTHON) +def mypy(session): + """Run the type checker.""" + session.install( + 'mypy', + 'types-requests', + 'types-protobuf' + ) + session.install('.') + session.run( + 'mypy', + '--explicit-package-bases', + 'google', + ) + + +@nox.session +def update_lower_bounds(session): + """Update lower bounds in constraints.txt to match setup.py""" + session.install('google-cloud-testutils') + session.install('.') + + session.run( + 'lower-bound-checker', + 'update', + '--package-name', + PACKAGE_NAME, + '--constraints-file', + str(LOWER_BOUND_CONSTRAINTS_FILE), + ) + + +@nox.session +def check_lower_bounds(session): + """Check lower bounds in setup.py are reflected in constraints file""" + session.install('google-cloud-testutils') + session.install('.') + + session.run( + 'lower-bound-checker', + 'check', + '--package-name', + PACKAGE_NAME, + '--constraints-file', + str(LOWER_BOUND_CONSTRAINTS_FILE), + ) + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def docs(session): + """Build the docs for this library.""" + + session.install("-e", ".") + session.install("sphinx==7.0.1", "alabaster", "recommonmark") + + shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) + session.run( + "sphinx-build", + "-W", # warnings as errors + "-T", # show full traceback on exception + "-N", # no colors + "-b", + "html", + "-d", + os.path.join("docs", "_build", "doctrees", ""), + os.path.join("docs", ""), + os.path.join("docs", "_build", "html", ""), + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def lint(session): + """Run linters. + + Returns a failure if the linters find linting errors or sufficiently + serious code quality issues. + """ + session.install("flake8", BLACK_VERSION) + session.run( + "black", + "--check", + *BLACK_PATHS, + ) + session.run("flake8", "google", "tests", "samples") + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def blacken(session): + """Run black. Format code to uniform standard.""" + session.install(BLACK_VERSION) + session.run( + "black", + *BLACK_PATHS, + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def lint_setup_py(session): + """Verify that setup.py is valid (including RST check).""" + session.install("docutils", "pygments") + session.run("python", "setup.py", "check", "--restructuredtext", "--strict") diff --git a/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_type_keywords.py b/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_type_keywords.py new file mode 100644 index 000000000000..f2e069a0f033 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/scripts/fixup_type_keywords.py @@ -0,0 +1,175 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import argparse +import os +import libcst as cst +import pathlib +import sys +from typing import (Any, Callable, Dict, List, Sequence, Tuple) + + +def partition( + predicate: Callable[[Any], bool], + iterator: Sequence[Any] +) -> Tuple[List[Any], List[Any]]: + """A stable, out-of-place partition.""" + results = ([], []) + + for i in iterator: + results[int(predicate(i))].append(i) + + # Returns trueList, falseList + return results[1], results[0] + + +class typeCallTransformer(cst.CSTTransformer): + CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') + METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { + } + + def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: + try: + key = original.func.attr.value + kword_params = self.METHOD_TO_PARAMS[key] + except (AttributeError, KeyError): + # Either not a method from the API or too convoluted to be sure. + return updated + + # If the existing code is valid, keyword args come after positional args. + # Therefore, all positional args must map to the first parameters. + args, kwargs = partition(lambda a: not bool(a.keyword), updated.args) + if any(k.keyword.value == "request" for k in kwargs): + # We've already fixed this file, don't fix it again. + return updated + + kwargs, ctrl_kwargs = partition( + lambda a: a.keyword.value not in self.CTRL_PARAMS, + kwargs + ) + + args, ctrl_args = args[:len(kword_params)], args[len(kword_params):] + ctrl_kwargs.extend(cst.Arg(value=a.value, keyword=cst.Name(value=ctrl)) + for a, ctrl in zip(ctrl_args, self.CTRL_PARAMS)) + + request_arg = cst.Arg( + value=cst.Dict([ + cst.DictElement( + cst.SimpleString("'{}'".format(name)), +cst.Element(value=arg.value) + ) + # Note: the args + kwargs looks silly, but keep in mind that + # the control parameters had to be stripped out, and that + # those could have been passed positionally or by keyword. + for name, arg in zip(kword_params, args + kwargs)]), + keyword=cst.Name("request") + ) + + return updated.with_changes( + args=[request_arg] + ctrl_kwargs + ) + + +def fix_files( + in_dir: pathlib.Path, + out_dir: pathlib.Path, + *, + transformer=typeCallTransformer(), +): + """Duplicate the input dir to the output dir, fixing file method calls. + + Preconditions: + * in_dir is a real directory + * out_dir is a real, empty directory + """ + pyfile_gen = ( + pathlib.Path(os.path.join(root, f)) + for root, _, files in os.walk(in_dir) + for f in files if os.path.splitext(f)[1] == ".py" + ) + + for fpath in pyfile_gen: + with open(fpath, 'r') as f: + src = f.read() + + # Parse the code and insert method call fixes. + tree = cst.parse_module(src) + updated = tree.visit(transformer) + + # Create the path and directory structure for the new file. + updated_path = out_dir.joinpath(fpath.relative_to(in_dir)) + updated_path.parent.mkdir(parents=True, exist_ok=True) + + # Generate the updated source file at the corresponding path. + with open(updated_path, 'w') as f: + f.write(updated.code) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser( + description="""Fix up source that uses the type client library. + +The existing sources are NOT overwritten but are copied to output_dir with changes made. + +Note: This tool operates at a best-effort level at converting positional + parameters in client method calls to keyword based parameters. + Cases where it WILL FAIL include + A) * or ** expansion in a method call. + B) Calls via function or method alias (includes free function calls) + C) Indirect or dispatched calls (e.g. the method is looked up dynamically) + + These all constitute false negatives. The tool will also detect false + positives when an API method shares a name with another method. +""") + parser.add_argument( + '-d', + '--input-directory', + required=True, + dest='input_dir', + help='the input directory to walk for python files to fix up', + ) + parser.add_argument( + '-o', + '--output-directory', + required=True, + dest='output_dir', + help='the directory to output files fixed via un-flattening', + ) + args = parser.parse_args() + input_dir = pathlib.Path(args.input_dir) + output_dir = pathlib.Path(args.output_dir) + if not input_dir.is_dir(): + print( + f"input directory '{input_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if not output_dir.is_dir(): + print( + f"output directory '{output_dir}' does not exist or is not a directory", + file=sys.stderr, + ) + sys.exit(-1) + + if os.listdir(output_dir): + print( + f"output directory '{output_dir}' is not empty", + file=sys.stderr, + ) + sys.exit(-1) + + fix_files(input_dir, output_dir) diff --git a/owl-bot-staging/google-apps-script-type/type-py/setup.py b/owl-bot-staging/google-apps-script-type/type-py/setup.py new file mode 100644 index 000000000000..1fbb704e47dc --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/setup.py @@ -0,0 +1,90 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import io +import os + +import setuptools # type: ignore + +package_root = os.path.abspath(os.path.dirname(__file__)) + +name = 'google-apps-script-type' + + +description = "Google Apps Script Type API client library" + +version = {} +with open(os.path.join(package_root, 'google/apps/script/type/gapic_version.py')) as fp: + exec(fp.read(), version) +version = version["__version__"] + +if version[0] == "0": + release_status = "Development Status :: 4 - Beta" +else: + release_status = "Development Status :: 5 - Production/Stable" + +dependencies = [ + "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", + "proto-plus >= 1.22.0, <2.0.0dev", + "proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'", + "protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", +] +url = "https://github.com/googleapis/python-apps-script-type" + +package_root = os.path.abspath(os.path.dirname(__file__)) + +readme_filename = os.path.join(package_root, "README.rst") +with io.open(readme_filename, encoding="utf-8") as readme_file: + readme = readme_file.read() + +packages = [ + package + for package in setuptools.PEP420PackageFinder.find() + if package.startswith("google") +] + +namespaces = ["google", "google.apps", "google.apps.script"] + +setuptools.setup( + name=name, + version=version, + description=description, + long_description=readme, + author="Google LLC", + author_email="googleapis-packages@google.com", + license="Apache 2.0", + url=url, + classifiers=[ + release_status, + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Operating System :: OS Independent", + "Topic :: Internet", + ], + platforms="Posix; MacOS X; Windows", + packages=packages, + python_requires=">=3.7", + namespace_packages=namespaces, + install_requires=dependencies, + include_package_data=True, + zip_safe=False, +) diff --git a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.10.txt b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.10.txt new file mode 100644 index 000000000000..ed7f9aed2559 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.10.txt @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf diff --git a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.11.txt b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.11.txt new file mode 100644 index 000000000000..ed7f9aed2559 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.11.txt @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf diff --git a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.12.txt b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.12.txt new file mode 100644 index 000000000000..ed7f9aed2559 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.12.txt @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf diff --git a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.7.txt b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.7.txt new file mode 100644 index 000000000000..6c44adfea7ee --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.7.txt @@ -0,0 +1,9 @@ +# This constraints file is used to check that lower bounds +# are correct in setup.py +# List all library dependencies and extras in this file. +# Pin the version to the lower bound. +# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", +# Then this file should have google-cloud-foo==1.14.0 +google-api-core==1.34.0 +proto-plus==1.22.0 +protobuf==3.19.5 diff --git a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.8.txt b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.8.txt new file mode 100644 index 000000000000..ed7f9aed2559 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.8.txt @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf diff --git a/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.9.txt b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.9.txt new file mode 100644 index 000000000000..ed7f9aed2559 --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/testing/constraints-3.9.txt @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf diff --git a/owl-bot-staging/google-apps-script-type/type-py/tests/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/tests/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/tests/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/type/__init__.py b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/type/__init__.py new file mode 100644 index 000000000000..1b4db446eb8d --- /dev/null +++ b/owl-bot-staging/google-apps-script-type/type-py/tests/unit/gapic/type/__init__.py @@ -0,0 +1,16 @@ + +# -*- coding: utf-8 -*- +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#