Skip to content

Commit c411e14

Browse files
authored
feat(recommender): add v1, set release level to beta (#10170)
1 parent 8e7b7f8 commit c411e14

33 files changed

+4797
-316
lines changed

recommender/.repo-metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"product_documentation": "https://cloud.google.com/recommender",
55
"client_documentation": "https://googleapis.dev/python/recommender/latest",
66
"issue_tracker": "",
7-
"release_level": "alpha",
7+
"release_level": "beta",
88
"language": "python",
99
"repo": "googleapis/google-cloud-python",
1010
"distribution_name": "google-cloud-recommender",

recommender/docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@
318318
u"google-cloud-recommender Documentation",
319319
author,
320320
"google-cloud-recommender",
321-
"GAPIC library for the {metadata.shortName} v1beta1 service",
321+
"GAPIC library for the {metadata.shortName} v1 service",
322322
"APIs",
323323
)
324324
]

recommender/docs/gapic/v1/api.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Client for Recommender API
2+
==========================
3+
4+
.. automodule:: google.cloud.recommender_v1
5+
:members:
6+
:inherited-members:
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Types for Recommender API Client
2+
================================
3+
4+
.. automodule:: google.cloud.recommender_v1.types
5+
:members:

recommender/docs/index.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22

33
Api Reference
44
-------------
5+
6+
This package includes clients for multiple versions of the Cloud Recommender API. By default, you will get ``v1``
7+
the latest stable version.
8+
9+
v1
10+
==
11+
.. toctree::
12+
:maxdepth: 2
13+
14+
gapic/v1/api
15+
gapic/v1/types
16+
17+
v1beta1
18+
=======
19+
520
.. toctree::
621
:maxdepth: 2
722

recommender/google/cloud/recommender.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717

1818
from __future__ import absolute_import
1919

20-
from google.cloud.recommender_v1beta1 import RecommenderClient
21-
from google.cloud.recommender_v1beta1 import enums
22-
from google.cloud.recommender_v1beta1 import types
20+
from google.cloud.recommender_v1 import RecommenderClient
21+
from google.cloud.recommender_v1 import enums
22+
from google.cloud.recommender_v1 import types
2323

2424

2525
__all__ = ("enums", "types", "RecommenderClient")
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# Copyright 2019 Google LLC
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
18+
from __future__ import absolute_import
19+
import sys
20+
import warnings
21+
22+
from google.cloud.recommender_v1 import types
23+
from google.cloud.recommender_v1.gapic import enums
24+
from google.cloud.recommender_v1.gapic import recommender_client
25+
26+
27+
if sys.version_info[:2] == (2, 7):
28+
message = (
29+
"A future version of this library will drop support for Python 2.7."
30+
"More details about Python 2 support for Google Cloud Client Libraries"
31+
"can be found at https://cloud.google.com/python/docs/python2-sunset/"
32+
)
33+
warnings.warn(message, DeprecationWarning)
34+
35+
36+
class RecommenderClient(recommender_client.RecommenderClient):
37+
__doc__ = recommender_client.RecommenderClient.__doc__
38+
enums = enums
39+
40+
41+
__all__ = ("enums", "types", "RecommenderClient")

recommender/google/cloud/recommender_v1/gapic/__init__.py

Whitespace-only changes.
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# Copyright 2019 Google LLC
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
"""Wrappers for protocol buffer enum types."""
18+
19+
import enum
20+
21+
22+
class NullValue(enum.IntEnum):
23+
"""
24+
``NullValue`` is a singleton enumeration to represent the null value
25+
for the ``Value`` type union.
26+
27+
The JSON representation for ``NullValue`` is JSON ``null``.
28+
29+
Attributes:
30+
NULL_VALUE (int): Null value.
31+
"""
32+
33+
NULL_VALUE = 0
34+
35+
36+
class Impact(object):
37+
class Category(enum.IntEnum):
38+
"""
39+
The category of the impact.
40+
41+
Attributes:
42+
CATEGORY_UNSPECIFIED (int): Default unspecified category. Don't use directly.
43+
COST (int): Indicates a potential increase or decrease in cost.
44+
SECURITY (int): Indicates a potential increase or decrease in security.
45+
PERFORMANCE (int): Indicates a potential increase or decrease in performance.
46+
MANAGEABILITY (int): Indicates a potential increase or decrease in manageability.
47+
"""
48+
49+
CATEGORY_UNSPECIFIED = 0
50+
COST = 1
51+
SECURITY = 2
52+
PERFORMANCE = 3
53+
MANAGEABILITY = 4
54+
55+
56+
class RecommendationStateInfo(object):
57+
class State(enum.IntEnum):
58+
"""
59+
Represents Recommendation State
60+
61+
Attributes:
62+
STATE_UNSPECIFIED (int): Default state. Don't use directly.
63+
ACTIVE (int): Recommendation is active and can be applied. Recommendations content can
64+
be updated by Google.
65+
66+
ACTIVE recommendations can be marked as CLAIMED, SUCCEEDED, or FAILED.
67+
CLAIMED (int): Recommendation is in claimed state. Recommendations content is
68+
immutable and cannot be updated by Google.
69+
70+
CLAIMED recommendations can be marked as CLAIMED, SUCCEEDED, or FAILED.
71+
SUCCEEDED (int): Recommendation is in succeeded state. Recommendations content is
72+
immutable and cannot be updated by Google.
73+
74+
SUCCEEDED recommendations can be marked as SUCCEEDED, or FAILED.
75+
FAILED (int): Recommendation is in failed state. Recommendations content is immutable
76+
and cannot be updated by Google.
77+
78+
FAILED recommendations can be marked as SUCCEEDED, or FAILED.
79+
DISMISSED (int): Recommendation is in dismissed state. Recommendation content can be
80+
updated by Google.
81+
82+
DISMISSED recommendations can be marked as ACTIVE.
83+
"""
84+
85+
STATE_UNSPECIFIED = 0
86+
ACTIVE = 1
87+
CLAIMED = 6
88+
SUCCEEDED = 3
89+
FAILED = 4
90+
DISMISSED = 5

0 commit comments

Comments
 (0)