Skip to content
Permalink
Browse files
feat!: migrate to use microgen (#23)
* feat!: migrate to use microgen

* add comments

* remove google/cloud/errorreporting folder
  • Loading branch information
arithmetic1728 committed Aug 28, 2020
1 parent d876d94 commit cb41e3a1003cb4ef4e32efc8b5c5b5ba7d670f7d
Showing with 9,656 additions and 5,961 deletions.
  1. +6 −7 .coveragerc
  2. +4 −2 README.rst
  3. +12 −0 docs/errorreporting_v1beta1/services.rst
  4. +5 −0 docs/errorreporting_v1beta1/types.rst
  5. +0 −6 docs/gapic/v1beta1/api.rst
  6. +0 −5 docs/gapic/v1beta1/types.rst
  7. +2 −2 docs/index.rst
  8. +16 −9 google/cloud/error_reporting/_gapic.py
  9. +56 −26 google/cloud/errorreporting_v1beta1/__init__.py
  10. 0 google/cloud/errorreporting_v1beta1/gapic/__init__.py
  11. +0 −89 google/cloud/errorreporting_v1beta1/gapic/enums.py
  12. +0 −343 google/cloud/errorreporting_v1beta1/gapic/error_group_service_client.py
  13. +0 −33 google/cloud/errorreporting_v1beta1/gapic/error_group_service_client_config.py
  14. +0 −561 google/cloud/errorreporting_v1beta1/gapic/error_stats_service_client.py
  15. +0 −38 google/cloud/errorreporting_v1beta1/gapic/error_stats_service_client_config.py
  16. +0 −292 google/cloud/errorreporting_v1beta1/gapic/report_errors_service_client.py
  17. +0 −28 google/cloud/errorreporting_v1beta1/gapic/report_errors_service_client_config.py
  18. 0 google/cloud/errorreporting_v1beta1/gapic/transports/__init__.py
  19. +0 −143 google/cloud/errorreporting_v1beta1/gapic/transports/error_group_service_grpc_transport.py
  20. +0 −155 google/cloud/errorreporting_v1beta1/gapic/transports/error_stats_service_grpc_transport.py
  21. +0 −136 google/cloud/errorreporting_v1beta1/gapic/transports/report_errors_service_grpc_transport.py
  22. 0 google/cloud/errorreporting_v1beta1/proto/__init__.py
  23. +0 −842 google/cloud/errorreporting_v1beta1/proto/common_pb2.py
  24. +0 −3 google/cloud/errorreporting_v1beta1/proto/common_pb2_grpc.py
  25. +0 −211 google/cloud/errorreporting_v1beta1/proto/error_group_service_pb2.py
  26. +0 −132 google/cloud/errorreporting_v1beta1/proto/error_group_service_pb2_grpc.py
  27. +0 −1,619 google/cloud/errorreporting_v1beta1/proto/error_stats_service_pb2.py
  28. +0 −175 google/cloud/errorreporting_v1beta1/proto/error_stats_service_pb2_grpc.py
  29. +0 −363 google/cloud/errorreporting_v1beta1/proto/report_errors_service_pb2.py
  30. +0 −92 google/cloud/errorreporting_v1beta1/proto/report_errors_service_pb2_grpc.py
  31. +0 −3 google/cloud/errorreporting_v1beta1/proto/synth.metadata
  32. +2 −0 google/cloud/errorreporting_v1beta1/py.typed
  33. +4 −10 google/{ → cloud/errorreporting_v1beta1/services}/__init__.py
  34. +10 −8 google/cloud/{ → errorreporting_v1beta1/services/error_group_service}/__init__.py
  35. +263 −0 google/cloud/errorreporting_v1beta1/services/error_group_service/async_client.py
  36. +407 −0 google/cloud/errorreporting_v1beta1/services/error_group_service/client.py
  37. +36 −0 google/cloud/errorreporting_v1beta1/services/error_group_service/transports/__init__.py
  38. +137 −0 google/cloud/errorreporting_v1beta1/services/error_group_service/transports/base.py
  39. +269 −0 google/cloud/errorreporting_v1beta1/services/error_group_service/transports/grpc.py
  40. +264 −0 google/cloud/errorreporting_v1beta1/services/error_group_service/transports/grpc_asyncio.py
  41. +24 −0 google/cloud/errorreporting_v1beta1/services/error_stats_service/__init__.py
  42. +385 −0 google/cloud/errorreporting_v1beta1/services/error_stats_service/async_client.py
  43. +522 −0 google/cloud/errorreporting_v1beta1/services/error_stats_service/client.py
  44. +277 −0 google/cloud/errorreporting_v1beta1/services/error_stats_service/pagers.py
  45. +36 −0 google/cloud/errorreporting_v1beta1/services/error_stats_service/transports/__init__.py
  46. +157 −0 google/cloud/errorreporting_v1beta1/services/error_stats_service/transports/base.py
  47. +302 −0 google/cloud/errorreporting_v1beta1/services/error_stats_service/transports/grpc.py
  48. +296 −0 google/cloud/errorreporting_v1beta1/services/error_stats_service/transports/grpc_asyncio.py
  49. +24 −0 google/cloud/errorreporting_v1beta1/services/report_errors_service/__init__.py
  50. +203 −0 google/cloud/errorreporting_v1beta1/services/report_errors_service/async_client.py
  51. +335 −0 google/cloud/errorreporting_v1beta1/services/report_errors_service/client.py
  52. +38 −0 google/cloud/errorreporting_v1beta1/services/report_errors_service/transports/__init__.py
  53. +127 −0 google/cloud/errorreporting_v1beta1/services/report_errors_service/transports/base.py
  54. +251 −0 google/cloud/errorreporting_v1beta1/services/report_errors_service/transports/grpc.py
  55. +244 −0 google/cloud/errorreporting_v1beta1/services/report_errors_service/transports/grpc_asyncio.py
  56. +0 −57 google/cloud/errorreporting_v1beta1/types.py
  57. +73 −0 google/cloud/errorreporting_v1beta1/types/__init__.py
  58. +249 −0 google/cloud/errorreporting_v1beta1/types/common.py
  59. +58 −0 google/cloud/errorreporting_v1beta1/types/error_group_service.py
  60. +420 −0 google/cloud/errorreporting_v1beta1/types/error_stats_service.py
  61. +115 −0 google/cloud/errorreporting_v1beta1/types/report_errors_service.py
  62. +3 −0 mypy.ini
  63. +5 −3 noxfile.py
  64. +183 −0 scripts/fixup_errorreporting_v1beta1_keywords.py
  65. +12 −6 setup.py
  66. +3 −3 synth.metadata
  67. +4 −88 synth.py
  68. +4 −4 tests/system/gapic/v1beta1/test_system_report_errors_service_v1beta1.py
  69. +13 −8 tests/system/test_system.py
  70. +1 −0 tests/unit/gapic/errorreporting_v1beta1/__init__.py
  71. +1,139 −0 tests/unit/gapic/errorreporting_v1beta1/test_error_group_service.py
  72. +1,693 −0 tests/unit/gapic/errorreporting_v1beta1/test_error_stats_service.py
  73. +959 −0 tests/unit/gapic/errorreporting_v1beta1/test_report_errors_service.py
  74. +0 −142 tests/unit/gapic/v1beta1/test_error_group_service_client_v1beta1.py
  75. +0 −205 tests/unit/gapic/v1beta1/test_error_stats_service_client_v1beta1.py
  76. +0 −104 tests/unit/gapic/v1beta1/test_report_errors_service_client_v1beta1.py
  77. +8 −8 tests/unit/test__gapic.py
@@ -21,15 +21,14 @@ branch = True
[report]
fail_under = 100
show_missing = True
omit = google/cloud/errorreporting/__init__.py, .nox/*
exclude_lines =
# Re-enable the standard pragma
pragma: NO COVER
# Ignore debug-only repr
def __repr__
# Ignore abstract methods
raise NotImplementedError
omit =
*/gapic/*.py
*/proto/*.py
*/core/*.py
*/site-packages/*.py
# Ignore pkg_resources exceptions.
# This is added at the module level as a safeguard for if someone
# generates the code and tries to run it without pip installing. This
# makes it virtually impossible to test properly.
except pkg_resources.DistributionNotFound
@@ -54,11 +54,13 @@ dependencies.

Supported Python Versions
^^^^^^^^^^^^^^^^^^^^^^^^^
Python >= 3.5
Python >= 3.6

Deprecated Python Versions
^^^^^^^^^^^^^^^^^^^^^^^^^^
Python == 2.7. Python 2.7 support will be removed on January 1, 2020.
Python == 2.7.

The last version of this library compatible with Python 2.7 is google-cloud-error-reporting==0.34.0.


Mac/Linux
@@ -0,0 +1,12 @@
Services for Google Cloud Errorreporting v1beta1 API
====================================================

.. automodule:: google.cloud.errorreporting_v1beta1.services.error_group_service
:members:
:inherited-members:
.. automodule:: google.cloud.errorreporting_v1beta1.services.error_stats_service
:members:
:inherited-members:
.. automodule:: google.cloud.errorreporting_v1beta1.services.report_errors_service
:members:
:inherited-members:
@@ -0,0 +1,5 @@
Types for Google Cloud Errorreporting v1beta1 API
=================================================

.. automodule:: google.cloud.errorreporting_v1beta1.types
:members:

This file was deleted.

This file was deleted.

@@ -19,8 +19,8 @@ API Reference

client
util
gapic/v1beta1/api
gapic/v1beta1/types
errorreporting_v1beta1/services
errorreporting_v1beta1/types


Changelog
@@ -13,10 +13,9 @@
# limitations under the License.

"""GAX wrapper for Error Reporting API requests."""
import json

from google.cloud.errorreporting_v1beta1.gapic import report_errors_service_client
from google.cloud.errorreporting_v1beta1.proto import report_errors_service_pb2
from google.protobuf.json_format import ParseDict
import google.cloud.errorreporting_v1beta1


def make_report_error_api(client):
@@ -28,7 +27,7 @@ def make_report_error_api(client):
:rtype: :class:_ErrorReportingGapicApi
:returns: An Error Reporting API instance.
"""
gapic_api = report_errors_service_client.ReportErrorsServiceClient(
gapic_api = google.cloud.errorreporting_v1beta1.ReportErrorsServiceClient(
credentials=client._credentials,
client_info=client._client_info,
client_options=client._client_options,
@@ -40,7 +39,7 @@ class _ErrorReportingGapicApi(object):
"""Helper mapping Error Reporting-related APIs
:type gapic:
:class:`report_errors_service_client.ReportErrorsServiceClient`
:class:`google.cloud.errorreporting_v1beta1.ReportErrorsServiceClient`
:param gapic: API object used to make RPCs.
:type project: str
@@ -62,7 +61,15 @@ def report_error_event(self, error_report):
Use
:meth:~`google.cloud.error_reporting.client._build_error_report`
"""
project_name = self._gapic_api.project_path(self._project)
error_report_payload = report_errors_service_pb2.ReportedErrorEvent()
ParseDict(error_report, error_report_payload)
self._gapic_api.report_error_event(project_name, error_report_payload)
project_name = f"projects/{self._project}"

# Since error_report uses camel case for key names (like serviceContext),
# but ReportedErrorEvent uses snake case for key names (like service_context),
# we need to route throught json.
error_report_payload = google.cloud.errorreporting_v1beta1.ReportedErrorEvent.from_json(
json.dumps(error_report)
)

self._gapic_api.report_error_event(
project_name=project_name, event=error_report_payload
)
@@ -1,45 +1,75 @@
# Copyright 2018 Google LLC
# -*- 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
# 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 absolute_import

from google.cloud.errorreporting_v1beta1 import types
from google.cloud.errorreporting_v1beta1.gapic import enums
from google.cloud.errorreporting_v1beta1.gapic import error_group_service_client
from google.cloud.errorreporting_v1beta1.gapic import error_stats_service_client
from google.cloud.errorreporting_v1beta1.gapic import report_errors_service_client


class ErrorGroupServiceClient(error_group_service_client.ErrorGroupServiceClient):
__doc__ = error_group_service_client.ErrorGroupServiceClient.__doc__
enums = enums


class ErrorStatsServiceClient(error_stats_service_client.ErrorStatsServiceClient):
__doc__ = error_stats_service_client.ErrorStatsServiceClient.__doc__
enums = enums


class ReportErrorsServiceClient(report_errors_service_client.ReportErrorsServiceClient):
__doc__ = report_errors_service_client.ReportErrorsServiceClient.__doc__
enums = enums
from .services.error_group_service import ErrorGroupServiceClient
from .services.error_stats_service import ErrorStatsServiceClient
from .services.report_errors_service import ReportErrorsServiceClient
from .types.common import ErrorContext
from .types.common import ErrorEvent
from .types.common import ErrorGroup
from .types.common import HttpRequestContext
from .types.common import ServiceContext
from .types.common import SourceLocation
from .types.common import TrackingIssue
from .types.error_group_service import GetGroupRequest
from .types.error_group_service import UpdateGroupRequest
from .types.error_stats_service import DeleteEventsRequest
from .types.error_stats_service import DeleteEventsResponse
from .types.error_stats_service import ErrorGroupOrder
from .types.error_stats_service import ErrorGroupStats
from .types.error_stats_service import ListEventsRequest
from .types.error_stats_service import ListEventsResponse
from .types.error_stats_service import ListGroupStatsRequest
from .types.error_stats_service import ListGroupStatsResponse
from .types.error_stats_service import QueryTimeRange
from .types.error_stats_service import ServiceContextFilter
from .types.error_stats_service import TimedCount
from .types.error_stats_service import TimedCountAlignment
from .types.report_errors_service import ReportErrorEventRequest
from .types.report_errors_service import ReportErrorEventResponse
from .types.report_errors_service import ReportedErrorEvent


__all__ = (
"enums",
"types",
"DeleteEventsRequest",
"DeleteEventsResponse",
"ErrorContext",
"ErrorEvent",
"ErrorGroup",
"ErrorGroupOrder",
"ErrorGroupServiceClient",
"ErrorGroupStats",
"ErrorStatsServiceClient",
"GetGroupRequest",
"HttpRequestContext",
"ListEventsRequest",
"ListEventsResponse",
"ListGroupStatsRequest",
"ListGroupStatsResponse",
"QueryTimeRange",
"ReportErrorEventRequest",
"ReportErrorEventResponse",
"ReportedErrorEvent",
"ServiceContext",
"ServiceContextFilter",
"SourceLocation",
"TimedCount",
"TimedCountAlignment",
"TrackingIssue",
"UpdateGroupRequest",
"ReportErrorsServiceClient",
)
Empty file.

This file was deleted.

Loading

0 comments on commit cb41e3a

Please sign in to comment.