Skip to content

Commit

Permalink
feat: add async client, add common resource helpers, add from_service…
Browse files Browse the repository at this point in the history
…_account_info factory (#30)
  • Loading branch information
busunkim96 authored Jan 19, 2021
1 parent 38caca2 commit 9c0989b
Show file tree
Hide file tree
Showing 30 changed files with 3,761 additions and 548 deletions.
Original file line number Diff line number Diff line change
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 packages/google-cloud-recaptcha-enterprise/.kokoro/build.sh
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 packages/google-cloud-recaptcha-enterprise/.trampolinerc
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 packages/google-cloud-recaptcha-enterprise/LICENSE
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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 packages/google-cloud-recaptcha-enterprise/docs/conf.py
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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:
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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:
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,9 @@
#

from .client import RecaptchaEnterpriseServiceClient
from .async_client import RecaptchaEnterpriseServiceAsyncClient

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

0 comments on commit 9c0989b

Please sign in to comment.