variable "name" {
  type        = string
  description = "The name of the repository."
}

variable "description" {
  type        = string
  description = "A description of the repository."
  default     = "Managed by Terraform"
}

variable "homepage_url" {
  type        = string
  description = "URL of a page describing the project."
  default     = null
}

variable "visibility" {
  type        = string
  description = "Whether the repository is public, private or internal."
  default     = "private"
}

variable "has_issues" {
  type        = bool
  description = "Set to true to enable the GitHub Issues features on the repository."
  default     = true
}

variable "has_projects" {
  type        = bool
  description = "Set to true to enable the GitHub Projects features on the repository."
  default     = true
}

variable "has_wiki" {
  type        = bool
  description = "Set to true to enable the GitHub Wiki features on the repository."
  default     = true
}

variable "has_downloads" {
  type        = bool
  description = "Set to true to enable the (deprecated) downloads features on the repository."
  default     = true
}

variable "allow_merge_commit" {
  type        = bool
  description = "Set to false to disable merge commits on the repository."
  default     = true
}

variable "allow_squash_merge" {
  type        = bool
  description = "Set to false to disable squash merges on the repository."
  default     = true
}

variable "allow_rebase_merge" {
  type        = bool
  description = "Set to false to disable rebase merges on the repository."
  default     = true
}

variable "auto_init" {
  type        = bool
  description = "Set to true to produce an initial commit in the repository."
  default     = false
}

variable "gitignore_template" {
  type        = string
  description = "Use the name of the template without the extension. For example, 'Haskell'."
  default     = null
}

variable "license_template" {
  type        = string
  description = "Use the name of the template without the extension. For example, 'mit' or 'mpl-2.0'."
  default     = null
}

variable "default_branch" {
  type        = string
  description = "The name of the default branch of the repository."
  default     = ""
}

variable "topics" {
  type        = list(string)
  description = "The list of topics of the repository."
  default     = null
}

variable "team_permissions" {
  type        = map(object({ team_id = string, permission = string }))
  description = "The map of permissions. If empty only owner has access."
  default     = {}
}

variable "user_permissions" {
  type        = map(object({ username = string, permission = string }))
  description = "The map of permissions. If empty only owner has access."
  default     = {}
}
# second option
variable "team_permissions_v2" {
  type        = map(list(string))
  description = "Simplified map of permissions. The key is permission itself, the value is list of team_ids. If empty only owner has access."
  default     = {}
}

variable "user_permissions_v2" {
  type        = map(list(string))
  description = "Simplified map of permissions. The key is permission itself, the value is list of usernames. If empty only owner has access."
  default     = {}
}

variable "archived" {
  type        = bool
  description = "Specifies if the repository should be archived."
  default     = false
}

variable "delete_branch_on_merge" {
  type        = bool
  description = "Automatically delete head branch after a pull request is merged."
  default     = false
}

variable "is_template" {
  type        = bool
  description = "Set to `true` to tell GitHub that this is a template repository."
  default     = false
}
