Skip to content

Commit

Permalink
refactor: replace generated files (#146)
Browse files Browse the repository at this point in the history
* fix: remove outdated files

* refactor: replace generated files

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
engelke and gcf-owl-bot[bot] committed Feb 7, 2023
1 parent 888ccc5 commit 62ce8ff
Show file tree
Hide file tree
Showing 261 changed files with 18,876 additions and 122 deletions.
36 changes: 12 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,8 @@

[![PyPI version](https://badge.fury.io/py/google-events.svg)](https://badge.fury.io/py/google-events)

This library provides classes of common event types used with Google services.
At this moment the following types are available:

| Package | Python Class | Description |
| ------------- | ------------- | ------------- |
| google.events.cloud.scheduler.v1 | SchedulerJobData | Scheduler job data. |
| google.events.firebase.database.v1 | ReferenceEventData | The data within all Firebase Real Time Database reference events. |
| google.events.cloud.pubsub.v1 | MessagePublishedData | The event data when a message is published to a topic. |
| google.events.firebase.remoteconfig.v1 | RemoteConfigEventData | The data within all Firebase Remote Config events. |
| google.events.firebase.auth.v1 | AuthEventData | The data within all Firebase Auth events. |
| google.events.cloud.storage.v1 | StorageObjectData | An object within Google Cloud Storage. |
| google.events.cloud.firestore.v1 | DocumentEventData | The data within all Firestore document events. |
| google.events.firebase.analytics.v1 | AnalyticsLogData | The data within Firebase Analytics log events. |
| google.events.cloud.audit.v1 | LogEntryData | The data within all Cloud Audit Logs log entry events. |
| google.events.cloud.cloudbuild.v1 | BuildEventData | Build event data for Google Cloud Platform API operations. |
This library provides classes of common event types used with Google services,
as defined in the [Google Cloudevents repository](https://github.com/googleapis/google-cloudevents).

## Installation and Usage

Expand All @@ -31,13 +18,14 @@ pip install --upgrade google-events
To use an event class, see the snippet below:

``` python
from google.events.cloud.pubsub.v1 import MessagePublishedData

# Parses a Dict into an event
# The Dict may be an argument in a background Cloud Function,
# or the payload of an HTTP request received by a Cloud Run service with event
# triggers.
event_data = "Some event data"
event = MessagePublishedData.from_dict(event_data)
print(event.message)
from google.events.cloud import storage

# Parses a json string containing an event payload
# The json payload may be from an HTTP request received by a Cloud Run
# service with event triggers.

def handle_event_trigger(json_payload):
event = storage.StorageObjectData.from_json(json_payload)
print(f"{event.bucket}/{event.name} had event")
return "OK"
```
7 changes: 0 additions & 7 deletions docs/multiprocessing.rst

This file was deleted.

34 changes: 0 additions & 34 deletions gen.sh

This file was deleted.

3 changes: 0 additions & 3 deletions gen/.eslintrc.json

This file was deleted.

3 changes: 0 additions & 3 deletions gen/.prettierrc.js

This file was deleted.

5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[build-system]
requires = [
"setuptools >= 40.9.0",
]
build-backend = "setuptools.build_meta"
5 changes: 0 additions & 5 deletions requirements-dev.txt

This file was deleted.

2 changes: 0 additions & 2 deletions requirements.txt

This file was deleted.

44 changes: 0 additions & 44 deletions setup.py

This file was deleted.

35 changes: 35 additions & 0 deletions src/google/events/cloud/apigateway/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
# Copyright 2022 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.events.cloud.apigateway import gapic_version as package_version

__version__ = package_version.__version__



from google.events.cloud.apigateway_v1.types.data import Api
from google.events.cloud.apigateway_v1.types.data import ApiConfig
from google.events.cloud.apigateway_v1.types.data import ApiConfigEventData
from google.events.cloud.apigateway_v1.types.data import ApiEventData
from google.events.cloud.apigateway_v1.types.data import Gateway
from google.events.cloud.apigateway_v1.types.data import GatewayEventData

__all__ = ('Api',
'ApiConfig',
'ApiConfigEventData',
'ApiEventData',
'Gateway',
'GatewayEventData',
)
16 changes: 16 additions & 0 deletions src/google/events/cloud/apigateway/gapic_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# Copyright 2022 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.1.0" # {x-release-please-version}
2 changes: 2 additions & 0 deletions src/google/events/cloud/apigateway/py.typed
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Marker file for PEP 561.
# The google-events-cloud-apigateway package uses inline types.
36 changes: 36 additions & 0 deletions src/google/events/cloud/apigateway_v1/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# -*- coding: utf-8 -*-
# Copyright 2022 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.events.cloud.apigateway import gapic_version as package_version

__version__ = package_version.__version__



from .types.data import Api
from .types.data import ApiConfig
from .types.data import ApiConfigEventData
from .types.data import ApiEventData
from .types.data import Gateway
from .types.data import GatewayEventData

__all__ = (
'Api',
'ApiConfig',
'ApiConfigEventData',
'ApiEventData',
'Gateway',
'GatewayEventData',
)
16 changes: 16 additions & 0 deletions src/google/events/cloud/apigateway_v1/gapic_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# Copyright 2022 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.1.0" # {x-release-please-version}
2 changes: 2 additions & 0 deletions src/google/events/cloud/apigateway_v1/py.typed
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Marker file for PEP 561.
# The google-events-cloud-apigateway package uses inline types.
15 changes: 15 additions & 0 deletions src/google/events/cloud/apigateway_v1/services/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
# Copyright 2022 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.
#
32 changes: 32 additions & 0 deletions src/google/events/cloud/apigateway_v1/types/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# -*- coding: utf-8 -*-
# Copyright 2022 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 .data import (
Api,
ApiConfig,
ApiConfigEventData,
ApiEventData,
Gateway,
GatewayEventData,
)

__all__ = (
'Api',
'ApiConfig',
'ApiConfigEventData',
'ApiEventData',
'Gateway',
'GatewayEventData',
)
Loading

0 comments on commit 62ce8ff

Please sign in to comment.