Skip to content

Commit

Permalink
feat: initial generation of enhanced types (#102)
Browse files Browse the repository at this point in the history
* feat: initial generation of enhanced types
  • Loading branch information
telpirion committed Dec 5, 2020
1 parent 5362a4d commit 5ddbf16
Show file tree
Hide file tree
Showing 82 changed files with 4,339 additions and 339 deletions.
6 changes: 3 additions & 3 deletions docs/conf.py
Expand Up @@ -345,10 +345,10 @@

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
"python": ("http://python.readthedocs.org/en/latest/", None),
"google-auth": ("https://google-auth.readthedocs.io/en/stable", None),
"python": ("https://python.readthedocs.org/en/latest/", None),
"google-auth": ("https://googleapis.dev/python/google-auth/latest/", None),
"google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None,),
"grpc": ("https://grpc.io/grpc/python/", None),
"grpc": ("https://grpc.github.io/grpc/python/", None),
"proto-plus": ("https://proto-plus-python.readthedocs.io/en/latest/", None),
}

Expand Down
6 changes: 6 additions & 0 deletions docs/definition_v1beta1/types.rst
@@ -0,0 +1,6 @@
Types for Google Cloud Aiplatform V1beta1 Schema Trainingjob Definition v1beta1 API
===================================================================================

.. automodule:: google.cloud.aiplatform.v1beta1.schema.trainingjob.definition_v1beta1.types
:members:
:show-inheritance:
6 changes: 6 additions & 0 deletions docs/instance_v1beta1/types.rst
@@ -0,0 +1,6 @@
Types for Google Cloud Aiplatform V1beta1 Schema Predict Instance v1beta1 API
=============================================================================

.. automodule:: google.cloud.aiplatform.v1beta1.schema.predict.instance_v1beta1.types
:members:
:show-inheritance:
6 changes: 6 additions & 0 deletions docs/params_v1beta1/types.rst
@@ -0,0 +1,6 @@
Types for Google Cloud Aiplatform V1beta1 Schema Predict Params v1beta1 API
===========================================================================

.. automodule:: google.cloud.aiplatform.v1beta1.schema.predict.params_v1beta1.types
:members:
:show-inheritance:
6 changes: 6 additions & 0 deletions docs/prediction_v1beta1/types.rst
@@ -0,0 +1,6 @@
Types for Google Cloud Aiplatform V1beta1 Schema Predict Prediction v1beta1 API
===============================================================================

.. automodule:: google.cloud.aiplatform.v1beta1.schema.predict.prediction_v1beta1.types
:members:
:show-inheritance:
@@ -0,0 +1,56 @@
# -*- 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
#
# 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.cloud.aiplatform.v1beta1.schema.predict.instance_v1beta1.types.image_classification import (
ImageClassificationPredictionInstance,
)
from google.cloud.aiplatform.v1beta1.schema.predict.instance_v1beta1.types.image_object_detection import (
ImageObjectDetectionPredictionInstance,
)
from google.cloud.aiplatform.v1beta1.schema.predict.instance_v1beta1.types.image_segmentation import (
ImageSegmentationPredictionInstance,
)
from google.cloud.aiplatform.v1beta1.schema.predict.instance_v1beta1.types.text_classification import (
TextClassificationPredictionInstance,
)
from google.cloud.aiplatform.v1beta1.schema.predict.instance_v1beta1.types.text_extraction import (
TextExtractionPredictionInstance,
)
from google.cloud.aiplatform.v1beta1.schema.predict.instance_v1beta1.types.text_sentiment import (
TextSentimentPredictionInstance,
)
from google.cloud.aiplatform.v1beta1.schema.predict.instance_v1beta1.types.video_action_recognition import (
VideoActionRecognitionPredictionInstance,
)
from google.cloud.aiplatform.v1beta1.schema.predict.instance_v1beta1.types.video_classification import (
VideoClassificationPredictionInstance,
)
from google.cloud.aiplatform.v1beta1.schema.predict.instance_v1beta1.types.video_object_tracking import (
VideoObjectTrackingPredictionInstance,
)

__all__ = (
"ImageClassificationPredictionInstance",
"ImageObjectDetectionPredictionInstance",
"ImageSegmentationPredictionInstance",
"TextClassificationPredictionInstance",
"TextExtractionPredictionInstance",
"TextSentimentPredictionInstance",
"VideoActionRecognitionPredictionInstance",
"VideoClassificationPredictionInstance",
"VideoObjectTrackingPredictionInstance",
)
@@ -0,0 +1,2 @@
# Marker file for PEP 561.
# The google-cloud-aiplatform-v1beta1-schema-predict-instance package uses inline types.
@@ -0,0 +1,39 @@
# -*- 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
#
# 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 .types.image_classification import ImageClassificationPredictionInstance
from .types.image_object_detection import ImageObjectDetectionPredictionInstance
from .types.image_segmentation import ImageSegmentationPredictionInstance
from .types.text_classification import TextClassificationPredictionInstance
from .types.text_extraction import TextExtractionPredictionInstance
from .types.text_sentiment import TextSentimentPredictionInstance
from .types.video_action_recognition import VideoActionRecognitionPredictionInstance
from .types.video_classification import VideoClassificationPredictionInstance
from .types.video_object_tracking import VideoObjectTrackingPredictionInstance


__all__ = (
"ImageObjectDetectionPredictionInstance",
"ImageSegmentationPredictionInstance",
"TextClassificationPredictionInstance",
"TextExtractionPredictionInstance",
"TextSentimentPredictionInstance",
"VideoActionRecognitionPredictionInstance",
"VideoClassificationPredictionInstance",
"VideoObjectTrackingPredictionInstance",
"ImageClassificationPredictionInstance",
)
@@ -0,0 +1,2 @@
# Marker file for PEP 561.
# The google-cloud-aiplatform-v1beta1-schema-predict-instance package uses inline types.
@@ -0,0 +1,39 @@
# -*- 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
#
# 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 .image_classification import ImageClassificationPredictionInstance
from .image_object_detection import ImageObjectDetectionPredictionInstance
from .image_segmentation import ImageSegmentationPredictionInstance
from .text_classification import TextClassificationPredictionInstance
from .text_extraction import TextExtractionPredictionInstance
from .text_sentiment import TextSentimentPredictionInstance
from .video_action_recognition import VideoActionRecognitionPredictionInstance
from .video_classification import VideoClassificationPredictionInstance
from .video_object_tracking import VideoObjectTrackingPredictionInstance


__all__ = (
"ImageClassificationPredictionInstance",
"ImageObjectDetectionPredictionInstance",
"ImageSegmentationPredictionInstance",
"TextClassificationPredictionInstance",
"TextExtractionPredictionInstance",
"TextSentimentPredictionInstance",
"VideoActionRecognitionPredictionInstance",
"VideoClassificationPredictionInstance",
"VideoObjectTrackingPredictionInstance",
)
@@ -0,0 +1,51 @@
# -*- 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
#
# 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.
#

import proto # type: ignore


__protobuf__ = proto.module(
package="google.cloud.aiplatform.v1beta1.schema.predict.instance",
manifest={"ImageClassificationPredictionInstance",},
)


class ImageClassificationPredictionInstance(proto.Message):
r"""Prediction input format for Image Classification.
Attributes:
content (str):
The image bytes or GCS URI to make the
prediction on.
mime_type (str):
The MIME type of the content of the image.
Only the images in below listed MIME types are
supported. - image/jpeg
- image/gif
- image/png
- image/webp
- image/bmp
- image/tiff
- image/vnd.microsoft.icon
"""

content = proto.Field(proto.STRING, number=1)

mime_type = proto.Field(proto.STRING, number=2)


__all__ = tuple(sorted(__protobuf__.manifest))
@@ -0,0 +1,51 @@
# -*- 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
#
# 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.
#

import proto # type: ignore


__protobuf__ = proto.module(
package="google.cloud.aiplatform.v1beta1.schema.predict.instance",
manifest={"ImageObjectDetectionPredictionInstance",},
)


class ImageObjectDetectionPredictionInstance(proto.Message):
r"""Prediction input format for Image Object Detection.
Attributes:
content (str):
The image bytes or GCS URI to make the
prediction on.
mime_type (str):
The MIME type of the content of the image.
Only the images in below listed MIME types are
supported. - image/jpeg
- image/gif
- image/png
- image/webp
- image/bmp
- image/tiff
- image/vnd.microsoft.icon
"""

content = proto.Field(proto.STRING, number=1)

mime_type = proto.Field(proto.STRING, number=2)


__all__ = tuple(sorted(__protobuf__.manifest))
@@ -0,0 +1,45 @@
# -*- 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
#
# 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.
#

import proto # type: ignore


__protobuf__ = proto.module(
package="google.cloud.aiplatform.v1beta1.schema.predict.instance",
manifest={"ImageSegmentationPredictionInstance",},
)


class ImageSegmentationPredictionInstance(proto.Message):
r"""Prediction input format for Image Segmentation.
Attributes:
content (str):
The image bytes to make the predictions on.
mime_type (str):
The MIME type of the content of the image.
Only the images in below listed MIME types are
supported. - image/jpeg
- image/png
"""

content = proto.Field(proto.STRING, number=1)

mime_type = proto.Field(proto.STRING, number=2)


__all__ = tuple(sorted(__protobuf__.manifest))
@@ -0,0 +1,44 @@
# -*- 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
#
# 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.
#

import proto # type: ignore


__protobuf__ = proto.module(
package="google.cloud.aiplatform.v1beta1.schema.predict.instance",
manifest={"TextClassificationPredictionInstance",},
)


class TextClassificationPredictionInstance(proto.Message):
r"""Prediction input format for Text Classification.
Attributes:
content (str):
The text snippet to make the predictions on.
mime_type (str):
The MIME type of the text snippet. The
supported MIME types are listed below.
- text/plain
"""

content = proto.Field(proto.STRING, number=1)

mime_type = proto.Field(proto.STRING, number=2)


__all__ = tuple(sorted(__protobuf__.manifest))

0 comments on commit 5ddbf16

Please sign in to comment.