shamrickus commented on a change in pull request #4644:
URL: https://github.com/apache/trafficcontrol/pull/4644#discussion_r573195480
##########
File path: lib/go-tc/deliveryservices.go
##########
@@ -173,35 +172,95 @@ type DeliveryServiceV11 struct {
XMLID string `json:"xmlId"`
}
+type DeliveryServiceV40 struct {
+ DeliveryServiceFieldsV31
+ DeliveryServiceFieldsV30
+ DeliveryServiceNullableFieldsV15
+ DeliveryServiceNullableFieldsV14
+ DeliveryServiceNullableFieldsV13
+ DeliveryServiceNullableFieldsV11
+}
+
+func DSV40ToV31(v40 DeliveryServiceNullableV40) DeliveryServiceV31 {
+ return DeliveryServiceV31{
+ DeliveryServiceV30: DeliveryServiceV30{
+ DeliveryServiceNullableV15: DeliveryServiceNullableV15{
+ DeliveryServiceNullableV14:
DeliveryServiceNullableV14{
+ DeliveryServiceNullableV13:
DeliveryServiceNullableV13{
+ DeliveryServiceNullableV12:
DeliveryServiceNullableV12{
+
DeliveryServiceNullableV11: DeliveryServiceNullableV11{
+
DeliveryServiceNullableFieldsV11: v40.DeliveryServiceNullableFieldsV11,
+ },
+ },
+
DeliveryServiceNullableFieldsV13: v40.DeliveryServiceNullableFieldsV13,
+ },
+ DeliveryServiceNullableFieldsV14:
v40.DeliveryServiceNullableFieldsV14,
+ },
+ DeliveryServiceNullableFieldsV15:
v40.DeliveryServiceNullableFieldsV15,
+ },
+ DeliveryServiceFieldsV30: v40.DeliveryServiceFieldsV30,
+ },
+ DeliveryServiceFieldsV31: v40.DeliveryServiceFieldsV31,
+ }
+}
+
+func DSV31ToV40(v31 DeliveryServiceV31) DeliveryServiceV40 {
+ return DeliveryServiceV40{
+ DeliveryServiceFieldsV31: v31.DeliveryServiceFieldsV31,
+ DeliveryServiceFieldsV30: v31.DeliveryServiceFieldsV30,
+ DeliveryServiceNullableFieldsV15:
v31.DeliveryServiceNullableFieldsV15,
+ DeliveryServiceNullableFieldsV14:
v31.DeliveryServiceNullableFieldsV14,
+ DeliveryServiceNullableFieldsV13:
v31.DeliveryServiceNullableFieldsV13,
+ DeliveryServiceNullableFieldsV11:
v31.DeliveryServiceNullableFieldsV11,
+ }
+}
+
+type DeliveryServiceV31 struct {
+ DeliveryServiceV30
+ DeliveryServiceFieldsV31
+}
+
+type DeliveryServiceFieldsV31 struct {
+ MaxRequestHeaderBytes *int `json:"maxRequestHeaderBytes"
db:"max_request_header_bytes"`
+}
+
type DeliveryServiceV30 struct {
DeliveryServiceNullableV15
+ DeliveryServiceFieldsV30
+}
+type DeliveryServiceFieldsV30 struct {
Topology *string `json:"topology" db:"topology"`
FirstHeaderRewrite *string `json:"firstHeaderRewrite"
db:"first_header_rewrite"`
InnerHeaderRewrite *string `json:"innerHeaderRewrite"
db:"inner_header_rewrite"`
LastHeaderRewrite *string `json:"lastHeaderRewrite"
db:"last_header_rewrite"`
ServiceCategory *string `json:"serviceCategory"
db:"service_category"`
}
-type DeliveryServiceV31 struct {
- DeliveryServiceV30
- MaxRequestHeaderBytes *int `json:"maxRequestHeaderBytes"
db:"max_request_header_bytes"`
-}
-
// DeliveryServiceNullableV30 is the aliased structure that we should be using
for all api 3.x delivery structure operations
// This type should always alias the latest 3.x minor version struct. For ex,
if you wanted to create a DeliveryServiceV32 struct, you would do the following:
// type DeliveryServiceNullableV30 DeliveryServiceV32
// DeliveryServiceV32 = DeliveryServiceV31 + the new fields
type DeliveryServiceNullableV30 DeliveryServiceV31
+type DeliveryServiceNullableV40 DeliveryServiceV40
Review comment:
Sure can, was just copy and pasting.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]