Skip to content

Commit

Permalink
feat: [google-cloud-network-services] A new field metadata is added…
Browse files Browse the repository at this point in the history
… to message `.google.cloud.networkservices.v1.LbTrafficExtension` (#12763)

- [ ] Regenerate this pull request now.

BEGIN_COMMIT_OVERRIDE
feat: A new field `metadata` is added to message
`.google.cloud.networkservices.v1.LbTrafficExtension`
feat: A new field `metadata` is added to message
`.google.cloud.networkservices.v1.LbRouteExtension`
docs: update the comments for dep resources
END_COMMIT_OVERRIDE



PiperOrigin-RevId: 638948066

Source-Link:
googleapis/googleapis@2244fe4

Source-Link:
googleapis/googleapis-gen@c5ce682
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW5ldHdvcmstc2VydmljZXMvLk93bEJvdC55YW1sIiwiaCI6ImM1Y2U2ODI4NTMwNjA5OGNlNzk3NTMyYmQwMjEyMTE2MDc1N2Y3YjIifQ==

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <[email protected]>
  • Loading branch information
3 people authored Jun 3, 2024
1 parent 9fd16ad commit d219016
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
from google.longrunning import operations_pb2 # type: ignore
from google.protobuf import empty_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore
from google.protobuf import struct_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore

from google.cloud.network_services_v1.services.dep_service import pagers
Expand Down Expand Up @@ -714,7 +715,7 @@ async def sample_update_lb_traffic_extension():
on the ``request`` instance; if ``request`` is provided, this
should not be set.
update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`):
Required. Used to specify the fields to be overwritten
Optional. Used to specify the fields to be overwritten
in the ``LbTrafficExtension`` resource by the update.
The fields specified in the update_mask are relative to
the resource, not the full request. A field is
Expand Down Expand Up @@ -1366,7 +1367,7 @@ async def sample_update_lb_route_extension():
on the ``request`` instance; if ``request`` is provided, this
should not be set.
update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`):
Required. Used to specify the fields to be overwritten
Optional. Used to specify the fields to be overwritten
in the ``LbRouteExtension`` resource by the update. The
fields specified in the update_mask are relative to the
resource, not the full request. A field is overwritten
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
from google.longrunning import operations_pb2 # type: ignore
from google.protobuf import empty_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore
from google.protobuf import struct_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore

from google.cloud.network_services_v1.services.dep_service import pagers
Expand Down Expand Up @@ -1146,7 +1147,7 @@ def sample_update_lb_traffic_extension():
on the ``request`` instance; if ``request`` is provided, this
should not be set.
update_mask (google.protobuf.field_mask_pb2.FieldMask):
Required. Used to specify the fields to be overwritten
Optional. Used to specify the fields to be overwritten
in the ``LbTrafficExtension`` resource by the update.
The fields specified in the update_mask are relative to
the resource, not the full request. A field is
Expand Down Expand Up @@ -1789,7 +1790,7 @@ def sample_update_lb_route_extension():
on the ``request`` instance; if ``request`` is provided, this
should not be set.
update_mask (google.protobuf.field_mask_pb2.FieldMask):
Required. Used to specify the fields to be overwritten
Optional. Used to specify the fields to be overwritten
in the ``LbRouteExtension`` resource by the update. The
fields specified in the update_mask are relative to the
resource, not the full request. A field is overwritten
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1478,9 +1478,7 @@ class _UpdateLbRouteExtension(DepServiceRestStub):
def __hash__(self):
return hash("UpdateLbRouteExtension")

__REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {
"updateMask": {},
}
__REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}

@classmethod
def _get_unset_required_fields(cls, message_dict):
Expand Down Expand Up @@ -1575,9 +1573,7 @@ class _UpdateLbTrafficExtension(DepServiceRestStub):
def __hash__(self):
return hash("UpdateLbTrafficExtension")

__REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {
"updateMask": {},
}
__REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}

@classmethod
def _get_unset_required_fields(cls, message_dict):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

from google.protobuf import duration_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore
from google.protobuf import struct_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore
import proto # type: ignore

Expand Down Expand Up @@ -179,8 +180,8 @@ class Extension(proto.Message):
supported_events (MutableSequence[google.cloud.network_services_v1.types.EventType]):
Optional. A set of events during request or response
processing for which this extension is called. This field is
required for the ``LbTrafficExtension`` resource. It's not
relevant for the ``LbRouteExtension`` resource.
required for the ``LbTrafficExtension`` resource. It must
not be set for the ``LbRouteExtension`` resource.
timeout (google.protobuf.duration_pb2.Duration):
Optional. Specifies the timeout for each
individual message on the stream. The timeout
Expand Down Expand Up @@ -305,6 +306,15 @@ class LbTrafficExtension(proto.Message):
``EXTERNAL_MANAGED``. For more information, refer to
`Choosing a load
balancer <https://cloud.google.com/load-balancing/docs/backend-service>`__.
metadata (google.protobuf.struct_pb2.Struct):
Optional. The metadata provided here is included in the
``ProcessingRequest.metadata_context.filter_metadata`` map
field. The metadata is available under the key
``com.google.lb_traffic_extension.<resource_name>``. The
following variables are supported in the metadata:
``{forwarding_rule_id}`` - substituted with the forwarding
rule's fully qualified resource name.
"""

name: str = proto.Field(
Expand Down Expand Up @@ -344,6 +354,11 @@ class LbTrafficExtension(proto.Message):
number=8,
enum="LoadBalancingScheme",
)
metadata: struct_pb2.Struct = proto.Field(
proto.MESSAGE,
number=10,
message=struct_pb2.Struct,
)


class ListLbTrafficExtensionsRequest(proto.Message):
Expand Down Expand Up @@ -498,7 +513,7 @@ class UpdateLbTrafficExtensionRequest(proto.Message):
Attributes:
update_mask (google.protobuf.field_mask_pb2.FieldMask):
Required. Used to specify the fields to be overwritten in
Optional. Used to specify the fields to be overwritten in
the ``LbTrafficExtension`` resource by the update. The
fields specified in the update_mask are relative to the
resource, not the full request. A field is overwritten if it
Expand Down Expand Up @@ -630,6 +645,17 @@ class LbRouteExtension(proto.Message):
``EXTERNAL_MANAGED``. For more information, refer to
`Choosing a load
balancer <https://cloud.google.com/load-balancing/docs/backend-service>`__.
metadata (google.protobuf.struct_pb2.Struct):
Optional. The metadata provided here is included as part of
the ``metadata_context`` (of type
``google.protobuf.Struct``) in the ``ProcessingRequest``
message sent to the extension server. The metadata is
available under the namespace
``com.google.lb_route_extension.<resource_name>``. The
following variables are supported in the metadata Struct:
``{forwarding_rule_id}`` - substituted with the forwarding
rule's fully qualified resource name.
"""

name: str = proto.Field(
Expand Down Expand Up @@ -669,6 +695,11 @@ class LbRouteExtension(proto.Message):
number=8,
enum="LoadBalancingScheme",
)
metadata: struct_pb2.Struct = proto.Field(
proto.MESSAGE,
number=10,
message=struct_pb2.Struct,
)


class ListLbRouteExtensionsRequest(proto.Message):
Expand Down Expand Up @@ -823,7 +854,7 @@ class UpdateLbRouteExtensionRequest(proto.Message):
Attributes:
update_mask (google.protobuf.field_mask_pb2.FieldMask):
Required. Used to specify the fields to be overwritten in
Optional. Used to specify the fields to be overwritten in
the ``LbRouteExtension`` resource by the update. The fields
specified in the update_mask are relative to the resource,
not the full request. A field is overwritten if it is in the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ class network_servicesCallTransformer(cst.CSTTransformer):
'update_gateway': ('gateway', 'update_mask', ),
'update_grpc_route': ('grpc_route', 'update_mask', ),
'update_http_route': ('http_route', 'update_mask', ),
'update_lb_route_extension': ('update_mask', 'lb_route_extension', 'request_id', ),
'update_lb_traffic_extension': ('update_mask', 'lb_traffic_extension', 'request_id', ),
'update_lb_route_extension': ('lb_route_extension', 'update_mask', 'request_id', ),
'update_lb_traffic_extension': ('lb_traffic_extension', 'update_mask', 'request_id', ),
'update_mesh': ('mesh', 'update_mask', ),
'update_tcp_route': ('tcp_route', 'update_mask', ),
'update_tls_route': ('tls_route', 'update_mask', ),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
from google.protobuf import empty_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore
from google.protobuf import json_format
from google.protobuf import struct_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore
import grpc
from grpc.experimental import aio
Expand Down Expand Up @@ -6266,6 +6267,7 @@ def test_create_lb_traffic_extension_rest(request_type):
}
],
"load_balancing_scheme": 1,
"metadata": {"fields": {}},
}
# The version of a generated dependency at test runtime may differ from the version used during generation.
# Delete any fields which are not present in the current runtime dependency
Expand Down Expand Up @@ -6714,6 +6716,7 @@ def test_update_lb_traffic_extension_rest(request_type):
}
],
"load_balancing_scheme": 1,
"metadata": {"fields": {}},
}
# The version of a generated dependency at test runtime may differ from the version used during generation.
# Delete any fields which are not present in the current runtime dependency
Expand Down Expand Up @@ -6936,12 +6939,7 @@ def test_update_lb_traffic_extension_rest_unset_required_fields():
"updateMask",
)
)
& set(
(
"updateMask",
"lbTrafficExtension",
)
)
& set(("lbTrafficExtension",))
)


Expand Down Expand Up @@ -8154,6 +8152,7 @@ def test_create_lb_route_extension_rest(request_type):
}
],
"load_balancing_scheme": 1,
"metadata": {"fields": {}},
}
# The version of a generated dependency at test runtime may differ from the version used during generation.
# Delete any fields which are not present in the current runtime dependency
Expand Down Expand Up @@ -8599,6 +8598,7 @@ def test_update_lb_route_extension_rest(request_type):
}
],
"load_balancing_scheme": 1,
"metadata": {"fields": {}},
}
# The version of a generated dependency at test runtime may differ from the version used during generation.
# Delete any fields which are not present in the current runtime dependency
Expand Down Expand Up @@ -8819,12 +8819,7 @@ def test_update_lb_route_extension_rest_unset_required_fields():
"updateMask",
)
)
& set(
(
"updateMask",
"lbRouteExtension",
)
)
& set(("lbRouteExtension",))
)


Expand Down

0 comments on commit d219016

Please sign in to comment.