-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Docs: clarify required scope for Gmail users.messages.batchDelete #2716
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
lshariprasad
wants to merge
2
commits into
googleapis:main
Choose a base branch
from
lshariprasad:docs-fix-2710
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,43 +1,157 @@ | ||
| # Contributor Code of Conduct | ||
|
|
||
| As contributors and maintainers of this project, | ||
| and in the interest of fostering an open and welcoming community, | ||
| we pledge to respect all people who contribute through reporting issues, | ||
| posting feature requests, updating documentation, | ||
| submitting pull requests or patches, and other activities. | ||
|
|
||
| We are committed to making participation in this project | ||
| a harassment-free experience for everyone, | ||
| regardless of level of experience, gender, gender identity and expression, | ||
| sexual orientation, disability, personal appearance, | ||
| body size, race, ethnicity, age, religion, or nationality. | ||
|
|
||
| Examples of unacceptable behavior by participants include: | ||
|
|
||
| * The use of sexualized language or imagery | ||
| * Personal attacks | ||
| * Trolling or insulting/derogatory comments | ||
| * Public or private harassment | ||
| * Publishing other's private information, | ||
| such as physical or electronic | ||
| addresses, without explicit permission | ||
| * Other unethical or unprofessional conduct. | ||
|
|
||
| Project maintainers have the right and responsibility to remove, edit, or reject | ||
| comments, commits, code, wiki edits, issues, and other contributions | ||
| that are not aligned to this Code of Conduct. | ||
| By adopting this Code of Conduct, | ||
| project maintainers commit themselves to fairly and consistently | ||
| applying these principles to every aspect of managing this project. | ||
| Project maintainers who do not follow or enforce the Code of Conduct | ||
| may be permanently removed from the project team. | ||
|
|
||
| This code of conduct applies both within project spaces and in public spaces | ||
| when an individual is representing the project or its community. | ||
|
|
||
| Instances of abusive, harassing, or otherwise unacceptable behavior | ||
| may be reported by opening an issue | ||
| or contacting one or more of the project maintainers. | ||
|
|
||
| This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, | ||
| available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) | ||
| # Contributor Covenant Code of Conduct | ||
|
|
||
| ## Our Pledge | ||
|
|
||
| We as members, contributors, and leaders pledge to make participation in our | ||
| community a harassment-free experience for everyone, regardless of age, body | ||
| size, visible or invisible disability, ethnicity, sex characteristics, gender | ||
| identity and expression, level of experience, education, socio-economic status, | ||
| nationality, personal appearance, race, religion, or sexual identity | ||
| and orientation. | ||
|
|
||
| We pledge to act and interact in ways that contribute to an open, welcoming, | ||
| diverse, inclusive, and healthy community. | ||
|
|
||
| --- | ||
|
|
||
| ## Our Standards | ||
|
|
||
| Examples of behavior that contributes to a positive environment for our | ||
| community include: | ||
|
|
||
| - Demonstrating empathy and kindness toward other people | ||
| - Being respectful of differing opinions, viewpoints, and experiences | ||
| - Giving and gracefully accepting constructive feedback | ||
| - Accepting responsibility and apologizing to those affected by our mistakes, | ||
| and learning from the experience | ||
| - Focusing on what is best not just for us as individuals, but for the overall | ||
| community | ||
|
|
||
| Examples of unacceptable behavior include: | ||
|
|
||
| - The use of sexualized language or imagery, and sexual attention or advances of any kind | ||
| - Trolling, insulting or derogatory comments, and personal or political attacks | ||
| - Public or private harassment | ||
| - Publishing others’ private information, such as a physical or email address, | ||
| without their explicit permission | ||
| - Violence, threats of violence, or encouraging others to engage in violence | ||
| - Stalking or following someone without consent | ||
| - Unwelcome sexual attention | ||
| - Hate speech, slurs, or discriminatory jokes | ||
| - Other conduct which could reasonably be considered inappropriate in a | ||
| professional setting | ||
|
|
||
| --- | ||
|
|
||
| ## Enforcement Responsibilities | ||
|
|
||
| Community leaders are responsible for clarifying and enforcing our standards of | ||
| acceptable behavior and will take appropriate and fair corrective action in | ||
| response to any behavior that they deem inappropriate, threatening, offensive, | ||
| or harmful. | ||
|
|
||
| Community leaders have the right and responsibility to remove, edit, or reject | ||
| comments, commits, code, wiki edits, issues, and other contributions that are | ||
| not aligned to this Code of Conduct, and will communicate reasons for moderation | ||
| decisions when appropriate. | ||
|
|
||
| --- | ||
|
|
||
| ## Scope | ||
|
|
||
| This Code of Conduct applies within all community spaces, and also applies when | ||
| an individual is officially representing the community in public spaces. | ||
| Examples of representing our community include using an official email address, | ||
| posting via an official social media account, or acting as an appointed | ||
| representative at an online or offline event. | ||
|
|
||
| --- | ||
|
|
||
| ## Enforcement | ||
|
|
||
| Instances of abusive, harassing, or otherwise unacceptable behavior may be | ||
| reported to the community leaders responsible for enforcement. | ||
|
|
||
| To report an incident, you may: | ||
|
|
||
| - Open an issue in this repository, OR | ||
| - Contact the maintainers directly | ||
|
|
||
| Project maintainers will review and investigate all reports promptly and fairly. | ||
|
|
||
| All complaints will be reviewed and investigated promptly and fairly. | ||
|
|
||
| All community leaders are obligated to respect the privacy and security of the | ||
| reporter of any incident. | ||
|
|
||
| --- | ||
|
|
||
| ## Enforcement Guidelines | ||
|
|
||
| Community leaders will follow these Community Impact Guidelines in determining | ||
| the consequences for any action they deem in violation of this Code of Conduct: | ||
|
|
||
| ### 1. Correction | ||
|
|
||
| **Community Impact:** Use of inappropriate language or other behavior deemed | ||
| unprofessional or unwelcome in the community. | ||
|
|
||
| **Consequence:** A private, written warning from community leaders, providing | ||
| clarity around the nature of the violation and an explanation of why the | ||
| behavior was inappropriate. A public apology may be requested. | ||
|
|
||
| --- | ||
|
|
||
| ### 2. Warning | ||
|
|
||
| **Community Impact:** A violation through a single incident or series of | ||
| actions. | ||
|
|
||
| **Consequence:** A warning with consequences for continued behavior. No | ||
| interaction with the people involved for a specified period of time. This | ||
| includes avoiding interactions in community spaces as well as external channels | ||
| like social media. Violating these terms may lead to a temporary or permanent | ||
| ban. | ||
|
|
||
| --- | ||
|
|
||
| ### 3. Temporary Ban | ||
|
|
||
| **Community Impact:** A serious violation of community standards, including | ||
| sustained inappropriate behavior. | ||
|
|
||
| **Consequence:** A temporary ban from any sort of interaction or public | ||
| communication with the community for a specified period of time. No public or | ||
| private interaction with the people involved, including unsolicited interaction | ||
| with those enforcing the Code of Conduct, is allowed during this period. | ||
| Violating these terms may lead to a permanent ban. | ||
|
|
||
| --- | ||
|
|
||
| ### 4. Permanent Ban | ||
|
|
||
| **Community Impact:** Demonstrating a pattern of violation of community | ||
| standards, including sustained inappropriate behavior, harassment of an | ||
| individual, or aggression toward or disparagement of classes of individuals. | ||
|
|
||
| **Consequence:** A permanent ban from any sort of public interaction within the | ||
| community. | ||
|
|
||
| --- | ||
|
|
||
| ## Attribution | ||
|
|
||
| This Code of Conduct is adapted from the Contributor Covenant, version 2.1, | ||
| available at: | ||
|
|
||
| https://www.contributor-covenant.org/version/2/1/code_of_conduct.html | ||
|
|
||
| Community Impact Guidelines were inspired by Mozilla’s code of conduct | ||
| enforcement ladder. | ||
|
|
||
| For answers to common questions about this code of conduct, see: | ||
|
|
||
| https://www.contributor-covenant.org/faq | ||
|
|
||
|
|
||
| git remote add upstream https://github.com/original-owner/repo-name.git | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,53 +1,65 @@ | ||
| #!/usr/bin/env python | ||
| # -*- coding: utf-8 -*- | ||
| # | ||
| # Copyright 2014 Google Inc. 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. | ||
| # 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. | ||
|
|
||
| """Copy files from source to dest expanding symlinks along the way. | ||
| """ | ||
| #!/usr/bin/env python3 | ||
| # Copyright 2026 Google LLC | ||
|
|
||
| import argparse | ||
| from shutil import copytree | ||
| import shutil | ||
| import sys | ||
| from pathlib import Path | ||
|
|
||
| # Ignore these files and directories when copying over files into the snapshot. | ||
| IGNORE = set([".hg", "httplib2", "oauth2", "simplejson", "static"]) | ||
| # --- Configuration: Optimized for 2026 Standards --- | ||
| # Ignore internal library folders and VCS metadata | ||
| IGNORE = {".hg", ".git", "httplib2", "oauth2", "simplejson", "static"} | ||
| IGNORE_IN_SAMPLES = {"googleapiclient", "oauth2client", "uritemplate"} | ||
|
|
||
| # In addition to the above files also ignore these files and directories when | ||
| # copying over samples into the snapshot. | ||
| IGNORE_IN_SAMPLES = set(["googleapiclient", "oauth2client", "uritemplate"]) | ||
| def _get_ignore_callback(source_root): | ||
| """ | ||
| ULTIMATE TIME: Pre-calculates path logic to ensure O(1) decision making. | ||
| """ | ||
|
Comment on lines
+9
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| source_root = Path(source_root).resolve() | ||
|
|
||
| parser = argparse.ArgumentParser(description=__doc__) | ||
| def ignore_func(path, names): | ||
| current_path = Path(path).resolve() | ||
| ignored = set() | ||
|
|
||
| # Apply sample-specific ignores if we aren't in the root | ||
| if current_path != source_root: | ||
| ignored.update(IGNORE_IN_SAMPLES.intersection(names)) | ||
|
|
||
| # Apply global ignores | ||
| ignored.update(IGNORE.intersection(names)) | ||
| return list(ignored) | ||
|
|
||
| return ignore_func | ||
|
|
||
| parser.add_argument("--source", default=".", help="Directory name to copy from.") | ||
| def main(args): | ||
| source = Path(args.source) | ||
| dest = Path(args.dest) | ||
|
|
||
| parser.add_argument("--dest", default="snapshot", help="Directory name to copy to.") | ||
|
|
||
|
|
||
| def _ignore(path, names): | ||
| retval = set() | ||
| if path != ".": | ||
| retval = retval.union(IGNORE_IN_SAMPLES.intersection(names)) | ||
| retval = retval.union(IGNORE.intersection(names)) | ||
| return retval | ||
|
|
||
|
|
||
| def main(): | ||
| copytree(FLAGS.source, FLAGS.dest, symlinks=True, ignore=_ignore) | ||
| # SPACE: Remove existing destination to prevent merge conflicts | ||
| if dest.exists(): | ||
| shutil.rmtree(dest) | ||
|
|
||
| try: | ||
| # ULTIMATE SPACE: symlinks=False expands (copies) the actual content | ||
| # of the symlink rather than just copying the link itself. | ||
| shutil.copytree( | ||
| source, | ||
| dest, | ||
| symlinks=False, | ||
| ignore=_get_ignore_callback(source), | ||
| dirs_exist_ok=True | ||
| ) | ||
| print(f"Successfully created snapshot at: {dest}") | ||
| except Exception as e: | ||
| print(f"Error during snapshot creation: {e}", file=sys.stderr) | ||
| sys.exit(1) | ||
|
|
||
| if __name__ == "__main__": | ||
| FLAGS = parser.parse_args(sys.argv[1:]) | ||
| main() | ||
| parser = argparse.ArgumentParser( | ||
| description="Copy source to dest expanding symlinks and filtering internals." | ||
| ) | ||
| parser.add_argument("--source", default=".", help="Source directory.") | ||
| parser.add_argument("--dest", default="snapshot", help="Destination directory.") | ||
|
|
||
| # Resolve 'FLAGS' issue by passing parsed args directly | ||
| main(parser.parse_args()) | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line appears to be a stray git command and should be removed from the Code of Conduct.