Skip to content
Permalink
Browse files
feat!: migrate to microgenerator (#33)
  • Loading branch information
arithmetic1728 committed Jul 16, 2020
1 parent d367b9e commit aa9b20c6f4ccb6dff305bfcd72e1bde4a1ee86cd
Showing with 44,696 additions and 41,481 deletions.
  1. +5 −3 README.rst
  2. +154 −0 UPGRADING.md
  3. +1 −0 docs/UPGRADING.md
  4. +6 −0 docs/container_v1/services.rst
  5. +5 −0 docs/container_v1/types.rst
  6. +6 −0 docs/container_v1beta1/services.rst
  7. +5 −0 docs/container_v1beta1/types.rst
  8. +0 −6 docs/gapic/v1/api.rst
  9. +0 −5 docs/gapic/v1/types.rst
  10. +25 −3 docs/index.rst
  11. +0 −8 google/__init__.py
  12. +0 −8 google/cloud/__init__.py
  13. +198 −0 google/cloud/container/__init__.py
  14. +2 −0 google/cloud/container/py.typed
  15. +162 −26 google/cloud/container_v1/__init__.py
  16. +0 −3,066 google/cloud/container_v1/gapic/cluster_manager_client.py
  17. +0 −178 google/cloud/container_v1/gapic/cluster_manager_client_config.py
  18. +0 −261 google/cloud/container_v1/gapic/enums.py
  19. +0 −536 google/cloud/container_v1/gapic/transports/cluster_manager_grpc_transport.py
  20. +0 −13,346 google/cloud/container_v1/proto/cluster_service_pb2.py
  21. +0 −584 google/cloud/container_v1/proto/cluster_service_pb2_grpc.py
  22. +2 −0 google/cloud/container_v1/py.typed
  23. +16 −0 google/cloud/container_v1/services/__init__.py
  24. +6 −11 google/cloud/{container.py → container_v1/services/cluster_manager/__init__.py}
  25. +3,206 −0 google/cloud/container_v1/services/cluster_manager/async_client.py
  26. +3,327 −0 google/cloud/container_v1/services/cluster_manager/client.py
  27. +150 −0 google/cloud/container_v1/services/cluster_manager/pagers.py
  28. +36 −0 google/cloud/container_v1/services/cluster_manager/transports/__init__.py
  29. +423 −0 google/cloud/container_v1/services/cluster_manager/transports/base.py
  30. +1,061 −0 google/cloud/container_v1/services/cluster_manager/transports/grpc.py
  31. +1,102 −0 google/cloud/container_v1/services/cluster_manager/transports/grpc_asyncio.py
  32. +0 −50 google/cloud/container_v1/types.py
  33. +181 −0 google/cloud/container_v1/types/__init__.py
  34. +3,415 −0 google/cloud/container_v1/types/cluster_service.py
  35. +176 −26 google/cloud/container_v1beta1/__init__.py
  36. 0 google/cloud/container_v1beta1/gapic/__init__.py
  37. +0 −3,424 google/cloud/container_v1beta1/gapic/cluster_manager_client.py
  38. +0 −183 google/cloud/container_v1beta1/gapic/cluster_manager_client_config.py
  39. +0 −316 google/cloud/container_v1beta1/gapic/enums.py
  40. 0 google/cloud/container_v1beta1/gapic/transports/__init__.py
  41. +0 −549 google/cloud/container_v1beta1/gapic/transports/cluster_manager_grpc_transport.py
  42. +0 −14,436 google/cloud/container_v1beta1/proto/cluster_service_pb2.py
  43. +0 −601 google/cloud/container_v1beta1/proto/cluster_service_pb2_grpc.py
  44. +2 −0 google/cloud/container_v1beta1/py.typed
  45. +16 −0 google/cloud/container_v1beta1/services/__init__.py
  46. +24 −0 google/cloud/container_v1beta1/services/cluster_manager/__init__.py
  47. +3,227 −0 google/cloud/container_v1beta1/services/cluster_manager/async_client.py
  48. +3,348 −0 google/cloud/container_v1beta1/services/cluster_manager/client.py
  49. +150 −0 google/cloud/container_v1beta1/services/cluster_manager/pagers.py
  50. +36 −0 google/cloud/container_v1beta1/services/cluster_manager/transports/__init__.py
  51. +435 −0 google/cloud/container_v1beta1/services/cluster_manager/transports/base.py
  52. +1,090 −0 google/cloud/container_v1beta1/services/cluster_manager/transports/grpc.py
  53. +1,132 −0 google/cloud/container_v1beta1/services/cluster_manager/transports/grpc_asyncio.py
  54. +0 −50 google/cloud/container_v1beta1/types.py
  55. +195 −0 google/cloud/container_v1beta1/types/__init__.py
  56. +3,653 −0 google/cloud/container_v1beta1/types/cluster_service.py
  57. +6 −4 noxfile.py
  58. +1 −0 samples/AUTHORING_GUIDE.md
  59. +1 −0 samples/CONTRIBUTING.md
  60. +207 −0 scripts/fixup_container_v1_keywords.py
  61. +208 −0 scripts/fixup_container_v1beta1_keywords.py
  62. +12 −6 setup.py
  63. +2 −10 synth.metadata
  64. +41 −6 synth.py
  65. +3 −4 tests/system/gapic/v1/test_system_cluster_manager_v1.py
  66. 0 {google/cloud/container_v1/gapic → tests/unit/gapic/container_v1}/__init__.py
  67. +8,450 −0 tests/unit/gapic/container_v1/test_cluster_manager.py
  68. 0 {google/cloud/container_v1/gapic/transports → tests/unit/gapic/container_v1beta1}/__init__.py
  69. +8,787 −0 tests/unit/gapic/container_v1beta1/test_cluster_manager.py
  70. +0 −1,688 tests/unit/gapic/v1/test_cluster_manager_client_v1.py
  71. +0 −2,087 tests/unit/gapic/v1beta1/test_cluster_manager_client_v1beta1.py
@@ -1,7 +1,7 @@
Python Client for Google Kubernetes Engine API
==============================================

|ga| |pypi| |versions|
|ga| |pypi| |versions|

`Google Kubernetes Engine API`_: The Google Kubernetes Engine API is used for
building and managing container based applications, powered by the open source
@@ -49,11 +49,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-container==1.0.1


Mac/Linux
@@ -0,0 +1,154 @@
# 2.0.0 Migration Guide

The 2.0 release of the `google-cloud-container` client is a significant upgrade based on a [next-gen code generator](https://github.com/googleapis/gapic-generator-python), and includes substantial interface changes. Existing code written for earlier versions of this library will likely require updates to use this version. This document describes the changes that have been made, and what you need to do to update your usage.

If you experience issues or have questions, please file an [issue](https://github.com/googleapis/python-container/issues).

## Supported Python Versions

> **WARNING**: Breaking change
The 2.0.0 release requires Python 3.6+.


## Method Calls

> **WARNING**: Breaking change
Methods expect request objects. We provide a script that will convert most common use cases.

* Install the library

```py
python3 -m pip install google-cloud-container
```

* The script `fixup_container_v1_keywords.py` and `fixup_container_v1beta1_keywords.py`
are shipped with the library. It expects an input directory (with the code to convert) and an empty destination directory.

```sh
$ fixup_container_v1_keywords.py --input-directory .samples/ --output-directory samples/
```

**Before:**
```py
from google.cloud import container_v1
client = container_v1.ClusterManagerClient()
clusters = client.list_clusters(
project_id="project_id", zone="us-central1-a", parent="parent"
)
```


**After:**
```py
from google.cloud import container_v1
client = container_v1.ClusterManagerClient()
clusters = client.list_clusters(
request = {'project_id': "project_id", 'zone': "us-central1-a", 'parent': "parent"}
)
```

### More Details

In `google-cloud-container<2.0.0`, parameters required by the API were positional parameters and optional parameters were keyword parameters.

**Before:**
```py
def list_clusters(
self,
project_id=None,
zone=None,
parent=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
```

In the 2.0.0 release, all methods have a single positional parameter `request`. Method docstrings indicate whether a parameter is required or optional.

Some methods have additional keyword only parameters. The available parameters depend on the [`google.api.method_signature` annotation](https://github.com/googleapis/googleapis/blob/master/google/container/v1/cluster_service.proto#L48) specified by the API producer.


**After:**
```py
def list_clusters(
self,
request: cluster_service.ListClustersRequest = None,
*,
project_id: str = None,
zone: str = None,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> cluster_service.ListClustersResponse:
```

> **NOTE:** The `request` parameter and flattened keyword parameters for the API are mutually exclusive.
> Passing both will result in an error.

Both of these calls are valid:

```py
response = client.list_clusters(
request={
"project_id": project_id,
"zone": zone,
"parent": parent,
}
)
```

```py
response = client.list_clusters(
project_id=project_id,
zone=zone,
parent=parent,
)
```

This call is invalid because it mixes `request` with a keyword argument `parent`. Executing this code will result in an error.

```py
response = client.list_clusters(
request={
"project_id": project_id,
"zone": zone,
},
parent=parent
)
```



## Enums and Types


> **WARNING**: Breaking change
The submodules `enums` and `types` have been removed.

**Before:**
```py
from google.cloud import container
status = container.enums.Cluster.Status.RUNNING
cluster = container.types.Cluster(name="name")
```


**After:**
```py
from google.cloud import container
status = container.Cluster.Status.RUNNING
cluster = container.Cluster(name="name")
```
@@ -0,0 +1,6 @@
Services for Google Container v1 API
====================================

.. automodule:: google.cloud.container_v1.services.cluster_manager
:members:
:inherited-members:
@@ -0,0 +1,5 @@
Types for Google Container v1 API
=================================

.. automodule:: google.cloud.container_v1.types
:members:
@@ -0,0 +1,6 @@
Services for Google Container v1beta1 API
=========================================

.. automodule:: google.cloud.container_v1beta1.services.cluster_manager
:members:
:inherited-members:
@@ -0,0 +1,5 @@
Types for Google Container v1beta1 API
======================================

.. automodule:: google.cloud.container_v1beta1.types
:members:

This file was deleted.

This file was deleted.

@@ -4,11 +4,33 @@

API Reference
-------------

v1
-------------
.. toctree::
:maxdepth: 2
:maxdepth: 2

container_v1/services
container_v1/types

v1beta1
-------------
.. toctree::
:maxdepth: 2

container_v1beta1/services
container_v1beta1/types

Migration Guide
---------------

See the guide below for instructions on migrating to the 2.x release of this library.

.. toctree::
:maxdepth: 2

UPGRADING

gapic/v1/api
gapic/v1/types

Changelog
---------

This file was deleted.

This file was deleted.

Loading

0 comments on commit aa9b20c

Please sign in to comment.