Skip to content

Commit

Permalink
feat(recommender): add v1, set release level to beta (#10170)
Browse files Browse the repository at this point in the history
  • Loading branch information
busunkim96 authored Jan 24, 2020
1 parent 8e7b7f8 commit c411e14
Show file tree
Hide file tree
Showing 33 changed files with 4,797 additions and 316 deletions.
2 changes: 1 addition & 1 deletion recommender/.repo-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"product_documentation": "https://cloud.google.com/recommender",
"client_documentation": "https://googleapis.dev/python/recommender/latest",
"issue_tracker": "",
"release_level": "alpha",
"release_level": "beta",
"language": "python",
"repo": "googleapis/google-cloud-python",
"distribution_name": "google-cloud-recommender",
Expand Down
2 changes: 1 addition & 1 deletion recommender/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@
u"google-cloud-recommender Documentation",
author,
"google-cloud-recommender",
"GAPIC library for the {metadata.shortName} v1beta1 service",
"GAPIC library for the {metadata.shortName} v1 service",
"APIs",
)
]
Expand Down
6 changes: 6 additions & 0 deletions recommender/docs/gapic/v1/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Client for Recommender API
==========================

.. automodule:: google.cloud.recommender_v1
:members:
:inherited-members:
5 changes: 5 additions & 0 deletions recommender/docs/gapic/v1/types.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Types for Recommender API Client
================================

.. automodule:: google.cloud.recommender_v1.types
:members:
15 changes: 15 additions & 0 deletions recommender/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

Api Reference
-------------

This package includes clients for multiple versions of the Cloud Recommender API. By default, you will get ``v1``
the latest stable version.

v1
==
.. toctree::
:maxdepth: 2

gapic/v1/api
gapic/v1/types

v1beta1
=======

.. toctree::
:maxdepth: 2

Expand Down
6 changes: 3 additions & 3 deletions recommender/google/cloud/recommender.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

from __future__ import absolute_import

from google.cloud.recommender_v1beta1 import RecommenderClient
from google.cloud.recommender_v1beta1 import enums
from google.cloud.recommender_v1beta1 import types
from google.cloud.recommender_v1 import RecommenderClient
from google.cloud.recommender_v1 import enums
from google.cloud.recommender_v1 import types


__all__ = ("enums", "types", "RecommenderClient")
41 changes: 41 additions & 0 deletions recommender/google/cloud/recommender_v1/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 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
#
# 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
import sys
import warnings

from google.cloud.recommender_v1 import types
from google.cloud.recommender_v1.gapic import enums
from google.cloud.recommender_v1.gapic import recommender_client


if sys.version_info[:2] == (2, 7):
message = (
"A future version of this library will drop support for Python 2.7."
"More details about Python 2 support for Google Cloud Client Libraries"
"can be found at https://cloud.google.com/python/docs/python2-sunset/"
)
warnings.warn(message, DeprecationWarning)


class RecommenderClient(recommender_client.RecommenderClient):
__doc__ = recommender_client.RecommenderClient.__doc__
enums = enums


__all__ = ("enums", "types", "RecommenderClient")
Empty file.
90 changes: 90 additions & 0 deletions recommender/google/cloud/recommender_v1/gapic/enums.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 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
#
# 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.

"""Wrappers for protocol buffer enum types."""

import enum


class NullValue(enum.IntEnum):
"""
``NullValue`` is a singleton enumeration to represent the null value
for the ``Value`` type union.
The JSON representation for ``NullValue`` is JSON ``null``.
Attributes:
NULL_VALUE (int): Null value.
"""

NULL_VALUE = 0


class Impact(object):
class Category(enum.IntEnum):
"""
The category of the impact.
Attributes:
CATEGORY_UNSPECIFIED (int): Default unspecified category. Don't use directly.
COST (int): Indicates a potential increase or decrease in cost.
SECURITY (int): Indicates a potential increase or decrease in security.
PERFORMANCE (int): Indicates a potential increase or decrease in performance.
MANAGEABILITY (int): Indicates a potential increase or decrease in manageability.
"""

CATEGORY_UNSPECIFIED = 0
COST = 1
SECURITY = 2
PERFORMANCE = 3
MANAGEABILITY = 4


class RecommendationStateInfo(object):
class State(enum.IntEnum):
"""
Represents Recommendation State
Attributes:
STATE_UNSPECIFIED (int): Default state. Don't use directly.
ACTIVE (int): Recommendation is active and can be applied. Recommendations content can
be updated by Google.
ACTIVE recommendations can be marked as CLAIMED, SUCCEEDED, or FAILED.
CLAIMED (int): Recommendation is in claimed state. Recommendations content is
immutable and cannot be updated by Google.
CLAIMED recommendations can be marked as CLAIMED, SUCCEEDED, or FAILED.
SUCCEEDED (int): Recommendation is in succeeded state. Recommendations content is
immutable and cannot be updated by Google.
SUCCEEDED recommendations can be marked as SUCCEEDED, or FAILED.
FAILED (int): Recommendation is in failed state. Recommendations content is immutable
and cannot be updated by Google.
FAILED recommendations can be marked as SUCCEEDED, or FAILED.
DISMISSED (int): Recommendation is in dismissed state. Recommendation content can be
updated by Google.
DISMISSED recommendations can be marked as ACTIVE.
"""

STATE_UNSPECIFIED = 0
ACTIVE = 1
CLAIMED = 6
SUCCEEDED = 3
FAILED = 4
DISMISSED = 5
Loading

0 comments on commit c411e14

Please sign in to comment.