Skip to content

Commit

Permalink
feat: Add compliant_but_disallowed_services field to the v1beta1 Work…
Browse files Browse the repository at this point in the history
…load proto (#201)

* feat: Add compliant_but_disallowed_services field to the v1beta1 Workload proto

Committer: @samhutton
PiperOrigin-RevId: 471822190

Source-Link: googleapis/googleapis@61f75b4

Source-Link: googleapis/googleapis-gen@9abf7bc
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOWFiZjdiYzI3MTU3MGY3MDczYzg5YzBkNGJlYjNiODZhNjY2NzhjYiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Sep 2, 2022
1 parent 4f7a0ba commit 513f7b4
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -736,9 +736,8 @@ async def analyze_workload_move(
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> assuredworkloads.AnalyzeWorkloadMoveResponse:
r"""A request to analyze a hypothetical move of a source
project or project-based workload to a target
(destination) folder-based workload.
r"""Analyze if the source Assured Workloads can be moved
to the target Assured Workload
.. code-block:: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -939,9 +939,8 @@ def analyze_workload_move(
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> assuredworkloads.AnalyzeWorkloadMoveResponse:
r"""A request to analyze a hypothetical move of a source
project or project-based workload to a target
(destination) folder-based workload.
r"""Analyze if the source Assured Workloads can be moved
to the target Assured Workload
.. code-block:: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,8 @@ def analyze_workload_move(
]:
r"""Return a callable for the analyze workload move method over gRPC.
A request to analyze a hypothetical move of a source
project or project-based workload to a target
(destination) folder-based workload.
Analyze if the source Assured Workloads can be moved
to the target Assured Workload
Returns:
Callable[[~.AnalyzeWorkloadMoveRequest],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,9 +416,8 @@ def analyze_workload_move(
]:
r"""Return a callable for the analyze workload move method over gRPC.
A request to analyze a hypothetical move of a source
project or project-based workload to a target
(destination) folder-based workload.
Analyze if the source Assured Workloads can be moved
to the target Assured Workload
Returns:
Callable[[~.AnalyzeWorkloadMoveRequest],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,14 @@ class Workload(proto.Message):
response is queried during GetWorkload call. In
failure cases, user friendly error message is
shown in SAA details page.
compliant_but_disallowed_services (Sequence[str]):
Output only. Urls for services which are
compliant for this Assured Workload, but which
are currently disallowed by the
ResourceUsageRestriction org policy. Invoke
RestrictAllowedResources endpoint to allow your
project developers to use these services in
their environment.".
"""

class ComplianceRegime(proto.Enum):
Expand Down Expand Up @@ -722,6 +730,10 @@ class SetupError(proto.Enum):
number=20,
message=SaaEnrollmentResponse,
)
compliant_but_disallowed_services = proto.RepeatedField(
proto.STRING,
number=24,
)


class CreateWorkloadOperationMetadata(proto.Message):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,9 @@ def test_update_workload(request_type, transport: str = "grpc"):
provisioned_resources_parent="provisioned_resources_parent_value",
kaj_enrollment_state=assuredworkloads.Workload.KajEnrollmentState.KAJ_ENROLLMENT_STATE_PENDING,
enable_sovereign_controls=True,
compliant_but_disallowed_services=[
"compliant_but_disallowed_services_value"
],
il4_settings=assuredworkloads.Workload.IL4Settings(
kms_settings=assuredworkloads.Workload.KMSSettings(
next_rotation_time=timestamp_pb2.Timestamp(seconds=751)
Expand All @@ -1012,6 +1015,9 @@ def test_update_workload(request_type, transport: str = "grpc"):
== assuredworkloads.Workload.KajEnrollmentState.KAJ_ENROLLMENT_STATE_PENDING
)
assert response.enable_sovereign_controls is True
assert response.compliant_but_disallowed_services == [
"compliant_but_disallowed_services_value"
]


def test_update_workload_empty_call():
Expand Down Expand Up @@ -1056,6 +1062,9 @@ async def test_update_workload_async(
provisioned_resources_parent="provisioned_resources_parent_value",
kaj_enrollment_state=assuredworkloads.Workload.KajEnrollmentState.KAJ_ENROLLMENT_STATE_PENDING,
enable_sovereign_controls=True,
compliant_but_disallowed_services=[
"compliant_but_disallowed_services_value"
],
)
)
response = await client.update_workload(request)
Expand All @@ -1078,6 +1087,9 @@ async def test_update_workload_async(
== assuredworkloads.Workload.KajEnrollmentState.KAJ_ENROLLMENT_STATE_PENDING
)
assert response.enable_sovereign_controls is True
assert response.compliant_but_disallowed_services == [
"compliant_but_disallowed_services_value"
]


@pytest.mark.asyncio
Expand Down Expand Up @@ -1581,6 +1593,9 @@ def test_get_workload(request_type, transport: str = "grpc"):
provisioned_resources_parent="provisioned_resources_parent_value",
kaj_enrollment_state=assuredworkloads.Workload.KajEnrollmentState.KAJ_ENROLLMENT_STATE_PENDING,
enable_sovereign_controls=True,
compliant_but_disallowed_services=[
"compliant_but_disallowed_services_value"
],
il4_settings=assuredworkloads.Workload.IL4Settings(
kms_settings=assuredworkloads.Workload.KMSSettings(
next_rotation_time=timestamp_pb2.Timestamp(seconds=751)
Expand All @@ -1607,6 +1622,9 @@ def test_get_workload(request_type, transport: str = "grpc"):
== assuredworkloads.Workload.KajEnrollmentState.KAJ_ENROLLMENT_STATE_PENDING
)
assert response.enable_sovereign_controls is True
assert response.compliant_but_disallowed_services == [
"compliant_but_disallowed_services_value"
]


def test_get_workload_empty_call():
Expand Down Expand Up @@ -1651,6 +1669,9 @@ async def test_get_workload_async(
provisioned_resources_parent="provisioned_resources_parent_value",
kaj_enrollment_state=assuredworkloads.Workload.KajEnrollmentState.KAJ_ENROLLMENT_STATE_PENDING,
enable_sovereign_controls=True,
compliant_but_disallowed_services=[
"compliant_but_disallowed_services_value"
],
)
)
response = await client.get_workload(request)
Expand All @@ -1673,6 +1694,9 @@ async def test_get_workload_async(
== assuredworkloads.Workload.KajEnrollmentState.KAJ_ENROLLMENT_STATE_PENDING
)
assert response.enable_sovereign_controls is True
assert response.compliant_but_disallowed_services == [
"compliant_but_disallowed_services_value"
]


@pytest.mark.asyncio
Expand Down

0 comments on commit 513f7b4

Please sign in to comment.