func flattenGraphsData(graphs []*pixela.GraphDefinition) []interface{} {
	if graphs != nil {
		gs := make([]interface{}, len(graphs), len(graphs))

		for i, graph := range graphs {
			g := make(map[string]interface{})
			g["id"] = graph.ID
			g["name"] = graph.Name
			g["unit"] = graph.Unit
			g["type"] = graph.Type
			g["color"] = graph.Color
			g["timezone"] = graph.TimeZone
			// below fields is used camel case in json tags.
			g["purge_cache_urls"] = graph.PurgeCacheURLs
			g["self_sufficient"] = graph.SelfSufficient
			g["is_secret"] = graph.IsSecret
			g["publish_optional_data"] = graph.PublishOptionalData

			gs[i] = g
		}

		return gs
	}

	return make([]interface{}, 0)
}
// to manual mapping because terraform cannot use camel case fields.
// Pixela responses has it.
to manual mapping because terraform cannot use camel case fields.
Pixela responses has it.
// to manual mapping because terraform cannot use camel case fields . // Pixela responses has it .
func flattenGraphsData(graphs []*pixela.GraphDefinition) []interface{} {
	if graphs != nil {
		gs := make([]interface{}, len(graphs), len(graphs))
		for i, graph := range graphs {
			g := make(map[string]interface{})
			g["id"] = graph.ID
			g["name"] = graph.Name
			g["unit"] = graph.Unit
			g["type"] = graph.Type
			g["color"] = graph.Color
			g["timezone"] = graph.TimeZone
			g["purge_cache_urls"] = graph.PurgeCacheURLs
			g["self_sufficient"] = graph.SelfSufficient
			g["is_secret"] = graph.IsSecret
			g["publish_optional_data"] = graph.PublishOptionalData
			gs[i] = g
		}
		return gs
	}
	return make([]interface{}, 0)
}
func flattenGraphsData ( graphs [ ] * pixela . GraphDefinition ) [ ] interface { } { if graphs != nil { gs := make ( [ ] interface { } , len ( graphs ) , len ( graphs ) ) for i , graph := range graphs { g := make ( map [ string ] interface { } ) g [ " " ] = graph . ID g [ " " ] = graph . Name g [ " " ] = graph . Unit g [ " " ] = graph . Type g [ " " ] = graph . Color g [ " " ] = graph . TimeZone g [ " " ] = graph . PurgeCacheURLs g [ " " ] = graph . SelfSufficient g [ " " ] = graph . IsSecret g [ " " ] = graph . PublishOptionalData gs [ i ] = g } return gs } return make ( [ ] interface { } , 0 ) }
to manual mapping because terraform cannot use camel case fields.
to manual mapping because terraform cannot use camel case fields .
// below fields is used camel case in json tags.