@@ -259,6 +259,53 @@ func ResourceApphubService() *schema.Resource {
259259 Description : `Properties of an underlying cloud resource that can comprise a Service.` ,
260260 Elem : & schema.Resource {
261261 Schema : map [string ]* schema.Schema {
262+ "extended_metadata" : {
263+ Type : schema .TypeList ,
264+ Computed : true ,
265+ Description : `Output only. Additional metadata specific to the resource type.` ,
266+ Elem : & schema.Resource {
267+ Schema : map [string ]* schema.Schema {
268+ "key" : {
269+ Type : schema .TypeString ,
270+ Computed : true ,
271+ Description : `The key of the extended metadata.` ,
272+ },
273+ "value" : {
274+ Type : schema .TypeList ,
275+ Computed : true ,
276+ Description : `The value of the extended metadata.` ,
277+ Elem : & schema.Resource {
278+ Schema : map [string ]* schema.Schema {
279+ "extended_metadata_schema" : {
280+ Type : schema .TypeString ,
281+ Computed : true ,
282+ Description : `The resource name for the Extended Metadata Schema.` ,
283+ },
284+ "metadata_struct" : {
285+ Type : schema .TypeString ,
286+ Computed : true ,
287+ Description : `The metadata contents as a JSON string.` ,
288+ },
289+ },
290+ },
291+ },
292+ },
293+ },
294+ },
295+ "functional_type" : {
296+ Type : schema .TypeList ,
297+ Computed : true ,
298+ Description : `Output only. The type of the service.` ,
299+ Elem : & schema.Resource {
300+ Schema : map [string ]* schema.Schema {
301+ "type" : {
302+ Type : schema .TypeString ,
303+ Computed : true ,
304+ Description : `Output only. The functional type of a service or workload.` ,
305+ },
306+ },
307+ },
308+ },
262309 "gcp_project" : {
263310 Type : schema .TypeString ,
264311 Computed : true ,
@@ -269,6 +316,20 @@ func ResourceApphubService() *schema.Resource {
269316 Computed : true ,
270317 Description : `Output only. The location that the underlying resource resides in, for example, us-west1.` ,
271318 },
319+ "registration_type" : {
320+ Type : schema .TypeList ,
321+ Computed : true ,
322+ Description : `Output only. The registration type of the service.` ,
323+ Elem : & schema.Resource {
324+ Schema : map [string ]* schema.Schema {
325+ "type" : {
326+ Type : schema .TypeString ,
327+ Computed : true ,
328+ Description : `Output only. The registration type of a service.` ,
329+ },
330+ },
331+ },
332+ },
272333 "zone" : {
273334 Type : schema .TypeString ,
274335 Computed : true ,
@@ -705,6 +766,12 @@ func flattenApphubServiceServiceProperties(v interface{}, d *schema.ResourceData
705766 flattenApphubServiceServicePropertiesLocation (original ["location" ], d , config )
706767 transformed ["zone" ] =
707768 flattenApphubServiceServicePropertiesZone (original ["zone" ], d , config )
769+ transformed ["functional_type" ] =
770+ flattenApphubServiceServicePropertiesFunctionalType (original ["functionalType" ], d , config )
771+ transformed ["registration_type" ] =
772+ flattenApphubServiceServicePropertiesRegistrationType (original ["registrationType" ], d , config )
773+ transformed ["extended_metadata" ] =
774+ flattenApphubServiceServicePropertiesExtendedMetadata (original ["extendedMetadata" ], d , config )
708775 return []interface {}{transformed }
709776}
710777func flattenApphubServiceServicePropertiesGcpProject (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
@@ -719,6 +786,86 @@ func flattenApphubServiceServicePropertiesZone(v interface{}, d *schema.Resource
719786 return v
720787}
721788
789+ func flattenApphubServiceServicePropertiesFunctionalType (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
790+ if v == nil {
791+ return nil
792+ }
793+ original := v .(map [string ]interface {})
794+ if len (original ) == 0 {
795+ return nil
796+ }
797+ transformed := make (map [string ]interface {})
798+ transformed ["type" ] =
799+ flattenApphubServiceServicePropertiesFunctionalTypeType (original ["type" ], d , config )
800+ return []interface {}{transformed }
801+ }
802+ func flattenApphubServiceServicePropertiesFunctionalTypeType (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
803+ return v
804+ }
805+
806+ func flattenApphubServiceServicePropertiesRegistrationType (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
807+ if v == nil {
808+ return nil
809+ }
810+ original := v .(map [string ]interface {})
811+ if len (original ) == 0 {
812+ return nil
813+ }
814+ transformed := make (map [string ]interface {})
815+ transformed ["type" ] =
816+ flattenApphubServiceServicePropertiesRegistrationTypeType (original ["type" ], d , config )
817+ return []interface {}{transformed }
818+ }
819+ func flattenApphubServiceServicePropertiesRegistrationTypeType (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
820+ return v
821+ }
822+
823+ func flattenApphubServiceServicePropertiesExtendedMetadata (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
824+ if v == nil {
825+ return v
826+ }
827+ l := v .([]interface {})
828+ transformed := make ([]interface {}, 0 , len (l ))
829+ for _ , raw := range l {
830+ original := raw .(map [string ]interface {})
831+ if len (original ) < 1 {
832+ // Do not include empty json objects coming back from the api
833+ continue
834+ }
835+ transformed = append (transformed , map [string ]interface {}{
836+ "key" : flattenApphubServiceServicePropertiesExtendedMetadataKey (original ["key" ], d , config ),
837+ "value" : flattenApphubServiceServicePropertiesExtendedMetadataValue (original ["value" ], d , config ),
838+ })
839+ }
840+ return transformed
841+ }
842+ func flattenApphubServiceServicePropertiesExtendedMetadataKey (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
843+ return v
844+ }
845+
846+ func flattenApphubServiceServicePropertiesExtendedMetadataValue (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
847+ if v == nil {
848+ return nil
849+ }
850+ original := v .(map [string ]interface {})
851+ if len (original ) == 0 {
852+ return nil
853+ }
854+ transformed := make (map [string ]interface {})
855+ transformed ["metadata_struct" ] =
856+ flattenApphubServiceServicePropertiesExtendedMetadataValueMetadataStruct (original ["metadataStruct" ], d , config )
857+ transformed ["extended_metadata_schema" ] =
858+ flattenApphubServiceServicePropertiesExtendedMetadataValueExtendedMetadataSchema (original ["extendedMetadataSchema" ], d , config )
859+ return []interface {}{transformed }
860+ }
861+ func flattenApphubServiceServicePropertiesExtendedMetadataValueMetadataStruct (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
862+ return v
863+ }
864+
865+ func flattenApphubServiceServicePropertiesExtendedMetadataValueExtendedMetadataSchema (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
866+ return v
867+ }
868+
722869func flattenApphubServiceAttributes (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
723870 if v == nil {
724871 return nil
0 commit comments