@@ -23,6 +23,37 @@ func dataSourceGoogleProjects() *schema.Resource {
2323 Type : schema .TypeString ,
2424 Computed : true ,
2525 },
26+ "create_time" : {
27+ Type : schema .TypeString ,
28+ Computed : true ,
29+ },
30+ "labels" : {
31+ Type : schema .TypeMap ,
32+ Computed : true ,
33+ Elem : & schema.Schema {Type : schema .TypeString },
34+ Description : `A set of key/value label pairs assigned on a project.` ,
35+ },
36+ "parent" : {
37+ Type : schema .TypeMap ,
38+ Computed : true ,
39+ Elem : & schema.Schema {Type : schema .TypeString },
40+ Description : `An optional reference to a parent Resource.` ,
41+ },
42+ "number" : {
43+ Type : schema .TypeString ,
44+ Computed : true ,
45+ Description : `The numeric identifier of the project.` ,
46+ },
47+ "lifecycle_state" : {
48+ Type : schema .TypeString ,
49+ Computed : true ,
50+ Description : `The numeric identifier of the project.` ,
51+ },
52+ "name" : {
53+ Type : schema .TypeString ,
54+ Computed : true ,
55+ Description : `The optional user-assigned display name of the Project.` ,
56+ },
2657 },
2758 },
2859 },
@@ -79,11 +110,38 @@ func flattenDatasourceGoogleProjectsList(v interface{}) []map[string]interface{}
79110 projects := make ([]map [string ]interface {}, 0 , len (ls ))
80111 for _ , raw := range ls {
81112 p := raw .(map [string ]interface {})
113+
114+ var mId , mNumber , mLabels , mLifecycleState , mName , mCreateTime , mParent interface {}
82115 if pId , ok := p ["projectId" ]; ok {
83- projects = append (projects , map [string ]interface {}{
84- "project_id" : pId ,
85- })
116+ mId = pId
117+ }
118+ if pNumber , ok := p ["projectNumber" ]; ok {
119+ mNumber = pNumber
120+ }
121+ if pName , ok := p ["name" ]; ok {
122+ mName = pName
123+ }
124+ if pLabels , ok := p ["labels" ]; ok {
125+ mLabels = pLabels
126+ }
127+ if pLifecycleState , ok := p ["lifecycleState" ]; ok {
128+ mLifecycleState = pLifecycleState
129+ }
130+ if pCreateTime , ok := p ["createTime" ]; ok {
131+ mCreateTime = pCreateTime
132+ }
133+ if pParent , ok := p ["parent" ]; ok {
134+ mParent = pParent
86135 }
136+ projects = append (projects , map [string ]interface {}{
137+ "project_id" : mId ,
138+ "number" : mNumber ,
139+ "name" : mName ,
140+ "labels" : mLabels ,
141+ "lifecycle_state" : mLifecycleState ,
142+ "create_time" : mCreateTime ,
143+ "parent" : mParent ,
144+ })
87145 }
88146
89147 return projects
0 commit comments