Skip to content

Commit cf1b697

Browse files
yoshi-automationtseaver
authored andcommitted
Pick up order-of-enum fix from GAPIC generator. (googleapis#6879)
1 parent 7378661 commit cf1b697

3 files changed

Lines changed: 128 additions & 83 deletions

File tree

bigtable/google/cloud/bigtable_admin_v2/gapic/enums.py

Lines changed: 67 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -33,73 +33,6 @@ class StorageType(enum.IntEnum):
3333
HDD = 2
3434

3535

36-
class Instance(object):
37-
class State(enum.IntEnum):
38-
"""
39-
Possible states of an instance.
40-
41-
Attributes:
42-
STATE_NOT_KNOWN (int): The state of the instance could not be determined.
43-
READY (int): The instance has been successfully created and can serve requests
44-
to its tables.
45-
CREATING (int): The instance is currently being created, and may be destroyed
46-
if the creation process encounters an error.
47-
"""
48-
49-
STATE_NOT_KNOWN = 0
50-
READY = 1
51-
CREATING = 2
52-
53-
class Type(enum.IntEnum):
54-
"""
55-
The type of the instance.
56-
57-
Attributes:
58-
TYPE_UNSPECIFIED (int): The type of the instance is unspecified. If set when creating an
59-
instance, a ``PRODUCTION`` instance will be created. If set when
60-
updating an instance, the type will be left unchanged.
61-
PRODUCTION (int): An instance meant for production use. ``serve_nodes`` must be set on the
62-
cluster.
63-
DEVELOPMENT (int): The instance is meant for development and testing purposes only; it has
64-
no performance or uptime guarantees and is not covered by SLA. After a
65-
development instance is created, it can be upgraded by updating the
66-
instance to type ``PRODUCTION``. An instance created as a production
67-
instance cannot be changed to a development instance. When creating a
68-
development instance, ``serve_nodes`` on the cluster must not be set.
69-
"""
70-
71-
TYPE_UNSPECIFIED = 0
72-
PRODUCTION = 1
73-
DEVELOPMENT = 2
74-
75-
76-
class Cluster(object):
77-
class State(enum.IntEnum):
78-
"""
79-
Possible states of a cluster.
80-
81-
Attributes:
82-
STATE_NOT_KNOWN (int): The state of the cluster could not be determined.
83-
READY (int): The cluster has been successfully created and is ready to serve requests.
84-
CREATING (int): The cluster is currently being created, and may be destroyed
85-
if the creation process encounters an error.
86-
A cluster may not be able to serve requests while being created.
87-
RESIZING (int): The cluster is currently being resized, and may revert to its previous
88-
node count if the process encounters an error.
89-
A cluster is still capable of serving requests while being resized,
90-
but may exhibit performance as if its number of allocated nodes is
91-
between the starting and requested states.
92-
DISABLED (int): The cluster has no backing nodes. The data (tables) still
93-
exist, but no operations can be performed on the cluster.
94-
"""
95-
96-
STATE_NOT_KNOWN = 0
97-
READY = 1
98-
CREATING = 2
99-
RESIZING = 3
100-
DISABLED = 4
101-
102-
10336
class Table(object):
10437
class TimestampGranularity(enum.IntEnum):
10538
"""
@@ -176,3 +109,70 @@ class State(enum.IntEnum):
176109
STATE_NOT_KNOWN = 0
177110
READY = 1
178111
CREATING = 2
112+
113+
114+
class Instance(object):
115+
class State(enum.IntEnum):
116+
"""
117+
Possible states of an instance.
118+
119+
Attributes:
120+
STATE_NOT_KNOWN (int): The state of the instance could not be determined.
121+
READY (int): The instance has been successfully created and can serve requests
122+
to its tables.
123+
CREATING (int): The instance is currently being created, and may be destroyed
124+
if the creation process encounters an error.
125+
"""
126+
127+
STATE_NOT_KNOWN = 0
128+
READY = 1
129+
CREATING = 2
130+
131+
class Type(enum.IntEnum):
132+
"""
133+
The type of the instance.
134+
135+
Attributes:
136+
TYPE_UNSPECIFIED (int): The type of the instance is unspecified. If set when creating an
137+
instance, a ``PRODUCTION`` instance will be created. If set when
138+
updating an instance, the type will be left unchanged.
139+
PRODUCTION (int): An instance meant for production use. ``serve_nodes`` must be set on the
140+
cluster.
141+
DEVELOPMENT (int): The instance is meant for development and testing purposes only; it has
142+
no performance or uptime guarantees and is not covered by SLA. After a
143+
development instance is created, it can be upgraded by updating the
144+
instance to type ``PRODUCTION``. An instance created as a production
145+
instance cannot be changed to a development instance. When creating a
146+
development instance, ``serve_nodes`` on the cluster must not be set.
147+
"""
148+
149+
TYPE_UNSPECIFIED = 0
150+
PRODUCTION = 1
151+
DEVELOPMENT = 2
152+
153+
154+
class Cluster(object):
155+
class State(enum.IntEnum):
156+
"""
157+
Possible states of a cluster.
158+
159+
Attributes:
160+
STATE_NOT_KNOWN (int): The state of the cluster could not be determined.
161+
READY (int): The cluster has been successfully created and is ready to serve requests.
162+
CREATING (int): The cluster is currently being created, and may be destroyed
163+
if the creation process encounters an error.
164+
A cluster may not be able to serve requests while being created.
165+
RESIZING (int): The cluster is currently being resized, and may revert to its previous
166+
node count if the process encounters an error.
167+
A cluster is still capable of serving requests while being resized,
168+
but may exhibit performance as if its number of allocated nodes is
169+
between the starting and requested states.
170+
DISABLED (int): The cluster has no backing nodes. The data (tables) still
171+
exist, but no operations can be performed on the cluster.
172+
"""
173+
174+
STATE_NOT_KNOWN = 0
175+
READY = 1
176+
CREATING = 2
177+
RESIZING = 3
178+
DISABLED = 4

bigtable/noxfile.py

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,40 +23,36 @@
2323
LOCAL_DEPS = (os.path.join("..", "api_core"), os.path.join("..", "core"))
2424

2525
@nox.session(python="3.7")
26-
def blacken(session):
27-
"""Run black.
26+
def lint(session):
27+
"""Run linters.
2828
29-
Format code to uniform standard.
29+
Returns a failure if the linters find linting errors or sufficiently
30+
serious code quality issues.
3031
"""
31-
session.install("black")
32+
session.install("flake8", "black", *LOCAL_DEPS)
3233
session.run(
3334
"black",
35+
"--check",
3436
"google",
3537
"tests",
3638
"docs",
37-
"--exclude",
38-
".*/proto/.*|.*/gapic/.*|.*/.*_pb2.py",
3939
)
40+
session.run("flake8", "google", "tests")
4041

4142

42-
@nox.session(python="3.7")
43-
def lint(session):
44-
"""Run linters.
43+
@nox.session(python="3.6")
44+
def blacken(session):
45+
"""Run black.
4546
46-
Returns a failure if the linters find linting errors or sufficiently
47-
serious code quality issues.
47+
Format code to uniform standard.
4848
"""
49-
session.install("flake8", "black", *LOCAL_DEPS)
49+
session.install("black")
5050
session.run(
5151
"black",
52-
"--check",
5352
"google",
5453
"tests",
5554
"docs",
56-
"--exclude",
57-
".*/proto/.*|.*/gapic/.*|.*/.*_pb2.py",
5855
)
59-
session.run("flake8", "google", "tests")
6056

6157

6258
@nox.session(python="3.7")

bigtable/synth.metadata

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"updateTime": "2018-12-08T13:13:19.537274Z",
3+
"sources": [
4+
{
5+
"generator": {
6+
"name": "artman",
7+
"version": "0.16.2",
8+
"dockerImage": "googleapis/artman@sha256:2f6b261ee7fe1aedf238991c93a20b3820de37a343d0cacf3e3e9555c2aaf2ea"
9+
}
10+
},
11+
{
12+
"git": {
13+
"name": "googleapis",
14+
"remote": "https://github.com/googleapis/googleapis.git",
15+
"sha": "6f6505a69b2b0a1260c93e890d636eefb859e76e",
16+
"internalRef": "224530961"
17+
}
18+
},
19+
{
20+
"template": {
21+
"name": "python_library",
22+
"origin": "synthtool.gcp",
23+
"version": "2018.12.6"
24+
}
25+
}
26+
],
27+
"destinations": [
28+
{
29+
"client": {
30+
"source": "googleapis",
31+
"apiName": "bigtable",
32+
"apiVersion": "v2",
33+
"language": "python",
34+
"generator": "gapic",
35+
"config": "google/bigtable/artman_bigtable.yaml"
36+
}
37+
},
38+
{
39+
"client": {
40+
"source": "googleapis",
41+
"apiName": "bigtable_admin",
42+
"apiVersion": "v2",
43+
"language": "python",
44+
"generator": "gapic",
45+
"config": "google/bigtable/admin/artman_bigtableadmin.yaml"
46+
}
47+
}
48+
]
49+
}

0 commit comments

Comments
 (0)