Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

feat: add async client, add common resource helpers, add from_service_account_info factory #30

Merged
merged 1 commit into from Jan 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Expand Up @@ -20,7 +20,7 @@ If you are still having issues, please be sure to include as much information as
- OS type and version:
- Python version: `python --version`
- pip version: `pip --version`
- `google-cloud-recpatcha-enterprise` version: `pip show google-cloud-recpatcha-enterprise`
- `google-cloud-recpatchaenterprise` version: `pip show google-cloud-recpatchaenterprise`

#### Steps to reproduce

Expand Down
16 changes: 10 additions & 6 deletions .kokoro/build.sh
Expand Up @@ -15,7 +15,11 @@

set -eo pipefail

cd github/python-recaptcha-enterprise
if [[ -z "${PROJECT_ROOT:-}" ]]; then
PROJECT_ROOT="github/python-recaptcha-enterprise"
fi

cd "${PROJECT_ROOT}"

# Disable buffering, so that the logs stream through.
export PYTHONUNBUFFERED=1
Expand All @@ -30,16 +34,16 @@ export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json
export PROJECT_ID=$(cat "${KOKORO_GFILE_DIR}/project-id.json")

# Remove old nox
python3.6 -m pip uninstall --yes --quiet nox-automation
python3 -m pip uninstall --yes --quiet nox-automation

# Install nox
python3.6 -m pip install --upgrade --quiet nox
python3.6 -m nox --version
python3 -m pip install --upgrade --quiet nox
python3 -m nox --version

# If NOX_SESSION is set, it only runs the specified session,
# otherwise run all the sessions.
if [[ -n "${NOX_SESSION:-}" ]]; then
python3.6 -m nox -s "${NOX_SESSION:-}"
python3 -m nox -s ${NOX_SESSION:-}
else
python3.6 -m nox
python3 -m nox
fi
11 changes: 11 additions & 0 deletions .kokoro/docs/docs-presubmit.cfg
Expand Up @@ -15,3 +15,14 @@ env_vars: {
key: "TRAMPOLINE_IMAGE_UPLOAD"
value: "false"
}

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/python-recaptcha-enterprise/.kokoro/build.sh"
}

# Only run this nox session.
env_vars: {
key: "NOX_SESSION"
value: "docs docfx"
}
2 changes: 2 additions & 0 deletions .trampolinerc
Expand Up @@ -18,12 +18,14 @@
required_envvars+=(
"STAGING_BUCKET"
"V2_STAGING_BUCKET"
"NOX_SESSION"
)

# Add env vars which are passed down into the container here.
pass_down_envvars+=(
"STAGING_BUCKET"
"V2_STAGING_BUCKET"
"NOX_SESSION"
)

# Prevent unintentional override on the default image.
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Expand Up @@ -193,7 +193,7 @@ instead of
``https://github.com/googleapis/python-recaptcha-enterprise/blob/master/CONTRIBUTING.rst``)
may cause problems creating links or rendering the description.

.. _description on PyPI: https://pypi.org/project/google-cloud-recpatcha-enterprise
.. _description on PyPI: https://pypi.org/project/google-cloud-recpatchaenterprise


*************************
Expand Down
7 changes: 4 additions & 3 deletions LICENSE
@@ -1,6 +1,7 @@
Apache License

Apache License
Version 2.0, January 2004
https://www.apache.org/licenses/
http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

Expand Down Expand Up @@ -192,7 +193,7 @@
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
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,
Expand Down
7 changes: 6 additions & 1 deletion docs/_static/custom.css
@@ -1,4 +1,9 @@
div#python2-eol {
border-color: red;
border-width: medium;
}
}

/* Ensure minimum width for 'Parameters' / 'Returns' column */
dl.field-list > dt {
min-width: 100px
}
24 changes: 12 additions & 12 deletions docs/conf.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# google-cloud-recpatcha-enterprise documentation build configuration file
# google-cloud-recpatchaenterprise documentation build configuration file
#
# This file is execfile()d with the current directory set to its
# containing dir.
Expand Down Expand Up @@ -67,7 +67,7 @@
master_doc = "index"

# General information about the project.
project = u"google-cloud-recpatcha-enterprise"
project = u"google-cloud-recpatchaenterprise"
copyright = u"2019, Google"
author = u"Google APIs"

Expand Down Expand Up @@ -140,7 +140,7 @@
# further. For a list of options available for each theme, see the
# documentation.
html_theme_options = {
"description": "Google Cloud Client Libraries for google-cloud-recpatcha-enterprise",
"description": "Google Cloud Client Libraries for google-cloud-recpatchaenterprise",
"github_user": "googleapis",
"github_repo": "python-recaptcha-enterprise",
"github_banner": True,
Expand Down Expand Up @@ -234,7 +234,7 @@
# html_search_scorer = 'scorer.js'

# Output file base name for HTML help builder.
htmlhelp_basename = "google-cloud-recpatcha-enterprise-doc"
htmlhelp_basename = "google-cloud-recpatchaenterprise-doc"

# -- Options for warnings ------------------------------------------------------

Expand Down Expand Up @@ -267,8 +267,8 @@
latex_documents = [
(
master_doc,
"google-cloud-recpatcha-enterprise.tex",
u"google-cloud-recpatcha-enterprise Documentation",
"google-cloud-recpatchaenterprise.tex",
u"google-cloud-recpatchaenterprise Documentation",
author,
"manual",
)
Expand Down Expand Up @@ -302,8 +302,8 @@
man_pages = [
(
master_doc,
"google-cloud-recpatcha-enterprise",
u"google-cloud-recpatcha-enterprise Documentation",
"google-cloud-recpatchaenterprise",
u"google-cloud-recpatchaenterprise Documentation",
[author],
1,
)
Expand All @@ -321,11 +321,11 @@
texinfo_documents = [
(
master_doc,
"google-cloud-recpatcha-enterprise",
u"google-cloud-recpatcha-enterprise Documentation",
"google-cloud-recpatchaenterprise",
u"google-cloud-recpatchaenterprise Documentation",
author,
"google-cloud-recpatcha-enterprise",
"google-cloud-recpatcha-enterprise Library",
"google-cloud-recpatchaenterprise",
"google-cloud-recpatchaenterprise Library",
"APIs",
)
]
Expand Down
11 changes: 11 additions & 0 deletions docs/recaptchaenterprise_v1/recaptcha_enterprise_service.rst
@@ -0,0 +1,11 @@
RecaptchaEnterpriseService
--------------------------------------------

.. automodule:: google.cloud.recaptchaenterprise_v1.services.recaptcha_enterprise_service
:members:
:inherited-members:


.. automodule:: google.cloud.recaptchaenterprise_v1.services.recaptcha_enterprise_service.pagers
:members:
:inherited-members:
10 changes: 5 additions & 5 deletions docs/recaptchaenterprise_v1/services.rst
@@ -1,6 +1,6 @@
Client for Google Cloud Recaptchaenterprise API
===============================================
Services for Google Cloud Recaptchaenterprise v1 API
====================================================
.. toctree::
:maxdepth: 2

.. automodule:: google.cloud.recaptchaenterprise_v1
:members:
:inherited-members:
recaptcha_enterprise_service
6 changes: 4 additions & 2 deletions docs/recaptchaenterprise_v1/types.rst
@@ -1,5 +1,7 @@
Types for Google Cloud Recaptchaenterprise API
==============================================
Types for Google Cloud Recaptchaenterprise v1 API
=================================================

.. automodule:: google.cloud.recaptchaenterprise_v1.types
:members:
:undoc-members:
:show-inheritance:
5 changes: 4 additions & 1 deletion google/cloud/recaptchaenterprise/__init__.py
Expand Up @@ -15,7 +15,9 @@
# limitations under the License.
#


from google.cloud.recaptchaenterprise_v1.services.recaptcha_enterprise_service.async_client import (
RecaptchaEnterpriseServiceAsyncClient,
)
from google.cloud.recaptchaenterprise_v1.services.recaptcha_enterprise_service.client import (
RecaptchaEnterpriseServiceClient,
)
Expand Down Expand Up @@ -71,6 +73,7 @@
"Key",
"ListKeysRequest",
"ListKeysResponse",
"RecaptchaEnterpriseServiceAsyncClient",
"RecaptchaEnterpriseServiceClient",
"RiskAnalysis",
"TokenProperties",
Expand Down
1 change: 0 additions & 1 deletion google/cloud/recaptchaenterprise_v1/__init__.py
Expand Up @@ -15,7 +15,6 @@
# limitations under the License.
#


from .services.recaptcha_enterprise_service import RecaptchaEnterpriseServiceClient
from .types.recaptchaenterprise import AndroidKeySettings
from .types.recaptchaenterprise import AnnotateAssessmentRequest
Expand Down
Expand Up @@ -16,5 +16,9 @@
#

from .client import RecaptchaEnterpriseServiceClient
from .async_client import RecaptchaEnterpriseServiceAsyncClient

__all__ = ("RecaptchaEnterpriseServiceClient",)
__all__ = (
"RecaptchaEnterpriseServiceClient",
"RecaptchaEnterpriseServiceAsyncClient",
)