@@ -302,6 +302,24 @@ The possible values for this attribute are:
302
302
- v1 or v1beta2: uses the push format defined in the v1 Pub/Sub API.` ,
303
303
Elem : & schema.Schema {Type : schema .TypeString },
304
304
},
305
+ "no_wrapper" : {
306
+ Type : schema .TypeList ,
307
+ Optional : true ,
308
+ Description : `When set, the payload to the push endpoint is not wrapped.Sets the
309
+ 'data' field as the HTTP body for delivery.` ,
310
+ MaxItems : 1 ,
311
+ Elem : & schema.Resource {
312
+ Schema : map [string ]* schema.Schema {
313
+ "write_metadata" : {
314
+ Type : schema .TypeBool ,
315
+ Required : true ,
316
+ Description : `When true, writes the Pub/Sub message metadata to
317
+ 'x-goog-pubsub-<KEY>:<VAL>' headers of the HTTP request. Writes the
318
+ Pub/Sub message attributes to '<KEY>:<VAL>' headers of the HTTP request.` ,
319
+ },
320
+ },
321
+ },
322
+ },
305
323
"oidc_token" : {
306
324
Type : schema .TypeList ,
307
325
Optional : true ,
@@ -950,6 +968,8 @@ func flattenPubsubSubscriptionPushConfig(v interface{}, d *schema.ResourceData,
950
968
flattenPubsubSubscriptionPushConfigPushEndpoint (original ["pushEndpoint" ], d , config )
951
969
transformed ["attributes" ] =
952
970
flattenPubsubSubscriptionPushConfigAttributes (original ["attributes" ], d , config )
971
+ transformed ["no_wrapper" ] =
972
+ flattenPubsubSubscriptionPushConfigNoWrapper (original ["noWrapper" ], d , config )
953
973
return []interface {}{transformed }
954
974
}
955
975
func flattenPubsubSubscriptionPushConfigOidcToken (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
@@ -983,6 +1003,23 @@ func flattenPubsubSubscriptionPushConfigAttributes(v interface{}, d *schema.Reso
983
1003
return v
984
1004
}
985
1005
1006
+ func flattenPubsubSubscriptionPushConfigNoWrapper (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1007
+ if v == nil {
1008
+ return nil
1009
+ }
1010
+ original := v .(map [string ]interface {})
1011
+ if len (original ) == 0 {
1012
+ return nil
1013
+ }
1014
+ transformed := make (map [string ]interface {})
1015
+ transformed ["write_metadata" ] =
1016
+ flattenPubsubSubscriptionPushConfigNoWrapperWriteMetadata (original ["writeMetadata" ], d , config )
1017
+ return []interface {}{transformed }
1018
+ }
1019
+ func flattenPubsubSubscriptionPushConfigNoWrapperWriteMetadata (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1020
+ return v
1021
+ }
1022
+
986
1023
func flattenPubsubSubscriptionAckDeadlineSeconds (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
987
1024
// Handles the string fixed64 format
988
1025
if strVal , ok := v .(string ); ok {
@@ -1216,6 +1253,13 @@ func expandPubsubSubscriptionPushConfig(v interface{}, d tpgresource.TerraformRe
1216
1253
transformed ["attributes" ] = transformedAttributes
1217
1254
}
1218
1255
1256
+ transformedNoWrapper , err := expandPubsubSubscriptionPushConfigNoWrapper (original ["no_wrapper" ], d , config )
1257
+ if err != nil {
1258
+ return nil , err
1259
+ } else if val := reflect .ValueOf (transformedNoWrapper ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
1260
+ transformed ["noWrapper" ] = transformedNoWrapper
1261
+ }
1262
+
1219
1263
return transformed , nil
1220
1264
}
1221
1265
@@ -1268,6 +1312,29 @@ func expandPubsubSubscriptionPushConfigAttributes(v interface{}, d tpgresource.T
1268
1312
return m , nil
1269
1313
}
1270
1314
1315
+ func expandPubsubSubscriptionPushConfigNoWrapper (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
1316
+ l := v .([]interface {})
1317
+ if len (l ) == 0 || l [0 ] == nil {
1318
+ return nil , nil
1319
+ }
1320
+ raw := l [0 ]
1321
+ original := raw .(map [string ]interface {})
1322
+ transformed := make (map [string ]interface {})
1323
+
1324
+ transformedWriteMetadata , err := expandPubsubSubscriptionPushConfigNoWrapperWriteMetadata (original ["write_metadata" ], d , config )
1325
+ if err != nil {
1326
+ return nil , err
1327
+ } else if val := reflect .ValueOf (transformedWriteMetadata ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
1328
+ transformed ["writeMetadata" ] = transformedWriteMetadata
1329
+ }
1330
+
1331
+ return transformed , nil
1332
+ }
1333
+
1334
+ func expandPubsubSubscriptionPushConfigNoWrapperWriteMetadata (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
1335
+ return v , nil
1336
+ }
1337
+
1271
1338
func expandPubsubSubscriptionAckDeadlineSeconds (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
1272
1339
return v , nil
1273
1340
}
0 commit comments