Skip to content

Commit c3da089

Browse files
feat: [google-cloud-securesourcemanager] add field private_config to message .google.cloud.securesourcemanager.v1.Instance (#12891)
- [ ] Regenerate this pull request now. BEGIN_COMMIT_OVERRIDE feat: add field `private_config` to message `.google.cloud.securesourcemanager.v1.Instance` feat: add constant `UNKNOWN` to field `State` in message `.google.cloud.securesourcemanager.v1.Instance` docs: A comment for field `instance` in message `.google.cloud.securesourcemanager.v1.Repository` is updated to include data plane vs control plane behavior. END_COMMIT_OVERRIDE PiperOrigin-RevId: 650735536 Source-Link: googleapis/googleapis@847b40b Source-Link: googleapis/googleapis-gen@dd9deaf Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNlY3VyZXNvdXJjZW1hbmFnZXIvLk93bEJvdC55YW1sIiwiaCI6ImRkOWRlYWY3YzlhMWQ5MmI5ZjNmMjQxY2I4YzdjY2ZhNTNiNmYyNTQifQ== --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent ea0a4c9 commit c3da089

File tree

7 files changed

+189
-24
lines changed

7 files changed

+189
-24
lines changed

packages/google-cloud-securesourcemanager/google/cloud/securesourcemanager/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.1.6" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-securesourcemanager/google/cloud/securesourcemanager_v1/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.1.6" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-securesourcemanager/google/cloud/securesourcemanager_v1/services/secure_source_manager/async_client.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ class SecureSourceManagerAsyncClient:
9797
_DEFAULT_ENDPOINT_TEMPLATE = SecureSourceManagerClient._DEFAULT_ENDPOINT_TEMPLATE
9898
_DEFAULT_UNIVERSE = SecureSourceManagerClient._DEFAULT_UNIVERSE
9999

100+
ca_pool_path = staticmethod(SecureSourceManagerClient.ca_pool_path)
101+
parse_ca_pool_path = staticmethod(SecureSourceManagerClient.parse_ca_pool_path)
100102
crypto_key_path = staticmethod(SecureSourceManagerClient.crypto_key_path)
101103
parse_crypto_key_path = staticmethod(
102104
SecureSourceManagerClient.parse_crypto_key_path
@@ -107,6 +109,12 @@ class SecureSourceManagerAsyncClient:
107109
parse_repository_path = staticmethod(
108110
SecureSourceManagerClient.parse_repository_path
109111
)
112+
service_attachment_path = staticmethod(
113+
SecureSourceManagerClient.service_attachment_path
114+
)
115+
parse_service_attachment_path = staticmethod(
116+
SecureSourceManagerClient.parse_service_attachment_path
117+
)
110118
common_billing_account_path = staticmethod(
111119
SecureSourceManagerClient.common_billing_account_path
112120
)

packages/google-cloud-securesourcemanager/google/cloud/securesourcemanager_v1/services/secure_source_manager/client.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,28 @@ def transport(self) -> SecureSourceManagerTransport:
217217
"""
218218
return self._transport
219219

220+
@staticmethod
221+
def ca_pool_path(
222+
project: str,
223+
location: str,
224+
ca_pool: str,
225+
) -> str:
226+
"""Returns a fully-qualified ca_pool string."""
227+
return "projects/{project}/locations/{location}/caPools/{ca_pool}".format(
228+
project=project,
229+
location=location,
230+
ca_pool=ca_pool,
231+
)
232+
233+
@staticmethod
234+
def parse_ca_pool_path(path: str) -> Dict[str, str]:
235+
"""Parses a ca_pool path into its component segments."""
236+
m = re.match(
237+
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/caPools/(?P<ca_pool>.+?)$",
238+
path,
239+
)
240+
return m.groupdict() if m else {}
241+
220242
@staticmethod
221243
def crypto_key_path(
222244
project: str,
@@ -287,6 +309,28 @@ def parse_repository_path(path: str) -> Dict[str, str]:
287309
)
288310
return m.groupdict() if m else {}
289311

312+
@staticmethod
313+
def service_attachment_path(
314+
project: str,
315+
region: str,
316+
service_attachment: str,
317+
) -> str:
318+
"""Returns a fully-qualified service_attachment string."""
319+
return "projects/{project}/regions/{region}/serviceAttachments/{service_attachment}".format(
320+
project=project,
321+
region=region,
322+
service_attachment=service_attachment,
323+
)
324+
325+
@staticmethod
326+
def parse_service_attachment_path(path: str) -> Dict[str, str]:
327+
"""Parses a service_attachment path into its component segments."""
328+
m = re.match(
329+
r"^projects/(?P<project>.+?)/regions/(?P<region>.+?)/serviceAttachments/(?P<service_attachment>.+?)$",
330+
path,
331+
)
332+
return m.groupdict() if m else {}
333+
290334
@staticmethod
291335
def common_billing_account_path(
292336
billing_account: str,

packages/google-cloud-securesourcemanager/google/cloud/securesourcemanager_v1/types/secure_source_manager.py

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ class Instance(proto.Message):
6464
Output only. Update timestamp.
6565
labels (MutableMapping[str, str]):
6666
Optional. Labels as key value pairs.
67+
private_config (google.cloud.securesourcemanager_v1.types.Instance.PrivateConfig):
68+
Optional. Private settings for private
69+
instance.
6770
state (google.cloud.securesourcemanager_v1.types.Instance.State):
6871
Output only. Current state of the instance.
6972
state_note (google.cloud.securesourcemanager_v1.types.Instance.StateNote):
@@ -93,12 +96,16 @@ class State(proto.Enum):
9396
Instance is being deleted.
9497
PAUSED (4):
9598
Instance is paused.
99+
UNKNOWN (6):
100+
Instance is unknown, we are not sure if it's
101+
functioning.
96102
"""
97103
STATE_UNSPECIFIED = 0
98104
CREATING = 1
99105
ACTIVE = 2
100106
DELETING = 3
101107
PAUSED = 4
108+
UNKNOWN = 6
102109

103110
class StateNote(proto.Enum):
104111
r"""Provides information about the current instance state.
@@ -148,6 +155,44 @@ class HostConfig(proto.Message):
148155
number=4,
149156
)
150157

158+
class PrivateConfig(proto.Message):
159+
r"""PrivateConfig includes settings for private instance.
160+
161+
Attributes:
162+
is_private (bool):
163+
Required. Immutable. Indicate if it's private
164+
instance.
165+
ca_pool (str):
166+
Required. Immutable. CA pool resource, resource must in the
167+
format of
168+
``projects/{project}/locations/{location}/caPools/{ca_pool}``.
169+
http_service_attachment (str):
170+
Output only. Service Attachment for HTTP, resource is in the
171+
format of
172+
``projects/{project}/regions/{region}/serviceAttachments/{service_attachment}``.
173+
ssh_service_attachment (str):
174+
Output only. Service Attachment for SSH, resource is in the
175+
format of
176+
``projects/{project}/regions/{region}/serviceAttachments/{service_attachment}``.
177+
"""
178+
179+
is_private: bool = proto.Field(
180+
proto.BOOL,
181+
number=1,
182+
)
183+
ca_pool: str = proto.Field(
184+
proto.STRING,
185+
number=2,
186+
)
187+
http_service_attachment: str = proto.Field(
188+
proto.STRING,
189+
number=3,
190+
)
191+
ssh_service_attachment: str = proto.Field(
192+
proto.STRING,
193+
number=4,
194+
)
195+
151196
name: str = proto.Field(
152197
proto.STRING,
153198
number=1,
@@ -167,6 +212,11 @@ class HostConfig(proto.Message):
167212
proto.STRING,
168213
number=4,
169214
)
215+
private_config: PrivateConfig = proto.Field(
216+
proto.MESSAGE,
217+
number=13,
218+
message=PrivateConfig,
219+
)
170220
state: State = proto.Field(
171221
proto.ENUM,
172222
number=5,
@@ -200,9 +250,12 @@ class Repository(proto.Message):
200250
Optional. Description of the repository,
201251
which cannot exceed 500 characters.
202252
instance (str):
203-
Output only. The name of the instance in which the
204-
repository is hosted, formatted as
253+
Optional. The name of the instance in which the repository
254+
is hosted, formatted as
205255
``projects/{project_number}/locations/{location_id}/instances/{instance_id}``
256+
For data plane CreateRepository requests, this field is
257+
output only. For control plane CreateRepository requests,
258+
this field is used as input.
206259
uid (str):
207260
Output only. Unique identifier of the
208261
repository.

packages/google-cloud-securesourcemanager/samples/generated_samples/snippet_metadata_google.cloud.securesourcemanager.v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-securesourcemanager",
11-
"version": "0.1.6"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

packages/google-cloud-securesourcemanager/tests/unit/gapic/securesourcemanager_v1/test_secure_source_manager.py

Lines changed: 79 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6607,6 +6607,12 @@ def test_create_instance_rest(request_type):
66076607
"create_time": {"seconds": 751, "nanos": 543},
66086608
"update_time": {},
66096609
"labels": {},
6610+
"private_config": {
6611+
"is_private": True,
6612+
"ca_pool": "ca_pool_value",
6613+
"http_service_attachment": "http_service_attachment_value",
6614+
"ssh_service_attachment": "ssh_service_attachment_value",
6615+
},
66106616
"state": 1,
66116617
"state_note": 1,
66126618
"kms_key": "kms_key_value",
@@ -10302,11 +10308,37 @@ def test_secure_source_manager_grpc_lro_async_client():
1030210308
assert transport.operations_client is transport.operations_client
1030310309

1030410310

10305-
def test_crypto_key_path():
10311+
def test_ca_pool_path():
1030610312
project = "squid"
1030710313
location = "clam"
10308-
key_ring = "whelk"
10309-
crypto_key = "octopus"
10314+
ca_pool = "whelk"
10315+
expected = "projects/{project}/locations/{location}/caPools/{ca_pool}".format(
10316+
project=project,
10317+
location=location,
10318+
ca_pool=ca_pool,
10319+
)
10320+
actual = SecureSourceManagerClient.ca_pool_path(project, location, ca_pool)
10321+
assert expected == actual
10322+
10323+
10324+
def test_parse_ca_pool_path():
10325+
expected = {
10326+
"project": "octopus",
10327+
"location": "oyster",
10328+
"ca_pool": "nudibranch",
10329+
}
10330+
path = SecureSourceManagerClient.ca_pool_path(**expected)
10331+
10332+
# Check that the path construction is reversible.
10333+
actual = SecureSourceManagerClient.parse_ca_pool_path(path)
10334+
assert expected == actual
10335+
10336+
10337+
def test_crypto_key_path():
10338+
project = "cuttlefish"
10339+
location = "mussel"
10340+
key_ring = "winkle"
10341+
crypto_key = "nautilus"
1031010342
expected = "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}".format(
1031110343
project=project,
1031210344
location=location,
@@ -10321,10 +10353,10 @@ def test_crypto_key_path():
1032110353

1032210354
def test_parse_crypto_key_path():
1032310355
expected = {
10324-
"project": "oyster",
10325-
"location": "nudibranch",
10326-
"key_ring": "cuttlefish",
10327-
"crypto_key": "mussel",
10356+
"project": "scallop",
10357+
"location": "abalone",
10358+
"key_ring": "squid",
10359+
"crypto_key": "clam",
1032810360
}
1032910361
path = SecureSourceManagerClient.crypto_key_path(**expected)
1033010362

@@ -10334,9 +10366,9 @@ def test_parse_crypto_key_path():
1033410366

1033510367

1033610368
def test_instance_path():
10337-
project = "winkle"
10338-
location = "nautilus"
10339-
instance = "scallop"
10369+
project = "whelk"
10370+
location = "octopus"
10371+
instance = "oyster"
1034010372
expected = "projects/{project}/locations/{location}/instances/{instance}".format(
1034110373
project=project,
1034210374
location=location,
@@ -10348,9 +10380,9 @@ def test_instance_path():
1034810380

1034910381
def test_parse_instance_path():
1035010382
expected = {
10351-
"project": "abalone",
10352-
"location": "squid",
10353-
"instance": "clam",
10383+
"project": "nudibranch",
10384+
"location": "cuttlefish",
10385+
"instance": "mussel",
1035410386
}
1035510387
path = SecureSourceManagerClient.instance_path(**expected)
1035610388

@@ -10360,9 +10392,9 @@ def test_parse_instance_path():
1036010392

1036110393

1036210394
def test_repository_path():
10363-
project = "whelk"
10364-
location = "octopus"
10365-
repository = "oyster"
10395+
project = "winkle"
10396+
location = "nautilus"
10397+
repository = "scallop"
1036610398
expected = (
1036710399
"projects/{project}/locations/{location}/repositories/{repository}".format(
1036810400
project=project,
@@ -10376,9 +10408,9 @@ def test_repository_path():
1037610408

1037710409
def test_parse_repository_path():
1037810410
expected = {
10379-
"project": "nudibranch",
10380-
"location": "cuttlefish",
10381-
"repository": "mussel",
10411+
"project": "abalone",
10412+
"location": "squid",
10413+
"repository": "clam",
1038210414
}
1038310415
path = SecureSourceManagerClient.repository_path(**expected)
1038410416

@@ -10387,6 +10419,34 @@ def test_parse_repository_path():
1038710419
assert expected == actual
1038810420

1038910421

10422+
def test_service_attachment_path():
10423+
project = "whelk"
10424+
region = "octopus"
10425+
service_attachment = "oyster"
10426+
expected = "projects/{project}/regions/{region}/serviceAttachments/{service_attachment}".format(
10427+
project=project,
10428+
region=region,
10429+
service_attachment=service_attachment,
10430+
)
10431+
actual = SecureSourceManagerClient.service_attachment_path(
10432+
project, region, service_attachment
10433+
)
10434+
assert expected == actual
10435+
10436+
10437+
def test_parse_service_attachment_path():
10438+
expected = {
10439+
"project": "nudibranch",
10440+
"region": "cuttlefish",
10441+
"service_attachment": "mussel",
10442+
}
10443+
path = SecureSourceManagerClient.service_attachment_path(**expected)
10444+
10445+
# Check that the path construction is reversible.
10446+
actual = SecureSourceManagerClient.parse_service_attachment_path(path)
10447+
assert expected == actual
10448+
10449+
1039010450
def test_common_billing_account_path():
1039110451
billing_account = "winkle"
1039210452
expected = "billingAccounts/{billing_account}".format(

0 commit comments

Comments
 (0)