k8s_crds_gateway_api/
httproutes.rs

1// WARNING: generated by kopium - manual changes will be overwritten
2// kopium command: kopium -f httproutes.yml --schema=derived --docs -b
3// kopium version: 0.16.2
4
5use kube_derive::CustomResource;
6#[cfg(feature = "schemars")]
7use schemars::JsonSchema;
8use serde::{Deserialize, Serialize};
9#[cfg(feature = "builder")]
10use typed_builder::TypedBuilder;
11
12/// Spec defines the desired state of HTTPRoute.
13#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, PartialEq, Default)]
14#[cfg_attr(feature = "builder", derive(TypedBuilder))]
15#[cfg_attr(feature = "schemars", derive(JsonSchema))]
16#[cfg_attr(not(feature = "schemars"), kube(schema = "disabled"))]
17#[kube(
18    group = "gateway.networking.k8s.io",
19    version = "v1",
20    kind = "HTTPRoute",
21    plural = "httproutes"
22)]
23#[kube(namespaced)]
24#[kube(status = "HTTPRouteStatus")]
25pub struct HTTPRouteSpec {
26    /// Hostnames defines a set of hostnames that should match against the HTTP Host header to select a HTTPRoute used to process the request. Implementations MUST ignore any port value specified in the HTTP Host header while performing a match and (absent of any applicable header modification configuration) MUST forward this header unmodified to the backend.
27    ///  Valid values for Hostnames are determined by RFC 1123 definition of a hostname with 2 notable exceptions:
28    ///  1. IPs are not allowed. 2. A hostname may be prefixed with a wildcard label (`*.`). The wildcard label must appear by itself as the first label.
29    ///  If a hostname is specified by both the Listener and HTTPRoute, there must be at least one intersecting hostname for the HTTPRoute to be attached to the Listener. For example:
30    ///  * A Listener with `test.example.com` as the hostname matches HTTPRoutes that have either not specified any hostnames, or have specified at least one of `test.example.com` or `*.example.com`. * A Listener with `*.example.com` as the hostname matches HTTPRoutes that have either not specified any hostnames or have specified at least one hostname that matches the Listener hostname. For example, `*.example.com`, `test.example.com`, and `foo.test.example.com` would all match. On the other hand, `example.com` and `test.example.net` would not match.
31    ///  Hostnames that are prefixed with a wildcard label (`*.`) are interpreted as a suffix match. That means that a match for `*.example.com` would match both `test.example.com`, and `foo.test.example.com`, but not `example.com`.
32    ///  If both the Listener and HTTPRoute have specified hostnames, any HTTPRoute hostnames that do not match the Listener hostname MUST be ignored. For example, if a Listener specified `*.example.com`, and the HTTPRoute specified `test.example.com` and `test.example.net`, `test.example.net` must not be considered for a match.
33    ///  If both the Listener and HTTPRoute have specified hostnames, and none match with the criteria above, then the HTTPRoute is not accepted. The implementation must raise an 'Accepted' Condition with a status of `False` in the corresponding RouteParentStatus.
34    ///  In the event that multiple HTTPRoutes specify intersecting hostnames (e.g. overlapping wildcard matching and exact matching hostnames), precedence must be given to rules from the HTTPRoute with the largest number of:
35    ///  * Characters in a matching non-wildcard hostname. * Characters in a matching hostname.
36    ///  If ties exist across multiple Routes, the matching precedence rules for HTTPRouteMatches takes over.
37    ///  Support: Core
38    #[serde(default, skip_serializing_if = "Option::is_none")]
39    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
40    pub hostnames: Option<Vec<String>>,
41    /// ParentRefs references the resources (usually Gateways) that a Route wants to be attached to. Note that the referenced parent resource needs to allow this for the attachment to be complete. For Gateways, that means the Gateway needs to allow attachment from Routes of this kind and namespace. For Services, that means the Service must either be in the same namespace for a "producer" route, or the mesh implementation must support and allow "consumer" routes for the referenced Service. ReferenceGrant is not applicable for governing ParentRefs to Services - it is not possible to create a "producer" route for a Service in a different namespace from the Route.
42    ///  There are two kinds of parent resources with "Core" support:
43    ///  * Gateway (Gateway conformance profile)  This API may be extended in the future to support additional kinds of parent resources.
44    ///  ParentRefs must be _distinct_. This means either that:
45    ///  * They select different objects.  If this is the case, then parentRef entries are distinct. In terms of fields, this means that the multi-part key defined by `group`, `kind`, `namespace`, and `name` must be unique across all parentRef entries in the Route. * They do not select different objects, but for each optional field used, each ParentRef that selects the same object must set the same set of optional fields to different values. If one ParentRef sets a combination of optional fields, all must set the same combination.
46    ///  Some examples:
47    ///  * If one ParentRef sets `sectionName`, all ParentRefs referencing the same object must also set `sectionName`. * If one ParentRef sets `port`, all ParentRefs referencing the same object must also set `port`. * If one ParentRef sets `sectionName` and `port`, all ParentRefs referencing the same object must also set `sectionName` and `port`.
48    ///  It is possible to separately reference multiple distinct objects that may be collapsed by an implementation. For example, some implementations may choose to merge compatible Gateway Listeners together. If that is the case, the list of routes attached to those resources should also be merged.
49    ///  Note that for ParentRefs that cross namespace boundaries, there are specific rules. Cross-namespace references are only valid if they are explicitly allowed by something in the namespace they are referring to. For example, Gateway has the AllowedRoutes field, and ReferenceGrant provides a generic way to enable other kinds of cross-namespace reference.
50    ///   
51    ///  
52    #[serde(
53        default,
54        skip_serializing_if = "Option::is_none",
55        rename = "parentRefs"
56    )]
57    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
58    pub parent_refs: Option<Vec<HTTPRouteParentRefs>>,
59    /// Rules are a list of HTTP matchers, filters and actions.
60    #[serde(default, skip_serializing_if = "Option::is_none")]
61    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
62    pub rules: Option<Vec<HTTPRouteRules>>,
63}
64
65/// ParentReference identifies an API object (usually a Gateway) that can be considered a parent of this resource (usually a route). There are two kinds of parent resources with "Core" support:
66///  * Gateway (Gateway conformance profile) * Service (Mesh conformance profile, experimental, ClusterIP Services only)
67///  This API may be extended in the future to support additional kinds of parent resources.
68///  The API object must be valid in the cluster; the Group and Kind must be registered in the cluster for this reference to be valid.
69#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Default)]
70#[cfg_attr(feature = "builder", derive(TypedBuilder))]
71#[cfg_attr(feature = "schemars", derive(JsonSchema))]
72pub struct HTTPRouteParentRefs {
73    /// Group is the group of the referent. When unspecified, "gateway.networking.k8s.io" is inferred. To set the core API group (such as for a "Service" kind referent), Group must be explicitly set to "" (empty string).
74    ///  Support: Core
75    #[serde(default, skip_serializing_if = "Option::is_none")]
76    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
77    pub group: Option<String>,
78    /// Kind is kind of the referent.
79    ///  There are two kinds of parent resources with "Core" support:
80    ///  * Gateway (Gateway conformance profile) * Service (Mesh conformance profile, experimental, ClusterIP Services only)
81    ///  Support for other resources is Implementation-Specific.
82    #[serde(default, skip_serializing_if = "Option::is_none")]
83    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
84    pub kind: Option<String>,
85    /// Name is the name of the referent.
86    ///  Support: Core
87    pub name: String,
88    /// Namespace is the namespace of the referent. When unspecified, this refers to the local namespace of the Route.
89    ///  Note that there are specific rules for ParentRefs which cross namespace boundaries. Cross-namespace references are only valid if they are explicitly allowed by something in the namespace they are referring to. For example: Gateway has the AllowedRoutes field, and ReferenceGrant provides a generic way to enable any other kind of cross-namespace reference.
90    ///   
91    ///  Support: Core
92    #[serde(default, skip_serializing_if = "Option::is_none")]
93    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
94    pub namespace: Option<String>,
95    /// SectionName is the name of a section within the target resource. In the following resources, SectionName is interpreted as the following:
96    ///  * Gateway: Listener Name. When both Port (experimental) and SectionName are specified, the name and port of the selected listener must match both specified values. * Service: Port Name. When both Port (experimental) and SectionName are specified, the name and port of the selected listener must match both specified values. Note that attaching Routes to Services as Parents is part of experimental Mesh support and is not supported for any other purpose.
97    ///  Implementations MAY choose to support attaching Routes to other resources. If that is the case, they MUST clearly document how SectionName is interpreted.
98    ///  When unspecified (empty string), this will reference the entire resource. For the purpose of status, an attachment is considered successful if at least one section in the parent resource accepts it. For example, Gateway listeners can restrict which Routes can attach to them by Route kind, namespace, or hostname. If 1 of 2 Gateway listeners accept attachment from the referencing Route, the Route MUST be considered successfully attached. If no Gateway listeners accept attachment from this Route, the Route MUST be considered detached from the Gateway.
99    ///  Support: Core
100    #[serde(
101        default,
102        skip_serializing_if = "Option::is_none",
103        rename = "sectionName"
104    )]
105    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
106    pub section_name: Option<String>,
107}
108
109/// HTTPRouteRule defines semantics for matching an HTTP request based on conditions (matches), processing it (filters), and forwarding the request to an API object (backendRefs).
110#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Default)]
111#[cfg_attr(feature = "builder", derive(TypedBuilder))]
112#[cfg_attr(feature = "schemars", derive(JsonSchema))]
113pub struct HTTPRouteRules {
114    /// BackendRefs defines the backend(s) where matching requests should be sent.
115    ///  Failure behavior here depends on how many BackendRefs are specified and how many are invalid.
116    ///  If *all* entries in BackendRefs are invalid, and there are also no filters specified in this route rule, *all* traffic which matches this rule MUST receive a 500 status code.
117    ///  See the HTTPBackendRef definition for the rules about what makes a single HTTPBackendRef invalid.
118    ///  When a HTTPBackendRef is invalid, 500 status codes MUST be returned for requests that would have otherwise been routed to an invalid backend. If multiple backends are specified, and some are invalid, the proportion of requests that would otherwise have been routed to an invalid backend MUST receive a 500 status code.
119    ///  For example, if two backends are specified with equal weights, and one is invalid, 50 percent of traffic must receive a 500. Implementations may choose how that 50 percent is determined.
120    ///  Support: Core for Kubernetes Service
121    ///  Support: Extended for Kubernetes ServiceImport
122    ///  Support: Implementation-specific for any other resource
123    ///  Support for weight: Core
124    #[serde(
125        default,
126        skip_serializing_if = "Option::is_none",
127        rename = "backendRefs"
128    )]
129    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
130    pub backend_refs: Option<Vec<HTTPRouteRulesBackendRefs>>,
131    /// Filters define the filters that are applied to requests that match this rule.
132    ///  The effects of ordering of multiple behaviors are currently unspecified. This can change in the future based on feedback during the alpha stage.
133    ///  Conformance-levels at this level are defined based on the type of filter:
134    ///  - ALL core filters MUST be supported by all implementations. - Implementers are encouraged to support extended filters. - Implementation-specific custom filters have no API guarantees across implementations.
135    ///  Specifying the same filter multiple times is not supported unless explicitly indicated in the filter.
136    ///  All filters are expected to be compatible with each other except for the URLRewrite and RequestRedirect filters, which may not be combined. If an implementation can not support other combinations of filters, they must clearly document that limitation. In cases where incompatible or unsupported filters are specified and cause the `Accepted` condition to be set to status `False`, implementations may use the `IncompatibleFilters` reason to specify this configuration error.
137    ///  Support: Core
138    #[serde(default, skip_serializing_if = "Option::is_none")]
139    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
140    pub filters: Option<Vec<HTTPRouteRulesFilters>>,
141    /// Matches define conditions used for matching the rule against incoming HTTP requests. Each match is independent, i.e. this rule will be matched if **any** one of the matches is satisfied.
142    ///  For example, take the following matches configuration:
143    ///  ``` matches: - path: value: "/foo" headers: - name: "version" value: "v2" - path: value: "/v2/foo" ```
144    ///  For a request to match against this rule, a request must satisfy EITHER of the two conditions:
145    ///  - path prefixed with `/foo` AND contains the header `version: v2` - path prefix of `/v2/foo`
146    ///  See the documentation for HTTPRouteMatch on how to specify multiple match conditions that should be ANDed together.
147    ///  If no matches are specified, the default is a prefix path match on "/", which has the effect of matching every HTTP request.
148    ///  Proxy or Load Balancer routing configuration generated from HTTPRoutes MUST prioritize matches based on the following criteria, continuing on ties. Across all rules specified on applicable Routes, precedence must be given to the match having:
149    ///  * "Exact" path match. * "Prefix" path match with largest number of characters. * Method match. * Largest number of header matches. * Largest number of query param matches.
150    ///  Note: The precedence of RegularExpression path matches are implementation-specific.
151    ///  If ties still exist across multiple Routes, matching precedence MUST be determined in order of the following criteria, continuing on ties:
152    ///  * The oldest Route based on creation timestamp. * The Route appearing first in alphabetical order by "{namespace}/{name}".
153    ///  If ties still exist within an HTTPRoute, matching precedence MUST be granted to the FIRST matching rule (in list order) with a match meeting the above criteria.
154    ///  When no rules matching a request have been successfully attached to the parent a request is coming from, a HTTP 404 status code MUST be returned.
155    #[serde(default, skip_serializing_if = "Option::is_none")]
156    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
157    pub matches: Option<Vec<HTTPRouteRulesMatches>>,
158}
159
160/// HTTPBackendRef defines how a HTTPRoute forwards a HTTP request.
161///  Note that when a namespace different than the local namespace is specified, a ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details.
162///  <gateway:experimental:description>
163///  When the BackendRef points to a Kubernetes Service, implementations SHOULD honor the appProtocol field if it is set for the target Service Port.
164///  Implementations supporting appProtocol SHOULD recognize the Kubernetes Standard Application Protocols defined in KEP-3726.
165///  If a Service appProtocol isn't specified, an implementation MAY infer the backend protocol through its own means. Implementations MAY infer the protocol from the Route type referring to the backend Service.
166///  If a Route is not able to send traffic to the backend using the specified protocol then the backend is considered invalid. Implementations MUST set the "ResolvedRefs" condition to "False" with the "UnsupportedProtocol" reason.
167///  </gateway:experimental:description>
168#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Default)]
169#[cfg_attr(feature = "builder", derive(TypedBuilder))]
170#[cfg_attr(feature = "schemars", derive(JsonSchema))]
171pub struct HTTPRouteRulesBackendRefs {
172    /// Filters defined at this level should be executed if and only if the request is being forwarded to the backend defined here.
173    ///  Support: Implementation-specific (For broader support of filters, use the Filters field in HTTPRouteRule.)
174    #[serde(default, skip_serializing_if = "Option::is_none")]
175    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
176    pub filters: Option<Vec<HTTPRouteRulesBackendRefsFilters>>,
177    /// Group is the group of the referent. For example, "gateway.networking.k8s.io". When unspecified or empty string, core API group is inferred.
178    #[serde(default, skip_serializing_if = "Option::is_none")]
179    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
180    pub group: Option<String>,
181    /// Kind is the Kubernetes resource kind of the referent. For example "Service".
182    ///  Defaults to "Service" when not specified.
183    ///  ExternalName services can refer to CNAME DNS records that may live outside of the cluster and as such are difficult to reason about in terms of conformance. They also may not be safe to forward to (see CVE-2021-25740 for more information). Implementations SHOULD NOT support ExternalName Services.
184    ///  Support: Core (Services with a type other than ExternalName)
185    ///  Support: Implementation-specific (Services with type ExternalName)
186    #[serde(default, skip_serializing_if = "Option::is_none")]
187    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
188    pub kind: Option<String>,
189    /// Name is the name of the referent.
190    pub name: String,
191    /// Namespace is the namespace of the backend. When unspecified, the local namespace is inferred.
192    ///  Note that when a namespace different than the local namespace is specified, a ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details.
193    ///  Support: Core
194    #[serde(default, skip_serializing_if = "Option::is_none")]
195    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
196    pub namespace: Option<String>,
197    /// Port specifies the destination port number to use for this resource. Port is required when the referent is a Kubernetes Service. In this case, the port number is the service port number, not the target port. For other resources, destination port might be derived from the referent resource or this field.
198    #[serde(default, skip_serializing_if = "Option::is_none")]
199    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
200    pub port: Option<i32>,
201    /// Weight specifies the proportion of requests forwarded to the referenced backend. This is computed as weight/(sum of all weights in this BackendRefs list). For non-zero values, there may be some epsilon from the exact proportion defined here depending on the precision an implementation supports. Weight is not a percentage and the sum of weights does not need to equal 100.
202    ///  If only one backend is specified and it has a weight greater than 0, 100% of the traffic is forwarded to that backend. If weight is set to 0, no traffic should be forwarded for this entry. If unspecified, weight defaults to 1.
203    ///  Support for this field varies based on the context where used.
204    #[serde(default, skip_serializing_if = "Option::is_none")]
205    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
206    pub weight: Option<i32>,
207}
208
209/// HTTPRouteFilter defines processing steps that must be completed during the request or response lifecycle. HTTPRouteFilters are meant as an extension point to express processing that may be done in Gateway implementations. Some examples include request or response modification, implementing authentication strategies, rate-limiting, and traffic shaping. API guarantee/conformance is defined based on the type of the filter.
210#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
211#[cfg_attr(feature = "builder", derive(TypedBuilder))]
212#[cfg_attr(feature = "schemars", derive(JsonSchema))]
213pub struct HTTPRouteRulesBackendRefsFilters {
214    /// ExtensionRef is an optional, implementation-specific extension to the "filter" behavior.  For example, resource "myroutefilter" in group "networking.example.net"). ExtensionRef MUST NOT be used for core and extended filters.
215    ///  This filter can be used multiple times within the same rule.
216    ///  Support: Implementation-specific
217    #[serde(
218        default,
219        skip_serializing_if = "Option::is_none",
220        rename = "extensionRef"
221    )]
222    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
223    pub extension_ref: Option<HTTPRouteRulesBackendRefsFiltersExtensionRef>,
224    /// RequestHeaderModifier defines a schema for a filter that modifies request headers.
225    ///  Support: Core
226    #[serde(
227        default,
228        skip_serializing_if = "Option::is_none",
229        rename = "requestHeaderModifier"
230    )]
231    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
232    pub request_header_modifier: Option<HTTPRouteRulesBackendRefsFiltersRequestHeaderModifier>,
233    /// RequestMirror defines a schema for a filter that mirrors requests. Requests are sent to the specified destination, but responses from that destination are ignored.
234    ///  This filter can be used multiple times within the same rule. Note that not all implementations will be able to support mirroring to multiple backends.
235    ///  Support: Extended
236    #[serde(
237        default,
238        skip_serializing_if = "Option::is_none",
239        rename = "requestMirror"
240    )]
241    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
242    pub request_mirror: Option<HTTPRouteRulesBackendRefsFiltersRequestMirror>,
243    /// RequestRedirect defines a schema for a filter that responds to the request with an HTTP redirection.
244    ///  Support: Core
245    #[serde(
246        default,
247        skip_serializing_if = "Option::is_none",
248        rename = "requestRedirect"
249    )]
250    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
251    pub request_redirect: Option<HTTPRouteRulesBackendRefsFiltersRequestRedirect>,
252    /// ResponseHeaderModifier defines a schema for a filter that modifies response headers.
253    ///  Support: Extended
254    #[serde(
255        default,
256        skip_serializing_if = "Option::is_none",
257        rename = "responseHeaderModifier"
258    )]
259    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
260    pub response_header_modifier: Option<HTTPRouteRulesBackendRefsFiltersResponseHeaderModifier>,
261    /// Type identifies the type of filter to apply. As with other API fields, types are classified into three conformance levels:
262    ///  - Core: Filter types and their corresponding configuration defined by "Support: Core" in this package, e.g. "RequestHeaderModifier". All implementations must support core filters.
263    ///  - Extended: Filter types and their corresponding configuration defined by "Support: Extended" in this package, e.g. "RequestMirror". Implementers are encouraged to support extended filters.
264    ///  - Implementation-specific: Filters that are defined and supported by specific vendors. In the future, filters showing convergence in behavior across multiple implementations will be considered for inclusion in extended or core conformance levels. Filter-specific configuration for such filters is specified using the ExtensionRef field. `Type` should be set to "ExtensionRef" for custom filters.
265    ///  Implementers are encouraged to define custom implementation types to extend the core API with implementation-specific behavior.
266    ///  If a reference to a custom filter type cannot be resolved, the filter MUST NOT be skipped. Instead, requests that would have been processed by that filter MUST receive a HTTP error response.
267    ///  Note that values may be added to this enum, implementations must ensure that unknown values will not cause a crash.
268    ///  Unknown values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason of `UnsupportedValue`.
269    #[serde(rename = "type")]
270    pub r#type: HTTPRouteRulesBackendRefsFiltersType,
271    /// URLRewrite defines a schema for a filter that modifies a request during forwarding.
272    ///  Support: Extended
273    #[serde(
274        default,
275        skip_serializing_if = "Option::is_none",
276        rename = "urlRewrite"
277    )]
278    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
279    pub url_rewrite: Option<HTTPRouteRulesBackendRefsFiltersUrlRewrite>,
280}
281
282/// ExtensionRef is an optional, implementation-specific extension to the "filter" behavior.  For example, resource "myroutefilter" in group "networking.example.net"). ExtensionRef MUST NOT be used for core and extended filters.
283///  This filter can be used multiple times within the same rule.
284///  Support: Implementation-specific
285#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
286#[cfg_attr(feature = "builder", derive(TypedBuilder))]
287#[cfg_attr(feature = "schemars", derive(JsonSchema))]
288pub struct HTTPRouteRulesBackendRefsFiltersExtensionRef {
289    /// Group is the group of the referent. For example, "gateway.networking.k8s.io". When unspecified or empty string, core API group is inferred.
290    pub group: String,
291    /// Kind is kind of the referent. For example "HTTPRoute" or "Service".
292    pub kind: String,
293    /// Name is the name of the referent.
294    pub name: String,
295}
296
297/// RequestHeaderModifier defines a schema for a filter that modifies request headers.
298///  Support: Core
299#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
300#[cfg_attr(feature = "builder", derive(TypedBuilder))]
301#[cfg_attr(feature = "schemars", derive(JsonSchema))]
302pub struct HTTPRouteRulesBackendRefsFiltersRequestHeaderModifier {
303    /// Add adds the given header(s) (name, value) to the request before the action. It appends to any existing values associated with the header name.
304    ///  Input: GET /foo HTTP/1.1 my-header: foo
305    ///  Config: add: - name: "my-header" value: "bar,baz"
306    ///  Output: GET /foo HTTP/1.1 my-header: foo,bar,baz
307    #[serde(default, skip_serializing_if = "Option::is_none")]
308    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
309    pub add: Option<Vec<HTTPRouteRulesBackendRefsFiltersRequestHeaderModifierAdd>>,
310    /// Remove the given header(s) from the HTTP request before the action. The value of Remove is a list of HTTP header names. Note that the header names are case-insensitive (see https://datatracker.ietf.org/doc/html/rfc2616#section-4.2).
311    ///  Input: GET /foo HTTP/1.1 my-header1: foo my-header2: bar my-header3: baz
312    ///  Config: remove: ["my-header1", "my-header3"]
313    ///  Output: GET /foo HTTP/1.1 my-header2: bar
314    #[serde(default, skip_serializing_if = "Option::is_none")]
315    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
316    pub remove: Option<Vec<String>>,
317    /// Set overwrites the request with the given header (name, value) before the action.
318    ///  Input: GET /foo HTTP/1.1 my-header: foo
319    ///  Config: set: - name: "my-header" value: "bar"
320    ///  Output: GET /foo HTTP/1.1 my-header: bar
321    #[serde(default, skip_serializing_if = "Option::is_none")]
322    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
323    pub set: Option<Vec<HTTPRouteRulesBackendRefsFiltersRequestHeaderModifierSet>>,
324}
325
326/// HTTPHeader represents an HTTP Header name and value as defined by RFC 7230.
327#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
328#[cfg_attr(feature = "builder", derive(TypedBuilder))]
329#[cfg_attr(feature = "schemars", derive(JsonSchema))]
330pub struct HTTPRouteRulesBackendRefsFiltersRequestHeaderModifierAdd {
331    /// Name is the name of the HTTP Header to be matched. Name matching MUST be case insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2).
332    ///  If multiple entries specify equivalent header names, the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent header name MUST be ignored. Due to the case-insensitivity of header names, "foo" and "Foo" are considered equivalent.
333    pub name: String,
334    /// Value is the value of HTTP Header to be matched.
335    pub value: String,
336}
337
338/// HTTPHeader represents an HTTP Header name and value as defined by RFC 7230.
339#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
340#[cfg_attr(feature = "builder", derive(TypedBuilder))]
341#[cfg_attr(feature = "schemars", derive(JsonSchema))]
342pub struct HTTPRouteRulesBackendRefsFiltersRequestHeaderModifierSet {
343    /// Name is the name of the HTTP Header to be matched. Name matching MUST be case insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2).
344    ///  If multiple entries specify equivalent header names, the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent header name MUST be ignored. Due to the case-insensitivity of header names, "foo" and "Foo" are considered equivalent.
345    pub name: String,
346    /// Value is the value of HTTP Header to be matched.
347    pub value: String,
348}
349
350/// RequestMirror defines a schema for a filter that mirrors requests. Requests are sent to the specified destination, but responses from that destination are ignored.
351///  This filter can be used multiple times within the same rule. Note that not all implementations will be able to support mirroring to multiple backends.
352///  Support: Extended
353#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
354#[cfg_attr(feature = "builder", derive(TypedBuilder))]
355#[cfg_attr(feature = "schemars", derive(JsonSchema))]
356pub struct HTTPRouteRulesBackendRefsFiltersRequestMirror {
357    /// BackendRef references a resource where mirrored requests are sent.
358    ///  Mirrored requests must be sent only to a single destination endpoint within this BackendRef, irrespective of how many endpoints are present within this BackendRef.
359    ///  If the referent cannot be found, this BackendRef is invalid and must be dropped from the Gateway. The controller must ensure the "ResolvedRefs" condition on the Route status is set to `status: False` and not configure this backend in the underlying implementation.
360    ///  If there is a cross-namespace reference to an *existing* object that is not allowed by a ReferenceGrant, the controller must ensure the "ResolvedRefs"  condition on the Route is set to `status: False`, with the "RefNotPermitted" reason and not configure this backend in the underlying implementation.
361    ///  In either error case, the Message of the `ResolvedRefs` Condition should be used to provide more detail about the problem.
362    ///  Support: Extended for Kubernetes Service
363    ///  Support: Implementation-specific for any other resource
364    #[serde(rename = "backendRef")]
365    pub backend_ref: HTTPRouteRulesBackendRefsFiltersRequestMirrorBackendRef,
366}
367
368/// BackendRef references a resource where mirrored requests are sent.
369///  Mirrored requests must be sent only to a single destination endpoint within this BackendRef, irrespective of how many endpoints are present within this BackendRef.
370///  If the referent cannot be found, this BackendRef is invalid and must be dropped from the Gateway. The controller must ensure the "ResolvedRefs" condition on the Route status is set to `status: False` and not configure this backend in the underlying implementation.
371///  If there is a cross-namespace reference to an *existing* object that is not allowed by a ReferenceGrant, the controller must ensure the "ResolvedRefs"  condition on the Route is set to `status: False`, with the "RefNotPermitted" reason and not configure this backend in the underlying implementation.
372///  In either error case, the Message of the `ResolvedRefs` Condition should be used to provide more detail about the problem.
373///  Support: Extended for Kubernetes Service
374///  Support: Implementation-specific for any other resource
375#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
376#[cfg_attr(feature = "builder", derive(TypedBuilder))]
377#[cfg_attr(feature = "schemars", derive(JsonSchema))]
378pub struct HTTPRouteRulesBackendRefsFiltersRequestMirrorBackendRef {
379    /// Group is the group of the referent. For example, "gateway.networking.k8s.io". When unspecified or empty string, core API group is inferred.
380    #[serde(default, skip_serializing_if = "Option::is_none")]
381    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
382    pub group: Option<String>,
383    /// Kind is the Kubernetes resource kind of the referent. For example "Service".
384    ///  Defaults to "Service" when not specified.
385    ///  ExternalName services can refer to CNAME DNS records that may live outside of the cluster and as such are difficult to reason about in terms of conformance. They also may not be safe to forward to (see CVE-2021-25740 for more information). Implementations SHOULD NOT support ExternalName Services.
386    ///  Support: Core (Services with a type other than ExternalName)
387    ///  Support: Implementation-specific (Services with type ExternalName)
388    #[serde(default, skip_serializing_if = "Option::is_none")]
389    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
390    pub kind: Option<String>,
391    /// Name is the name of the referent.
392    pub name: String,
393    /// Namespace is the namespace of the backend. When unspecified, the local namespace is inferred.
394    ///  Note that when a namespace different than the local namespace is specified, a ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details.
395    ///  Support: Core
396    #[serde(default, skip_serializing_if = "Option::is_none")]
397    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
398    pub namespace: Option<String>,
399    /// Port specifies the destination port number to use for this resource. Port is required when the referent is a Kubernetes Service. In this case, the port number is the service port number, not the target port. For other resources, destination port might be derived from the referent resource or this field.
400    #[serde(default, skip_serializing_if = "Option::is_none")]
401    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
402    pub port: Option<i32>,
403}
404
405/// RequestRedirect defines a schema for a filter that responds to the request with an HTTP redirection.
406///  Support: Core
407#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
408#[cfg_attr(feature = "builder", derive(TypedBuilder))]
409#[cfg_attr(feature = "schemars", derive(JsonSchema))]
410pub struct HTTPRouteRulesBackendRefsFiltersRequestRedirect {
411    /// Hostname is the hostname to be used in the value of the `Location` header in the response. When empty, the hostname in the `Host` header of the request is used.
412    ///  Support: Core
413    #[serde(default, skip_serializing_if = "Option::is_none")]
414    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
415    pub hostname: Option<String>,
416    /// Path defines parameters used to modify the path of the incoming request. The modified path is then used to construct the `Location` header. When empty, the request path is used as-is.
417    ///  Support: Extended
418    #[serde(default, skip_serializing_if = "Option::is_none")]
419    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
420    pub path: Option<HTTPRouteRulesBackendRefsFiltersRequestRedirectPath>,
421    /// Port is the port to be used in the value of the `Location` header in the response.
422    ///  If no port is specified, the redirect port MUST be derived using the following rules:
423    ///  * If redirect scheme is not-empty, the redirect port MUST be the well-known port associated with the redirect scheme. Specifically "http" to port 80 and "https" to port 443. If the redirect scheme does not have a well-known port, the listener port of the Gateway SHOULD be used. * If redirect scheme is empty, the redirect port MUST be the Gateway Listener port.
424    ///  Implementations SHOULD NOT add the port number in the 'Location' header in the following cases:
425    ///  * A Location header that will use HTTP (whether that is determined via the Listener protocol or the Scheme field) _and_ use port 80. * A Location header that will use HTTPS (whether that is determined via the Listener protocol or the Scheme field) _and_ use port 443.
426    ///  Support: Extended
427    #[serde(default, skip_serializing_if = "Option::is_none")]
428    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
429    pub port: Option<i32>,
430    /// Scheme is the scheme to be used in the value of the `Location` header in the response. When empty, the scheme of the request is used.
431    ///  Scheme redirects can affect the port of the redirect, for more information, refer to the documentation for the port field of this filter.
432    ///  Note that values may be added to this enum, implementations must ensure that unknown values will not cause a crash.
433    ///  Unknown values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason of `UnsupportedValue`.
434    ///  Support: Extended
435    #[serde(default, skip_serializing_if = "Option::is_none")]
436    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
437    pub scheme: Option<HTTPRouteRulesBackendRefsFiltersRequestRedirectScheme>,
438    /// StatusCode is the HTTP status code to be used in response.
439    ///  Note that values may be added to this enum, implementations must ensure that unknown values will not cause a crash.
440    ///  Unknown values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason of `UnsupportedValue`.
441    ///  Support: Core
442    #[serde(
443        default,
444        skip_serializing_if = "Option::is_none",
445        rename = "statusCode"
446    )]
447    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
448    pub status_code: Option<i64>,
449}
450
451/// Path defines parameters used to modify the path of the incoming request. The modified path is then used to construct the `Location` header. When empty, the request path is used as-is.
452///  Support: Extended
453#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
454#[cfg_attr(feature = "builder", derive(TypedBuilder))]
455#[cfg_attr(feature = "schemars", derive(JsonSchema))]
456pub struct HTTPRouteRulesBackendRefsFiltersRequestRedirectPath {
457    /// ReplaceFullPath specifies the value with which to replace the full path of a request during a rewrite or redirect.
458    #[serde(
459        default,
460        skip_serializing_if = "Option::is_none",
461        rename = "replaceFullPath"
462    )]
463    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
464    pub replace_full_path: Option<String>,
465    /// ReplacePrefixMatch specifies the value with which to replace the prefix match of a request during a rewrite or redirect. For example, a request to "/foo/bar" with a prefix match of "/foo" and a ReplacePrefixMatch of "/xyz" would be modified to "/xyz/bar".
466    ///  Note that this matches the behavior of the PathPrefix match type. This matches full path elements. A path element refers to the list of labels in the path split by the `/` separator. When specified, a trailing `/` is ignored. For example, the paths `/abc`, `/abc/`, and `/abc/def` would all match the prefix `/abc`, but the path `/abcd` would not.
467    ///  ReplacePrefixMatch is only compatible with a `PathPrefix` HTTPRouteMatch. Using any other HTTPRouteMatch type on the same HTTPRouteRule will result in the implementation setting the Accepted Condition for the Route to `status: False`.
468    ///  Request Path | Prefix Match | Replace Prefix | Modified Path -------------|--------------|----------------|---------- /foo/bar     | /foo         | /xyz           | /xyz/bar /foo/bar     | /foo         | /xyz/          | /xyz/bar /foo/bar     | /foo/        | /xyz           | /xyz/bar /foo/bar     | /foo/        | /xyz/          | /xyz/bar /foo         | /foo         | /xyz           | /xyz /foo/        | /foo         | /xyz           | /xyz/ /foo/bar     | /foo         | <empty string> | /bar /foo/        | /foo         | <empty string> | / /foo         | /foo         | <empty string> | / /foo/        | /foo         | /              | / /foo         | /foo         | /              | /
469    #[serde(
470        default,
471        skip_serializing_if = "Option::is_none",
472        rename = "replacePrefixMatch"
473    )]
474    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
475    pub replace_prefix_match: Option<String>,
476    /// Type defines the type of path modifier. Additional types may be added in a future release of the API.
477    ///  Note that values may be added to this enum, implementations must ensure that unknown values will not cause a crash.
478    ///  Unknown values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason of `UnsupportedValue`.
479    #[serde(rename = "type")]
480    pub r#type: HTTPRouteRulesBackendRefsFiltersRequestRedirectPathType,
481}
482
483/// Path defines parameters used to modify the path of the incoming request. The modified path is then used to construct the `Location` header. When empty, the request path is used as-is.
484///  Support: Extended
485#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
486#[cfg_attr(feature = "schemars", derive(JsonSchema))]
487pub enum HTTPRouteRulesBackendRefsFiltersRequestRedirectPathType {
488    ReplaceFullPath,
489    ReplacePrefixMatch,
490}
491
492/// RequestRedirect defines a schema for a filter that responds to the request with an HTTP redirection.
493///  Support: Core
494#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
495#[cfg_attr(feature = "schemars", derive(JsonSchema))]
496pub enum HTTPRouteRulesBackendRefsFiltersRequestRedirectScheme {
497    #[serde(rename = "http")]
498    Http,
499    #[serde(rename = "https")]
500    Https,
501}
502
503/// RequestRedirect defines a schema for a filter that responds to the request with an HTTP redirection.
504///  Support: Core
505#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
506#[cfg_attr(feature = "schemars", derive(JsonSchema))]
507pub enum HTTPRouteRulesBackendRefsFiltersRequestRedirectStatusCode {
508    #[serde(rename = "301")]
509    r#_301,
510    #[serde(rename = "302")]
511    r#_302,
512}
513
514/// ResponseHeaderModifier defines a schema for a filter that modifies response headers.
515///  Support: Extended
516#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
517#[cfg_attr(feature = "builder", derive(TypedBuilder))]
518#[cfg_attr(feature = "schemars", derive(JsonSchema))]
519pub struct HTTPRouteRulesBackendRefsFiltersResponseHeaderModifier {
520    /// Add adds the given header(s) (name, value) to the request before the action. It appends to any existing values associated with the header name.
521    ///  Input: GET /foo HTTP/1.1 my-header: foo
522    ///  Config: add: - name: "my-header" value: "bar,baz"
523    ///  Output: GET /foo HTTP/1.1 my-header: foo,bar,baz
524    #[serde(default, skip_serializing_if = "Option::is_none")]
525    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
526    pub add: Option<Vec<HTTPRouteRulesBackendRefsFiltersResponseHeaderModifierAdd>>,
527    /// Remove the given header(s) from the HTTP request before the action. The value of Remove is a list of HTTP header names. Note that the header names are case-insensitive (see https://datatracker.ietf.org/doc/html/rfc2616#section-4.2).
528    ///  Input: GET /foo HTTP/1.1 my-header1: foo my-header2: bar my-header3: baz
529    ///  Config: remove: ["my-header1", "my-header3"]
530    ///  Output: GET /foo HTTP/1.1 my-header2: bar
531    #[serde(default, skip_serializing_if = "Option::is_none")]
532    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
533    pub remove: Option<Vec<String>>,
534    /// Set overwrites the request with the given header (name, value) before the action.
535    ///  Input: GET /foo HTTP/1.1 my-header: foo
536    ///  Config: set: - name: "my-header" value: "bar"
537    ///  Output: GET /foo HTTP/1.1 my-header: bar
538    #[serde(default, skip_serializing_if = "Option::is_none")]
539    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
540    pub set: Option<Vec<HTTPRouteRulesBackendRefsFiltersResponseHeaderModifierSet>>,
541}
542
543/// HTTPHeader represents an HTTP Header name and value as defined by RFC 7230.
544#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
545#[cfg_attr(feature = "builder", derive(TypedBuilder))]
546#[cfg_attr(feature = "schemars", derive(JsonSchema))]
547pub struct HTTPRouteRulesBackendRefsFiltersResponseHeaderModifierAdd {
548    /// Name is the name of the HTTP Header to be matched. Name matching MUST be case insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2).
549    ///  If multiple entries specify equivalent header names, the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent header name MUST be ignored. Due to the case-insensitivity of header names, "foo" and "Foo" are considered equivalent.
550    pub name: String,
551    /// Value is the value of HTTP Header to be matched.
552    pub value: String,
553}
554
555/// HTTPHeader represents an HTTP Header name and value as defined by RFC 7230.
556#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
557#[cfg_attr(feature = "builder", derive(TypedBuilder))]
558#[cfg_attr(feature = "schemars", derive(JsonSchema))]
559pub struct HTTPRouteRulesBackendRefsFiltersResponseHeaderModifierSet {
560    /// Name is the name of the HTTP Header to be matched. Name matching MUST be case insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2).
561    ///  If multiple entries specify equivalent header names, the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent header name MUST be ignored. Due to the case-insensitivity of header names, "foo" and "Foo" are considered equivalent.
562    pub name: String,
563    /// Value is the value of HTTP Header to be matched.
564    pub value: String,
565}
566
567/// HTTPRouteFilter defines processing steps that must be completed during the request or response lifecycle. HTTPRouteFilters are meant as an extension point to express processing that may be done in Gateway implementations. Some examples include request or response modification, implementing authentication strategies, rate-limiting, and traffic shaping. API guarantee/conformance is defined based on the type of the filter.
568#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
569#[cfg_attr(feature = "schemars", derive(JsonSchema))]
570pub enum HTTPRouteRulesBackendRefsFiltersType {
571    RequestHeaderModifier,
572    ResponseHeaderModifier,
573    RequestMirror,
574    RequestRedirect,
575    #[serde(rename = "URLRewrite")]
576    UrlRewrite,
577    ExtensionRef,
578}
579
580/// URLRewrite defines a schema for a filter that modifies a request during forwarding.
581///  Support: Extended
582#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
583#[cfg_attr(feature = "builder", derive(TypedBuilder))]
584#[cfg_attr(feature = "schemars", derive(JsonSchema))]
585pub struct HTTPRouteRulesBackendRefsFiltersUrlRewrite {
586    /// Hostname is the value to be used to replace the Host header value during forwarding.
587    ///  Support: Extended
588    #[serde(default, skip_serializing_if = "Option::is_none")]
589    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
590    pub hostname: Option<String>,
591    /// Path defines a path rewrite.
592    ///  Support: Extended
593    #[serde(default, skip_serializing_if = "Option::is_none")]
594    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
595    pub path: Option<HTTPRouteRulesBackendRefsFiltersUrlRewritePath>,
596}
597
598/// Path defines a path rewrite.
599///  Support: Extended
600#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
601#[cfg_attr(feature = "builder", derive(TypedBuilder))]
602#[cfg_attr(feature = "schemars", derive(JsonSchema))]
603pub struct HTTPRouteRulesBackendRefsFiltersUrlRewritePath {
604    /// ReplaceFullPath specifies the value with which to replace the full path of a request during a rewrite or redirect.
605    #[serde(
606        default,
607        skip_serializing_if = "Option::is_none",
608        rename = "replaceFullPath"
609    )]
610    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
611    pub replace_full_path: Option<String>,
612    /// ReplacePrefixMatch specifies the value with which to replace the prefix match of a request during a rewrite or redirect. For example, a request to "/foo/bar" with a prefix match of "/foo" and a ReplacePrefixMatch of "/xyz" would be modified to "/xyz/bar".
613    ///  Note that this matches the behavior of the PathPrefix match type. This matches full path elements. A path element refers to the list of labels in the path split by the `/` separator. When specified, a trailing `/` is ignored. For example, the paths `/abc`, `/abc/`, and `/abc/def` would all match the prefix `/abc`, but the path `/abcd` would not.
614    ///  ReplacePrefixMatch is only compatible with a `PathPrefix` HTTPRouteMatch. Using any other HTTPRouteMatch type on the same HTTPRouteRule will result in the implementation setting the Accepted Condition for the Route to `status: False`.
615    ///  Request Path | Prefix Match | Replace Prefix | Modified Path -------------|--------------|----------------|---------- /foo/bar     | /foo         | /xyz           | /xyz/bar /foo/bar     | /foo         | /xyz/          | /xyz/bar /foo/bar     | /foo/        | /xyz           | /xyz/bar /foo/bar     | /foo/        | /xyz/          | /xyz/bar /foo         | /foo         | /xyz           | /xyz /foo/        | /foo         | /xyz           | /xyz/ /foo/bar     | /foo         | <empty string> | /bar /foo/        | /foo         | <empty string> | / /foo         | /foo         | <empty string> | / /foo/        | /foo         | /              | / /foo         | /foo         | /              | /
616    #[serde(
617        default,
618        skip_serializing_if = "Option::is_none",
619        rename = "replacePrefixMatch"
620    )]
621    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
622    pub replace_prefix_match: Option<String>,
623    /// Type defines the type of path modifier. Additional types may be added in a future release of the API.
624    ///  Note that values may be added to this enum, implementations must ensure that unknown values will not cause a crash.
625    ///  Unknown values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason of `UnsupportedValue`.
626    #[serde(rename = "type")]
627    pub r#type: HTTPRouteRulesBackendRefsFiltersUrlRewritePathType,
628}
629
630/// Path defines a path rewrite.
631///  Support: Extended
632#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
633#[cfg_attr(feature = "schemars", derive(JsonSchema))]
634pub enum HTTPRouteRulesBackendRefsFiltersUrlRewritePathType {
635    ReplaceFullPath,
636    ReplacePrefixMatch,
637}
638
639/// HTTPRouteFilter defines processing steps that must be completed during the request or response lifecycle. HTTPRouteFilters are meant as an extension point to express processing that may be done in Gateway implementations. Some examples include request or response modification, implementing authentication strategies, rate-limiting, and traffic shaping. API guarantee/conformance is defined based on the type of the filter.
640#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
641#[cfg_attr(feature = "builder", derive(TypedBuilder))]
642#[cfg_attr(feature = "schemars", derive(JsonSchema))]
643pub struct HTTPRouteRulesFilters {
644    /// ExtensionRef is an optional, implementation-specific extension to the "filter" behavior.  For example, resource "myroutefilter" in group "networking.example.net"). ExtensionRef MUST NOT be used for core and extended filters.
645    ///  This filter can be used multiple times within the same rule.
646    ///  Support: Implementation-specific
647    #[serde(
648        default,
649        skip_serializing_if = "Option::is_none",
650        rename = "extensionRef"
651    )]
652    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
653    pub extension_ref: Option<HTTPRouteRulesFiltersExtensionRef>,
654    /// RequestHeaderModifier defines a schema for a filter that modifies request headers.
655    ///  Support: Core
656    #[serde(
657        default,
658        skip_serializing_if = "Option::is_none",
659        rename = "requestHeaderModifier"
660    )]
661    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
662    pub request_header_modifier: Option<HTTPRouteRulesFiltersRequestHeaderModifier>,
663    /// RequestMirror defines a schema for a filter that mirrors requests. Requests are sent to the specified destination, but responses from that destination are ignored.
664    ///  This filter can be used multiple times within the same rule. Note that not all implementations will be able to support mirroring to multiple backends.
665    ///  Support: Extended
666    #[serde(
667        default,
668        skip_serializing_if = "Option::is_none",
669        rename = "requestMirror"
670    )]
671    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
672    pub request_mirror: Option<HTTPRouteRulesFiltersRequestMirror>,
673    /// RequestRedirect defines a schema for a filter that responds to the request with an HTTP redirection.
674    ///  Support: Core
675    #[serde(
676        default,
677        skip_serializing_if = "Option::is_none",
678        rename = "requestRedirect"
679    )]
680    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
681    pub request_redirect: Option<HTTPRouteRulesFiltersRequestRedirect>,
682    /// ResponseHeaderModifier defines a schema for a filter that modifies response headers.
683    ///  Support: Extended
684    #[serde(
685        default,
686        skip_serializing_if = "Option::is_none",
687        rename = "responseHeaderModifier"
688    )]
689    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
690    pub response_header_modifier: Option<HTTPRouteRulesFiltersResponseHeaderModifier>,
691    /// Type identifies the type of filter to apply. As with other API fields, types are classified into three conformance levels:
692    ///  - Core: Filter types and their corresponding configuration defined by "Support: Core" in this package, e.g. "RequestHeaderModifier". All implementations must support core filters.
693    ///  - Extended: Filter types and their corresponding configuration defined by "Support: Extended" in this package, e.g. "RequestMirror". Implementers are encouraged to support extended filters.
694    ///  - Implementation-specific: Filters that are defined and supported by specific vendors. In the future, filters showing convergence in behavior across multiple implementations will be considered for inclusion in extended or core conformance levels. Filter-specific configuration for such filters is specified using the ExtensionRef field. `Type` should be set to "ExtensionRef" for custom filters.
695    ///  Implementers are encouraged to define custom implementation types to extend the core API with implementation-specific behavior.
696    ///  If a reference to a custom filter type cannot be resolved, the filter MUST NOT be skipped. Instead, requests that would have been processed by that filter MUST receive a HTTP error response.
697    ///  Note that values may be added to this enum, implementations must ensure that unknown values will not cause a crash.
698    ///  Unknown values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason of `UnsupportedValue`.
699    #[serde(rename = "type")]
700    pub r#type: HTTPRouteRulesFiltersType,
701    /// URLRewrite defines a schema for a filter that modifies a request during forwarding.
702    ///  Support: Extended
703    #[serde(
704        default,
705        skip_serializing_if = "Option::is_none",
706        rename = "urlRewrite"
707    )]
708    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
709    pub url_rewrite: Option<HTTPRouteRulesFiltersUrlRewrite>,
710}
711
712/// ExtensionRef is an optional, implementation-specific extension to the "filter" behavior.  For example, resource "myroutefilter" in group "networking.example.net"). ExtensionRef MUST NOT be used for core and extended filters.
713///  This filter can be used multiple times within the same rule.
714///  Support: Implementation-specific
715#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
716#[cfg_attr(feature = "builder", derive(TypedBuilder))]
717#[cfg_attr(feature = "schemars", derive(JsonSchema))]
718pub struct HTTPRouteRulesFiltersExtensionRef {
719    /// Group is the group of the referent. For example, "gateway.networking.k8s.io". When unspecified or empty string, core API group is inferred.
720    pub group: String,
721    /// Kind is kind of the referent. For example "HTTPRoute" or "Service".
722    pub kind: String,
723    /// Name is the name of the referent.
724    pub name: String,
725}
726
727/// RequestHeaderModifier defines a schema for a filter that modifies request headers.
728///  Support: Core
729#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
730#[cfg_attr(feature = "builder", derive(TypedBuilder))]
731#[cfg_attr(feature = "schemars", derive(JsonSchema))]
732pub struct HTTPRouteRulesFiltersRequestHeaderModifier {
733    /// Add adds the given header(s) (name, value) to the request before the action. It appends to any existing values associated with the header name.
734    ///  Input: GET /foo HTTP/1.1 my-header: foo
735    ///  Config: add: - name: "my-header" value: "bar,baz"
736    ///  Output: GET /foo HTTP/1.1 my-header: foo,bar,baz
737    #[serde(default, skip_serializing_if = "Option::is_none")]
738    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
739    pub add: Option<Vec<HTTPRouteRulesFiltersRequestHeaderModifierAdd>>,
740    /// Remove the given header(s) from the HTTP request before the action. The value of Remove is a list of HTTP header names. Note that the header names are case-insensitive (see https://datatracker.ietf.org/doc/html/rfc2616#section-4.2).
741    ///  Input: GET /foo HTTP/1.1 my-header1: foo my-header2: bar my-header3: baz
742    ///  Config: remove: ["my-header1", "my-header3"]
743    ///  Output: GET /foo HTTP/1.1 my-header2: bar
744    #[serde(default, skip_serializing_if = "Option::is_none")]
745    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
746    pub remove: Option<Vec<String>>,
747    /// Set overwrites the request with the given header (name, value) before the action.
748    ///  Input: GET /foo HTTP/1.1 my-header: foo
749    ///  Config: set: - name: "my-header" value: "bar"
750    ///  Output: GET /foo HTTP/1.1 my-header: bar
751    #[serde(default, skip_serializing_if = "Option::is_none")]
752    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
753    pub set: Option<Vec<HTTPRouteRulesFiltersRequestHeaderModifierSet>>,
754}
755
756/// HTTPHeader represents an HTTP Header name and value as defined by RFC 7230.
757#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
758#[cfg_attr(feature = "builder", derive(TypedBuilder))]
759#[cfg_attr(feature = "schemars", derive(JsonSchema))]
760pub struct HTTPRouteRulesFiltersRequestHeaderModifierAdd {
761    /// Name is the name of the HTTP Header to be matched. Name matching MUST be case insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2).
762    ///  If multiple entries specify equivalent header names, the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent header name MUST be ignored. Due to the case-insensitivity of header names, "foo" and "Foo" are considered equivalent.
763    pub name: String,
764    /// Value is the value of HTTP Header to be matched.
765    pub value: String,
766}
767
768/// HTTPHeader represents an HTTP Header name and value as defined by RFC 7230.
769#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
770#[cfg_attr(feature = "builder", derive(TypedBuilder))]
771#[cfg_attr(feature = "schemars", derive(JsonSchema))]
772pub struct HTTPRouteRulesFiltersRequestHeaderModifierSet {
773    /// Name is the name of the HTTP Header to be matched. Name matching MUST be case insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2).
774    ///  If multiple entries specify equivalent header names, the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent header name MUST be ignored. Due to the case-insensitivity of header names, "foo" and "Foo" are considered equivalent.
775    pub name: String,
776    /// Value is the value of HTTP Header to be matched.
777    pub value: String,
778}
779
780/// RequestMirror defines a schema for a filter that mirrors requests. Requests are sent to the specified destination, but responses from that destination are ignored.
781///  This filter can be used multiple times within the same rule. Note that not all implementations will be able to support mirroring to multiple backends.
782///  Support: Extended
783#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
784#[cfg_attr(feature = "builder", derive(TypedBuilder))]
785#[cfg_attr(feature = "schemars", derive(JsonSchema))]
786pub struct HTTPRouteRulesFiltersRequestMirror {
787    /// BackendRef references a resource where mirrored requests are sent.
788    ///  Mirrored requests must be sent only to a single destination endpoint within this BackendRef, irrespective of how many endpoints are present within this BackendRef.
789    ///  If the referent cannot be found, this BackendRef is invalid and must be dropped from the Gateway. The controller must ensure the "ResolvedRefs" condition on the Route status is set to `status: False` and not configure this backend in the underlying implementation.
790    ///  If there is a cross-namespace reference to an *existing* object that is not allowed by a ReferenceGrant, the controller must ensure the "ResolvedRefs"  condition on the Route is set to `status: False`, with the "RefNotPermitted" reason and not configure this backend in the underlying implementation.
791    ///  In either error case, the Message of the `ResolvedRefs` Condition should be used to provide more detail about the problem.
792    ///  Support: Extended for Kubernetes Service
793    ///  Support: Implementation-specific for any other resource
794    #[serde(rename = "backendRef")]
795    pub backend_ref: HTTPRouteRulesFiltersRequestMirrorBackendRef,
796}
797
798/// BackendRef references a resource where mirrored requests are sent.
799///  Mirrored requests must be sent only to a single destination endpoint within this BackendRef, irrespective of how many endpoints are present within this BackendRef.
800///  If the referent cannot be found, this BackendRef is invalid and must be dropped from the Gateway. The controller must ensure the "ResolvedRefs" condition on the Route status is set to `status: False` and not configure this backend in the underlying implementation.
801///  If there is a cross-namespace reference to an *existing* object that is not allowed by a ReferenceGrant, the controller must ensure the "ResolvedRefs"  condition on the Route is set to `status: False`, with the "RefNotPermitted" reason and not configure this backend in the underlying implementation.
802///  In either error case, the Message of the `ResolvedRefs` Condition should be used to provide more detail about the problem.
803///  Support: Extended for Kubernetes Service
804///  Support: Implementation-specific for any other resource
805#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
806#[cfg_attr(feature = "builder", derive(TypedBuilder))]
807#[cfg_attr(feature = "schemars", derive(JsonSchema))]
808pub struct HTTPRouteRulesFiltersRequestMirrorBackendRef {
809    /// Group is the group of the referent. For example, "gateway.networking.k8s.io". When unspecified or empty string, core API group is inferred.
810    #[serde(default, skip_serializing_if = "Option::is_none")]
811    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
812    pub group: Option<String>,
813    /// Kind is the Kubernetes resource kind of the referent. For example "Service".
814    ///  Defaults to "Service" when not specified.
815    ///  ExternalName services can refer to CNAME DNS records that may live outside of the cluster and as such are difficult to reason about in terms of conformance. They also may not be safe to forward to (see CVE-2021-25740 for more information). Implementations SHOULD NOT support ExternalName Services.
816    ///  Support: Core (Services with a type other than ExternalName)
817    ///  Support: Implementation-specific (Services with type ExternalName)
818    #[serde(default, skip_serializing_if = "Option::is_none")]
819    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
820    pub kind: Option<String>,
821    /// Name is the name of the referent.
822    pub name: String,
823    /// Namespace is the namespace of the backend. When unspecified, the local namespace is inferred.
824    ///  Note that when a namespace different than the local namespace is specified, a ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details.
825    ///  Support: Core
826    #[serde(default, skip_serializing_if = "Option::is_none")]
827    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
828    pub namespace: Option<String>,
829    /// Port specifies the destination port number to use for this resource. Port is required when the referent is a Kubernetes Service. In this case, the port number is the service port number, not the target port. For other resources, destination port might be derived from the referent resource or this field.
830    #[serde(default, skip_serializing_if = "Option::is_none")]
831    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
832    pub port: Option<i32>,
833}
834
835/// RequestRedirect defines a schema for a filter that responds to the request with an HTTP redirection.
836///  Support: Core
837#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
838#[cfg_attr(feature = "builder", derive(TypedBuilder))]
839#[cfg_attr(feature = "schemars", derive(JsonSchema))]
840pub struct HTTPRouteRulesFiltersRequestRedirect {
841    /// Hostname is the hostname to be used in the value of the `Location` header in the response. When empty, the hostname in the `Host` header of the request is used.
842    ///  Support: Core
843    #[serde(default, skip_serializing_if = "Option::is_none")]
844    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
845    pub hostname: Option<String>,
846    /// Path defines parameters used to modify the path of the incoming request. The modified path is then used to construct the `Location` header. When empty, the request path is used as-is.
847    ///  Support: Extended
848    #[serde(default, skip_serializing_if = "Option::is_none")]
849    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
850    pub path: Option<HTTPRouteRulesFiltersRequestRedirectPath>,
851    /// Port is the port to be used in the value of the `Location` header in the response.
852    ///  If no port is specified, the redirect port MUST be derived using the following rules:
853    ///  * If redirect scheme is not-empty, the redirect port MUST be the well-known port associated with the redirect scheme. Specifically "http" to port 80 and "https" to port 443. If the redirect scheme does not have a well-known port, the listener port of the Gateway SHOULD be used. * If redirect scheme is empty, the redirect port MUST be the Gateway Listener port.
854    ///  Implementations SHOULD NOT add the port number in the 'Location' header in the following cases:
855    ///  * A Location header that will use HTTP (whether that is determined via the Listener protocol or the Scheme field) _and_ use port 80. * A Location header that will use HTTPS (whether that is determined via the Listener protocol or the Scheme field) _and_ use port 443.
856    ///  Support: Extended
857    #[serde(default, skip_serializing_if = "Option::is_none")]
858    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
859    pub port: Option<i32>,
860    /// Scheme is the scheme to be used in the value of the `Location` header in the response. When empty, the scheme of the request is used.
861    ///  Scheme redirects can affect the port of the redirect, for more information, refer to the documentation for the port field of this filter.
862    ///  Note that values may be added to this enum, implementations must ensure that unknown values will not cause a crash.
863    ///  Unknown values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason of `UnsupportedValue`.
864    ///  Support: Extended
865    #[serde(default, skip_serializing_if = "Option::is_none")]
866    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
867    pub scheme: Option<HTTPRouteRulesFiltersRequestRedirectScheme>,
868    /// StatusCode is the HTTP status code to be used in response.
869    ///  Note that values may be added to this enum, implementations must ensure that unknown values will not cause a crash.
870    ///  Unknown values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason of `UnsupportedValue`.
871    ///  Support: Core
872    #[serde(
873        default,
874        skip_serializing_if = "Option::is_none",
875        rename = "statusCode"
876    )]
877    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
878    pub status_code: Option<i64>,
879}
880
881/// Path defines parameters used to modify the path of the incoming request. The modified path is then used to construct the `Location` header. When empty, the request path is used as-is.
882///  Support: Extended
883#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
884#[cfg_attr(feature = "builder", derive(TypedBuilder))]
885#[cfg_attr(feature = "schemars", derive(JsonSchema))]
886pub struct HTTPRouteRulesFiltersRequestRedirectPath {
887    /// ReplaceFullPath specifies the value with which to replace the full path of a request during a rewrite or redirect.
888    #[serde(
889        default,
890        skip_serializing_if = "Option::is_none",
891        rename = "replaceFullPath"
892    )]
893    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
894    pub replace_full_path: Option<String>,
895    /// ReplacePrefixMatch specifies the value with which to replace the prefix match of a request during a rewrite or redirect. For example, a request to "/foo/bar" with a prefix match of "/foo" and a ReplacePrefixMatch of "/xyz" would be modified to "/xyz/bar".
896    ///  Note that this matches the behavior of the PathPrefix match type. This matches full path elements. A path element refers to the list of labels in the path split by the `/` separator. When specified, a trailing `/` is ignored. For example, the paths `/abc`, `/abc/`, and `/abc/def` would all match the prefix `/abc`, but the path `/abcd` would not.
897    ///  ReplacePrefixMatch is only compatible with a `PathPrefix` HTTPRouteMatch. Using any other HTTPRouteMatch type on the same HTTPRouteRule will result in the implementation setting the Accepted Condition for the Route to `status: False`.
898    ///  Request Path | Prefix Match | Replace Prefix | Modified Path -------------|--------------|----------------|---------- /foo/bar     | /foo         | /xyz           | /xyz/bar /foo/bar     | /foo         | /xyz/          | /xyz/bar /foo/bar     | /foo/        | /xyz           | /xyz/bar /foo/bar     | /foo/        | /xyz/          | /xyz/bar /foo         | /foo         | /xyz           | /xyz /foo/        | /foo         | /xyz           | /xyz/ /foo/bar     | /foo         | <empty string> | /bar /foo/        | /foo         | <empty string> | / /foo         | /foo         | <empty string> | / /foo/        | /foo         | /              | / /foo         | /foo         | /              | /
899    #[serde(
900        default,
901        skip_serializing_if = "Option::is_none",
902        rename = "replacePrefixMatch"
903    )]
904    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
905    pub replace_prefix_match: Option<String>,
906    /// Type defines the type of path modifier. Additional types may be added in a future release of the API.
907    ///  Note that values may be added to this enum, implementations must ensure that unknown values will not cause a crash.
908    ///  Unknown values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason of `UnsupportedValue`.
909    #[serde(rename = "type")]
910    pub r#type: HTTPRouteRulesFiltersRequestRedirectPathType,
911}
912
913/// Path defines parameters used to modify the path of the incoming request. The modified path is then used to construct the `Location` header. When empty, the request path is used as-is.
914///  Support: Extended
915#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
916#[cfg_attr(feature = "schemars", derive(JsonSchema))]
917pub enum HTTPRouteRulesFiltersRequestRedirectPathType {
918    ReplaceFullPath,
919    ReplacePrefixMatch,
920}
921
922/// RequestRedirect defines a schema for a filter that responds to the request with an HTTP redirection.
923///  Support: Core
924#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
925#[cfg_attr(feature = "schemars", derive(JsonSchema))]
926pub enum HTTPRouteRulesFiltersRequestRedirectScheme {
927    #[serde(rename = "http")]
928    Http,
929    #[serde(rename = "https")]
930    Https,
931}
932
933/// RequestRedirect defines a schema for a filter that responds to the request with an HTTP redirection.
934///  Support: Core
935#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
936#[cfg_attr(feature = "schemars", derive(JsonSchema))]
937pub enum HTTPRouteRulesFiltersRequestRedirectStatusCode {
938    #[serde(rename = "301")]
939    r#_301,
940    #[serde(rename = "302")]
941    r#_302,
942}
943
944/// ResponseHeaderModifier defines a schema for a filter that modifies response headers.
945///  Support: Extended
946#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
947#[cfg_attr(feature = "builder", derive(TypedBuilder))]
948#[cfg_attr(feature = "schemars", derive(JsonSchema))]
949pub struct HTTPRouteRulesFiltersResponseHeaderModifier {
950    /// Add adds the given header(s) (name, value) to the request before the action. It appends to any existing values associated with the header name.
951    ///  Input: GET /foo HTTP/1.1 my-header: foo
952    ///  Config: add: - name: "my-header" value: "bar,baz"
953    ///  Output: GET /foo HTTP/1.1 my-header: foo,bar,baz
954    #[serde(default, skip_serializing_if = "Option::is_none")]
955    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
956    pub add: Option<Vec<HTTPRouteRulesFiltersResponseHeaderModifierAdd>>,
957    /// Remove the given header(s) from the HTTP request before the action. The value of Remove is a list of HTTP header names. Note that the header names are case-insensitive (see https://datatracker.ietf.org/doc/html/rfc2616#section-4.2).
958    ///  Input: GET /foo HTTP/1.1 my-header1: foo my-header2: bar my-header3: baz
959    ///  Config: remove: ["my-header1", "my-header3"]
960    ///  Output: GET /foo HTTP/1.1 my-header2: bar
961    #[serde(default, skip_serializing_if = "Option::is_none")]
962    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
963    pub remove: Option<Vec<String>>,
964    /// Set overwrites the request with the given header (name, value) before the action.
965    ///  Input: GET /foo HTTP/1.1 my-header: foo
966    ///  Config: set: - name: "my-header" value: "bar"
967    ///  Output: GET /foo HTTP/1.1 my-header: bar
968    #[serde(default, skip_serializing_if = "Option::is_none")]
969    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
970    pub set: Option<Vec<HTTPRouteRulesFiltersResponseHeaderModifierSet>>,
971}
972
973/// HTTPHeader represents an HTTP Header name and value as defined by RFC 7230.
974#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
975#[cfg_attr(feature = "builder", derive(TypedBuilder))]
976#[cfg_attr(feature = "schemars", derive(JsonSchema))]
977pub struct HTTPRouteRulesFiltersResponseHeaderModifierAdd {
978    /// Name is the name of the HTTP Header to be matched. Name matching MUST be case insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2).
979    ///  If multiple entries specify equivalent header names, the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent header name MUST be ignored. Due to the case-insensitivity of header names, "foo" and "Foo" are considered equivalent.
980    pub name: String,
981    /// Value is the value of HTTP Header to be matched.
982    pub value: String,
983}
984
985/// HTTPHeader represents an HTTP Header name and value as defined by RFC 7230.
986#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
987#[cfg_attr(feature = "builder", derive(TypedBuilder))]
988#[cfg_attr(feature = "schemars", derive(JsonSchema))]
989pub struct HTTPRouteRulesFiltersResponseHeaderModifierSet {
990    /// Name is the name of the HTTP Header to be matched. Name matching MUST be case insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2).
991    ///  If multiple entries specify equivalent header names, the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent header name MUST be ignored. Due to the case-insensitivity of header names, "foo" and "Foo" are considered equivalent.
992    pub name: String,
993    /// Value is the value of HTTP Header to be matched.
994    pub value: String,
995}
996
997/// HTTPRouteFilter defines processing steps that must be completed during the request or response lifecycle. HTTPRouteFilters are meant as an extension point to express processing that may be done in Gateway implementations. Some examples include request or response modification, implementing authentication strategies, rate-limiting, and traffic shaping. API guarantee/conformance is defined based on the type of the filter.
998#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
999#[cfg_attr(feature = "schemars", derive(JsonSchema))]
1000pub enum HTTPRouteRulesFiltersType {
1001    RequestHeaderModifier,
1002    ResponseHeaderModifier,
1003    RequestMirror,
1004    RequestRedirect,
1005    #[serde(rename = "URLRewrite")]
1006    UrlRewrite,
1007    ExtensionRef,
1008}
1009
1010/// URLRewrite defines a schema for a filter that modifies a request during forwarding.
1011///  Support: Extended
1012#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
1013#[cfg_attr(feature = "builder", derive(TypedBuilder))]
1014#[cfg_attr(feature = "schemars", derive(JsonSchema))]
1015pub struct HTTPRouteRulesFiltersUrlRewrite {
1016    /// Hostname is the value to be used to replace the Host header value during forwarding.
1017    ///  Support: Extended
1018    #[serde(default, skip_serializing_if = "Option::is_none")]
1019    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
1020    pub hostname: Option<String>,
1021    /// Path defines a path rewrite.
1022    ///  Support: Extended
1023    #[serde(default, skip_serializing_if = "Option::is_none")]
1024    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
1025    pub path: Option<HTTPRouteRulesFiltersUrlRewritePath>,
1026}
1027
1028/// Path defines a path rewrite.
1029///  Support: Extended
1030#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
1031#[cfg_attr(feature = "builder", derive(TypedBuilder))]
1032#[cfg_attr(feature = "schemars", derive(JsonSchema))]
1033pub struct HTTPRouteRulesFiltersUrlRewritePath {
1034    /// ReplaceFullPath specifies the value with which to replace the full path of a request during a rewrite or redirect.
1035    #[serde(
1036        default,
1037        skip_serializing_if = "Option::is_none",
1038        rename = "replaceFullPath"
1039    )]
1040    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
1041    pub replace_full_path: Option<String>,
1042    /// ReplacePrefixMatch specifies the value with which to replace the prefix match of a request during a rewrite or redirect. For example, a request to "/foo/bar" with a prefix match of "/foo" and a ReplacePrefixMatch of "/xyz" would be modified to "/xyz/bar".
1043    ///  Note that this matches the behavior of the PathPrefix match type. This matches full path elements. A path element refers to the list of labels in the path split by the `/` separator. When specified, a trailing `/` is ignored. For example, the paths `/abc`, `/abc/`, and `/abc/def` would all match the prefix `/abc`, but the path `/abcd` would not.
1044    ///  ReplacePrefixMatch is only compatible with a `PathPrefix` HTTPRouteMatch. Using any other HTTPRouteMatch type on the same HTTPRouteRule will result in the implementation setting the Accepted Condition for the Route to `status: False`.
1045    ///  Request Path | Prefix Match | Replace Prefix | Modified Path -------------|--------------|----------------|---------- /foo/bar     | /foo         | /xyz           | /xyz/bar /foo/bar     | /foo         | /xyz/          | /xyz/bar /foo/bar     | /foo/        | /xyz           | /xyz/bar /foo/bar     | /foo/        | /xyz/          | /xyz/bar /foo         | /foo         | /xyz           | /xyz /foo/        | /foo         | /xyz           | /xyz/ /foo/bar     | /foo         | <empty string> | /bar /foo/        | /foo         | <empty string> | / /foo         | /foo         | <empty string> | / /foo/        | /foo         | /              | / /foo         | /foo         | /              | /
1046    #[serde(
1047        default,
1048        skip_serializing_if = "Option::is_none",
1049        rename = "replacePrefixMatch"
1050    )]
1051    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
1052    pub replace_prefix_match: Option<String>,
1053    /// Type defines the type of path modifier. Additional types may be added in a future release of the API.
1054    ///  Note that values may be added to this enum, implementations must ensure that unknown values will not cause a crash.
1055    ///  Unknown values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason of `UnsupportedValue`.
1056    #[serde(rename = "type")]
1057    pub r#type: HTTPRouteRulesFiltersUrlRewritePathType,
1058}
1059
1060/// Path defines a path rewrite.
1061///  Support: Extended
1062#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
1063#[cfg_attr(feature = "schemars", derive(JsonSchema))]
1064pub enum HTTPRouteRulesFiltersUrlRewritePathType {
1065    ReplaceFullPath,
1066    ReplacePrefixMatch,
1067}
1068
1069/// HTTPRouteMatch defines the predicate used to match requests to a given action. Multiple match types are ANDed together, i.e. the match will evaluate to true only if all conditions are satisfied.
1070///  For example, the match below will match a HTTP request only if its path starts with `/foo` AND it contains the `version: v1` header:
1071///  ``` match:
1072///  path: value: "/foo" headers: - name: "version" value "v1"
1073///  ```
1074#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Default)]
1075#[cfg_attr(feature = "builder", derive(TypedBuilder))]
1076#[cfg_attr(feature = "schemars", derive(JsonSchema))]
1077pub struct HTTPRouteRulesMatches {
1078    /// Headers specifies HTTP request header matchers. Multiple match values are ANDed together, meaning, a request must match all the specified headers to select the route.
1079    #[serde(default, skip_serializing_if = "Option::is_none")]
1080    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
1081    pub headers: Option<Vec<HTTPRouteRulesMatchesHeaders>>,
1082    /// Method specifies HTTP method matcher. When specified, this route will be matched only if the request has the specified method.
1083    ///  Support: Extended
1084    #[serde(default, skip_serializing_if = "Option::is_none")]
1085    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
1086    pub method: Option<HTTPRouteRulesMatchesMethod>,
1087    /// Path specifies a HTTP request path matcher. If this field is not specified, a default prefix match on the "/" path is provided.
1088    #[serde(default, skip_serializing_if = "Option::is_none")]
1089    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
1090    pub path: Option<HTTPRouteRulesMatchesPath>,
1091    /// QueryParams specifies HTTP query parameter matchers. Multiple match values are ANDed together, meaning, a request must match all the specified query parameters to select the route.
1092    ///  Support: Extended
1093    #[serde(
1094        default,
1095        skip_serializing_if = "Option::is_none",
1096        rename = "queryParams"
1097    )]
1098    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
1099    pub query_params: Option<Vec<HTTPRouteRulesMatchesQueryParams>>,
1100}
1101
1102/// HTTPHeaderMatch describes how to select a HTTP route by matching HTTP request headers.
1103#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Default)]
1104#[cfg_attr(feature = "builder", derive(TypedBuilder))]
1105#[cfg_attr(feature = "schemars", derive(JsonSchema))]
1106pub struct HTTPRouteRulesMatchesHeaders {
1107    /// Name is the name of the HTTP Header to be matched. Name matching MUST be case insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2).
1108    ///  If multiple entries specify equivalent header names, only the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent header name MUST be ignored. Due to the case-insensitivity of header names, "foo" and "Foo" are considered equivalent.
1109    ///  When a header is repeated in an HTTP request, it is implementation-specific behavior as to how this is represented. Generally, proxies should follow the guidance from the RFC: https://www.rfc-editor.org/rfc/rfc7230.html#section-3.2.2 regarding processing a repeated header, with special handling for "Set-Cookie".
1110    pub name: String,
1111    /// Type specifies how to match against the value of the header.
1112    ///  Support: Core (Exact)
1113    ///  Support: Implementation-specific (RegularExpression)
1114    ///  Since RegularExpression HeaderMatchType has implementation-specific conformance, implementations can support POSIX, PCRE or any other dialects of regular expressions. Please read the implementation's documentation to determine the supported dialect.
1115    #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
1116    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
1117    pub r#type: Option<HTTPRouteRulesMatchesHeadersType>,
1118    /// Value is the value of HTTP Header to be matched.
1119    pub value: String,
1120}
1121
1122/// HTTPHeaderMatch describes how to select a HTTP route by matching HTTP request headers.
1123#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
1124#[cfg_attr(feature = "schemars", derive(JsonSchema))]
1125pub enum HTTPRouteRulesMatchesHeadersType {
1126    Exact,
1127    RegularExpression,
1128}
1129
1130/// HTTPRouteMatch defines the predicate used to match requests to a given action. Multiple match types are ANDed together, i.e. the match will evaluate to true only if all conditions are satisfied.
1131///  For example, the match below will match a HTTP request only if its path starts with `/foo` AND it contains the `version: v1` header:
1132///  ``` match:
1133///  path: value: "/foo" headers: - name: "version" value "v1"
1134///  ```
1135#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
1136#[cfg_attr(feature = "schemars", derive(JsonSchema))]
1137pub enum HTTPRouteRulesMatchesMethod {
1138    #[serde(rename = "GET")]
1139    Get,
1140    #[serde(rename = "HEAD")]
1141    Head,
1142    #[serde(rename = "POST")]
1143    Post,
1144    #[serde(rename = "PUT")]
1145    Put,
1146    #[serde(rename = "DELETE")]
1147    Delete,
1148    #[serde(rename = "CONNECT")]
1149    Connect,
1150    #[serde(rename = "OPTIONS")]
1151    Options,
1152    #[serde(rename = "TRACE")]
1153    Trace,
1154    #[serde(rename = "PATCH")]
1155    Patch,
1156}
1157
1158/// Path specifies a HTTP request path matcher. If this field is not specified, a default prefix match on the "/" path is provided.
1159#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Default)]
1160#[cfg_attr(feature = "builder", derive(TypedBuilder))]
1161#[cfg_attr(feature = "schemars", derive(JsonSchema))]
1162pub struct HTTPRouteRulesMatchesPath {
1163    /// Type specifies how to match against the path Value.
1164    ///  Support: Core (Exact, PathPrefix)
1165    ///  Support: Implementation-specific (RegularExpression)
1166    #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
1167    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
1168    pub r#type: Option<HTTPRouteRulesMatchesPathType>,
1169    /// Value of the HTTP path to match against.
1170    #[serde(default, skip_serializing_if = "Option::is_none")]
1171    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
1172    pub value: Option<String>,
1173}
1174
1175/// Path specifies a HTTP request path matcher. If this field is not specified, a default prefix match on the "/" path is provided.
1176#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
1177#[cfg_attr(feature = "schemars", derive(JsonSchema))]
1178pub enum HTTPRouteRulesMatchesPathType {
1179    Exact,
1180    PathPrefix,
1181    RegularExpression,
1182}
1183
1184/// HTTPQueryParamMatch describes how to select a HTTP route by matching HTTP query parameters.
1185#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Default)]
1186#[cfg_attr(feature = "builder", derive(TypedBuilder))]
1187#[cfg_attr(feature = "schemars", derive(JsonSchema))]
1188pub struct HTTPRouteRulesMatchesQueryParams {
1189    /// Name is the name of the HTTP query param to be matched. This must be an exact string match. (See https://tools.ietf.org/html/rfc7230#section-2.7.3).
1190    ///  If multiple entries specify equivalent query param names, only the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent query param name MUST be ignored.
1191    ///  If a query param is repeated in an HTTP request, the behavior is purposely left undefined, since different data planes have different capabilities. However, it is *recommended* that implementations should match against the first value of the param if the data plane supports it, as this behavior is expected in other load balancing contexts outside of the Gateway API.
1192    ///  Users SHOULD NOT route traffic based on repeated query params to guard themselves against potential differences in the implementations.
1193    pub name: String,
1194    /// Type specifies how to match against the value of the query parameter.
1195    ///  Support: Extended (Exact)
1196    ///  Support: Implementation-specific (RegularExpression)
1197    ///  Since RegularExpression QueryParamMatchType has Implementation-specific conformance, implementations can support POSIX, PCRE or any other dialects of regular expressions. Please read the implementation's documentation to determine the supported dialect.
1198    #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
1199    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
1200    pub r#type: Option<HTTPRouteRulesMatchesQueryParamsType>,
1201    /// Value is the value of HTTP query param to be matched.
1202    pub value: String,
1203}
1204
1205/// HTTPQueryParamMatch describes how to select a HTTP route by matching HTTP query parameters.
1206#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
1207#[cfg_attr(feature = "schemars", derive(JsonSchema))]
1208pub enum HTTPRouteRulesMatchesQueryParamsType {
1209    Exact,
1210    RegularExpression,
1211}
1212
1213/// Status defines the current state of HTTPRoute.
1214#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Default)]
1215#[cfg_attr(feature = "builder", derive(TypedBuilder))]
1216#[cfg_attr(feature = "schemars", derive(JsonSchema))]
1217pub struct HTTPRouteStatus {
1218    /// Parents is a list of parent resources (usually Gateways) that are associated with the route, and the status of the route with respect to each parent. When this route attaches to a parent, the controller that manages the parent must add an entry to this list when the controller first sees the route and should update the entry as appropriate when the route or gateway is modified.
1219    ///  Note that parent references that cannot be resolved by an implementation of this API will not be added to this list. Implementations of this API can only populate Route status for the Gateways/parent resources they are responsible for.
1220    ///  A maximum of 32 Gateways will be represented in this list. An empty list means the route has not been attached to any Gateway.
1221    #[cfg_attr(feature = "builder", builder(default))]
1222    pub parents: Vec<HTTPRouteStatusParents>,
1223}
1224
1225/// RouteParentStatus describes the status of a route with respect to an associated Parent.
1226#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Default)]
1227#[cfg_attr(feature = "builder", derive(TypedBuilder))]
1228#[cfg_attr(feature = "schemars", derive(JsonSchema))]
1229pub struct HTTPRouteStatusParents {
1230    /// Conditions describes the status of the route with respect to the Gateway. Note that the route's availability is also subject to the Gateway's own status conditions and listener status.
1231    ///  If the Route's ParentRef specifies an existing Gateway that supports Routes of this kind AND that Gateway's controller has sufficient access, then that Gateway's controller MUST set the "Accepted" condition on the Route, to indicate whether the route has been accepted or rejected by the Gateway, and why.
1232    ///  A Route MUST be considered "Accepted" if at least one of the Route's rules is implemented by the Gateway.
1233    ///  There are a number of cases where the "Accepted" condition may not be set due to lack of controller visibility, that includes when:
1234    ///  * The Route refers to a non-existent parent. * The Route is of a type that the controller does not support. * The Route is in a namespace the controller does not have access to.
1235    #[serde(default, skip_serializing_if = "Option::is_none")]
1236    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
1237    pub conditions: Option<Vec<HTTPRouteStatusParentsConditions>>,
1238    /// ControllerName is a domain/path string that indicates the name of the controller that wrote this status. This corresponds with the controllerName field on GatewayClass.
1239    ///  Example: "example.net/gateway-controller".
1240    ///  The format of this field is DOMAIN "/" PATH, where DOMAIN and PATH are valid Kubernetes names (https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names).
1241    ///  Controllers MUST populate this field when writing status. Controllers should ensure that entries to status populated with their ControllerName are cleaned up when they are no longer necessary.
1242    #[serde(rename = "controllerName")]
1243    pub controller_name: String,
1244    /// ParentRef corresponds with a ParentRef in the spec that this RouteParentStatus struct describes the status of.
1245    #[serde(rename = "parentRef")]
1246    pub parent_ref: HTTPRouteStatusParentsParentRef,
1247}
1248
1249/// Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions.  For example,
1250///  type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: "Available", "Progressing", and "Degraded" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
1251///  // other fields }
1252#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
1253#[cfg_attr(feature = "builder", derive(TypedBuilder))]
1254#[cfg_attr(feature = "schemars", derive(JsonSchema))]
1255pub struct HTTPRouteStatusParentsConditions {
1256    /// lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed.  If that is not known, then using the time when the API field changed is acceptable.
1257    #[serde(rename = "lastTransitionTime")]
1258    pub last_transition_time: String,
1259    /// message is a human readable message indicating details about the transition. This may be an empty string.
1260    pub message: String,
1261    /// observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.
1262    #[serde(
1263        default,
1264        skip_serializing_if = "Option::is_none",
1265        rename = "observedGeneration"
1266    )]
1267    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
1268    pub observed_generation: Option<i64>,
1269    /// reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.
1270    pub reason: String,
1271    /// status of the condition, one of True, False, Unknown.
1272    pub status: HTTPRouteStatusParentsConditionsStatus,
1273    /// type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
1274    #[serde(rename = "type")]
1275    pub r#type: String,
1276}
1277
1278/// Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions.  For example,
1279///  type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: "Available", "Progressing", and "Degraded" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
1280///  // other fields }
1281#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
1282#[cfg_attr(feature = "schemars", derive(JsonSchema))]
1283pub enum HTTPRouteStatusParentsConditionsStatus {
1284    True,
1285    False,
1286    Unknown,
1287}
1288
1289/// ParentRef corresponds with a ParentRef in the spec that this RouteParentStatus struct describes the status of.
1290#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Default)]
1291#[cfg_attr(feature = "builder", derive(TypedBuilder))]
1292#[cfg_attr(feature = "schemars", derive(JsonSchema))]
1293pub struct HTTPRouteStatusParentsParentRef {
1294    /// Group is the group of the referent. When unspecified, "gateway.networking.k8s.io" is inferred. To set the core API group (such as for a "Service" kind referent), Group must be explicitly set to "" (empty string).
1295    ///  Support: Core
1296    #[serde(default, skip_serializing_if = "Option::is_none")]
1297    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
1298    pub group: Option<String>,
1299    /// Kind is kind of the referent.
1300    ///  There are two kinds of parent resources with "Core" support:
1301    ///  * Gateway (Gateway conformance profile) * Service (Mesh conformance profile, experimental, ClusterIP Services only)
1302    ///  Support for other resources is Implementation-Specific.
1303    #[serde(default, skip_serializing_if = "Option::is_none")]
1304    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
1305    pub kind: Option<String>,
1306    /// Name is the name of the referent.
1307    ///  Support: Core
1308    pub name: String,
1309    /// Namespace is the namespace of the referent. When unspecified, this refers to the local namespace of the Route.
1310    ///  Note that there are specific rules for ParentRefs which cross namespace boundaries. Cross-namespace references are only valid if they are explicitly allowed by something in the namespace they are referring to. For example: Gateway has the AllowedRoutes field, and ReferenceGrant provides a generic way to enable any other kind of cross-namespace reference.
1311    ///   
1312    ///  Support: Core
1313    #[serde(default, skip_serializing_if = "Option::is_none")]
1314    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
1315    pub namespace: Option<String>,
1316    /// SectionName is the name of a section within the target resource. In the following resources, SectionName is interpreted as the following:
1317    ///  * Gateway: Listener Name. When both Port (experimental) and SectionName are specified, the name and port of the selected listener must match both specified values. * Service: Port Name. When both Port (experimental) and SectionName are specified, the name and port of the selected listener must match both specified values. Note that attaching Routes to Services as Parents is part of experimental Mesh support and is not supported for any other purpose.
1318    ///  Implementations MAY choose to support attaching Routes to other resources. If that is the case, they MUST clearly document how SectionName is interpreted.
1319    ///  When unspecified (empty string), this will reference the entire resource. For the purpose of status, an attachment is considered successful if at least one section in the parent resource accepts it. For example, Gateway listeners can restrict which Routes can attach to them by Route kind, namespace, or hostname. If 1 of 2 Gateway listeners accept attachment from the referencing Route, the Route MUST be considered successfully attached. If no Gateway listeners accept attachment from this Route, the Route MUST be considered detached from the Gateway.
1320    ///  Support: Core
1321    #[serde(
1322        default,
1323        skip_serializing_if = "Option::is_none",
1324        rename = "sectionName"
1325    )]
1326    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
1327    pub section_name: Option<String>,
1328}