2021-02-24 12:55:26 +00:00
|
|
|
// GENERATED, DO NOT EDIT THIS FILE
|
|
|
|
package github
|
|
|
|
|
2021-12-06 13:29:39 +00:00
|
|
|
import "github.com/snyk/driftctl/pkg/resource"
|
2021-03-25 11:13:52 +00:00
|
|
|
|
2021-02-24 12:55:26 +00:00
|
|
|
const GithubTeamResourceType = "github_team"
|
|
|
|
|
2021-05-11 12:32:33 +00:00
|
|
|
func initGithubTeamMetaData(resourceSchemaRepository resource.SchemaRepositoryInterface) {
|
2021-08-09 14:03:04 +00:00
|
|
|
resourceSchemaRepository.SetNormalizeFunc(GithubTeamResourceType, func(res *resource.Resource) {
|
2021-05-24 15:19:06 +00:00
|
|
|
val := res.Attrs
|
2021-05-11 12:32:33 +00:00
|
|
|
if defaultMaintainer, exist := val.Get("create_default_maintainer"); !exist || defaultMaintainer == nil {
|
|
|
|
(*val)["create_default_maintainer"] = false
|
|
|
|
}
|
|
|
|
val.SafeDelete([]string{"etag"})
|
|
|
|
})
|
2021-08-09 14:03:04 +00:00
|
|
|
resourceSchemaRepository.SetHumanReadableAttributesFunc(GithubTeamResourceType, func(res *resource.Resource) map[string]string {
|
2021-05-21 14:09:45 +00:00
|
|
|
val := res.Attrs
|
|
|
|
attrs := make(map[string]string)
|
2021-08-18 13:58:28 +00:00
|
|
|
attrs["Id"] = res.ResourceId()
|
2021-05-21 14:09:45 +00:00
|
|
|
if name := val.GetString("name"); name != nil && *name != "" {
|
|
|
|
attrs["Name"] = *name
|
|
|
|
}
|
|
|
|
return attrs
|
|
|
|
})
|
2021-09-17 15:16:06 +00:00
|
|
|
resourceSchemaRepository.SetFlags(GithubTeamResourceType, resource.FlagDeepMode)
|
2021-05-11 12:32:33 +00:00
|
|
|
}
|