Skip to content

Commit

Permalink
feat: add new field for exception audit log link (#211)
Browse files Browse the repository at this point in the history
- [ ] Regenerate this pull request now.

feat: add support of new compliance regime for regions and new partner T systems
docs: fix some typos in documentation

Deprecated non_compliant_org_policy from AcknowledgeViolationRequest. It has no effect and shouldn't be used.

Committer: @ViswasK
PiperOrigin-RevId: 480599318

Source-Link: https://github.com/googleapis/googleapis/commit/7090dbed5f8b2b9f7fcc3fedf16ba17f736e99f3

Source-Link: https://github.com/googleapis/googleapis-gen/commit/94a1322d7678dd93678b9277b0fa59c2de2319e9
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTRhMTMyMmQ3Njc4ZGQ5MzY3OGI5Mjc3YjBmYTU5YzJkZTIzMTllOSJ9
  • Loading branch information
gcf-owl-bot[bot] committed Oct 14, 2022
1 parent 2487bda commit 65e7590
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ async def sample_create_workload():
google.api_core.operation_async.AsyncOperation:
An object representing a long-running operation.
The result type for the operation will be :class:`google.cloud.assuredworkloads_v1.types.Workload` An Workload object for managing highly regulated workloads of cloud
The result type for the operation will be :class:`google.cloud.assuredworkloads_v1.types.Workload` A Workload object for managing highly regulated workloads of cloud
customers.
"""
Expand Down Expand Up @@ -419,9 +419,8 @@ async def sample_update_workload():
Returns:
google.cloud.assuredworkloads_v1.types.Workload:
An Workload object for managing
highly regulated workloads of cloud
customers.
A Workload object for managing highly
regulated workloads of cloud customers.
"""
# Create or coerce a protobuf request object.
Expand Down Expand Up @@ -692,7 +691,7 @@ async def sample_get_workload():
The request object. Request for fetching a workload.
name (:class:`str`):
Required. The resource name of the Workload to fetch.
This is the workloads's relative path in the API,
This is the workload's relative path in the API,
formatted as
"organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
For example,
Expand All @@ -709,9 +708,8 @@ async def sample_get_workload():
Returns:
google.cloud.assuredworkloads_v1.types.Workload:
An Workload object for managing
highly regulated workloads of cloud
customers.
A Workload object for managing highly
regulated workloads of cloud customers.
"""
# Create or coerce a protobuf request object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ def sample_create_workload():
google.api_core.operation.Operation:
An object representing a long-running operation.
The result type for the operation will be :class:`google.cloud.assuredworkloads_v1.types.Workload` An Workload object for managing highly regulated workloads of cloud
The result type for the operation will be :class:`google.cloud.assuredworkloads_v1.types.Workload` A Workload object for managing highly regulated workloads of cloud
customers.
"""
Expand Down Expand Up @@ -657,9 +657,8 @@ def sample_update_workload():
Returns:
google.cloud.assuredworkloads_v1.types.Workload:
An Workload object for managing
highly regulated workloads of cloud
customers.
A Workload object for managing highly
regulated workloads of cloud customers.
"""
# Create or coerce a protobuf request object.
Expand Down Expand Up @@ -933,7 +932,7 @@ def sample_get_workload():
The request object. Request for fetching a workload.
name (str):
Required. The resource name of the Workload to fetch.
This is the workloads's relative path in the API,
This is the workload's relative path in the API,
formatted as
"organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
For example,
Expand All @@ -950,9 +949,8 @@ def sample_get_workload():
Returns:
google.cloud.assuredworkloads_v1.types.Workload:
An Workload object for managing
highly regulated workloads of cloud
customers.
A Workload object for managing highly
regulated workloads of cloud customers.
"""
# Create or coerce a protobuf request object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class GetWorkloadRequest(proto.Message):
Attributes:
name (str):
Required. The resource name of the Workload to fetch. This
is the workloads's relative path in the API, formatted as
is the workload's relative path in the API, formatted as
"organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
For example,
"organizations/123/locations/us-east1/workloads/assured-workload-1".
Expand Down Expand Up @@ -210,7 +210,7 @@ def raw_page(self):


class Workload(proto.Message):
r"""An Workload object for managing highly regulated workloads of
r"""A Workload object for managing highly regulated workloads of
cloud customers.
Attributes:
Expand Down Expand Up @@ -312,6 +312,7 @@ class ComplianceRegime(proto.Enum):
EU_REGIONS_AND_SUPPORT = 8
CA_REGIONS_AND_SUPPORT = 9
ITAR = 10
AU_REGIONS_AND_US_SUPPORT = 11
ASSURED_WORKLOADS_FOR_PARTNERS = 12

class KajEnrollmentState(proto.Enum):
Expand Down Expand Up @@ -355,7 +356,10 @@ class ResourceType(proto.Enum):
)

class KMSSettings(proto.Message):
r"""Settings specific to the Key Management Service.
r"""Settings specific to the Key Management Service. This message is
deprecated. In order to create a Keyring, callers should specify,
ENCRYPTION_KEYS_PROJECT or KEYRING in ResourceSettings.resource_type
field.
Attributes:
next_rotation_time (google.protobuf.timestamp_pb2.Timestamp):
Expand Down Expand Up @@ -394,8 +398,8 @@ class ResourceSettings(proto.Message):
is assigned by Google.
resource_type (google.cloud.assuredworkloads_v1.types.Workload.ResourceInfo.ResourceType):
Indicates the type of resource. This field should be
specified to correspond the id to the right project type
(CONSUMER_PROJECT or ENCRYPTION_KEYS_PROJECT)
specified to correspond the id to the right resource type
(CONSUMER_FOLDER or ENCRYPTION_KEYS_PROJECT)
display_name (str):
User-assigned resource display name.
If not empty it will be used to create a
Expand Down Expand Up @@ -619,8 +623,10 @@ class AcknowledgeViolationRequest(proto.Message):
Required. Business justification explaining
the need for violation acknowledgement
non_compliant_org_policy (str):
Optional. Name of the OrgPolicy which was modified with
non-compliant change and resulted in this violation. Format:
Optional. This field is deprecated and will be removed in
future version of the API. Name of the OrgPolicy which was
modified with non-compliant change and resulted in this
violation. Format:
projects/{project_number}/policies/{constraint_name}
folders/{folder_id}/policies/{constraint_name}
organizations/{organization_id}/policies/{constraint_name}
Expand Down Expand Up @@ -805,6 +811,11 @@ class Violation(proto.Message):
acknowledged field is marked as false.
This field is a member of `oneof`_ ``_acknowledgement_time``.
exception_audit_log_link (str):
Output only. Immutable. Audit Log link to
find business justification provided for
violation exception. Format:
https://console.cloud.google.com/logs/query;query={logName}{protoPayload.resourceName}{protoPayload.methodName}{timeRange}{organization}
"""

class State(proto.Enum):
Expand Down Expand Up @@ -996,6 +1007,10 @@ class Console(proto.Message):
optional=True,
message=timestamp_pb2.Timestamp,
)
exception_audit_log_link = proto.Field(
proto.STRING,
number=16,
)


__all__ = tuple(sorted(__protobuf__.manifest))
Original file line number Diff line number Diff line change
Expand Up @@ -2709,6 +2709,7 @@ def test_get_violation(request_type, transport: str = "grpc"):
audit_log_link="audit_log_link_value",
non_compliant_org_policy="non_compliant_org_policy_value",
acknowledged=True,
exception_audit_log_link="exception_audit_log_link_value",
)
response = client.get_violation(request)

Expand All @@ -2727,6 +2728,7 @@ def test_get_violation(request_type, transport: str = "grpc"):
assert response.audit_log_link == "audit_log_link_value"
assert response.non_compliant_org_policy == "non_compliant_org_policy_value"
assert response.acknowledged is True
assert response.exception_audit_log_link == "exception_audit_log_link_value"


def test_get_violation_empty_call():
Expand Down Expand Up @@ -2771,6 +2773,7 @@ async def test_get_violation_async(
audit_log_link="audit_log_link_value",
non_compliant_org_policy="non_compliant_org_policy_value",
acknowledged=True,
exception_audit_log_link="exception_audit_log_link_value",
)
)
response = await client.get_violation(request)
Expand All @@ -2790,6 +2793,7 @@ async def test_get_violation_async(
assert response.audit_log_link == "audit_log_link_value"
assert response.non_compliant_org_policy == "non_compliant_org_policy_value"
assert response.acknowledged is True
assert response.exception_audit_log_link == "exception_audit_log_link_value"


@pytest.mark.asyncio
Expand Down

0 comments on commit 65e7590

Please sign in to comment.