func()

in internal/provider/resource_gitlab_project_push_rules.go [66:198]


func (r *gitlabProjectPushRulesResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
	resp.Schema = schema.Schema{
		MarkdownDescription: `The ` + "`gitlab_project_push_rules`" + ` resource allows to manage the lifecycle of push rules on a project.

~> This resource will compete with the ` + "`gitlab_project`" + ` resource if push rules are also defined as 
   part of that resource, since this resource will take over ownership of the project push rules created for the referenced project.
   It is recommended to define push rules using this resource OR in the ` + "`gitlab_project`" + ` resource, 
   but not in both as it may result in terraform identifying changes with every "plan" operation.

-> This resource requires a GitLab Enterprise instance with a Premium license to set the push rules on a project.

**Upstream API**: [GitLab API docs](https://docs.gitlab.com/api/projects/#push-rules)`,

		Attributes: map[string]schema.Attribute{
			"id": schema.StringAttribute{
				MarkdownDescription: "The ID of this Terraform resource.",
				Computed:            true,
				PlanModifiers:       []planmodifier.String{stringplanmodifier.UseStateForUnknown()},
			},
			"project": schema.StringAttribute{
				MarkdownDescription: "The ID or URL-encoded path of the project.",
				Required:            true,
				PlanModifiers:       []planmodifier.String{stringplanmodifier.RequiresReplace()},
				Validators:          []validator.String{stringvalidator.LengthAtLeast(1)},
			},
			"author_email_regex": schema.StringAttribute{
				MarkdownDescription: "All commit author emails must match this regex, e.g. `@my-company.com$`.",
				Optional:            true,
				Computed:            true,
				PlanModifiers: []planmodifier.String{
					stringplanmodifier.UseStateForUnknown(),
				},
			},
			"branch_name_regex": schema.StringAttribute{
				MarkdownDescription: "All branch names must match this regex, e.g. `(feature|hotfix)\\/*`.",
				Optional:            true,
				Computed:            true,
				PlanModifiers: []planmodifier.String{
					stringplanmodifier.UseStateForUnknown(),
				},
			},
			"commit_committer_check": schema.BoolAttribute{
				MarkdownDescription: "Users can only push commits to this repository that were committed with one of their own verified emails.",
				Optional:            true,
				Computed:            true,
				PlanModifiers: []planmodifier.Bool{
					boolplanmodifier.UseStateForUnknown(),
				},
			},
			"commit_committer_name_check": schema.BoolAttribute{
				MarkdownDescription: "Users can only push commits to this repository if the commit author name is consistent with their GitLab account name.",
				Optional:            true,
				Computed:            true,
				PlanModifiers: []planmodifier.Bool{
					boolplanmodifier.UseStateForUnknown(),
				},
			},
			"commit_message_negative_regex": schema.StringAttribute{
				MarkdownDescription: "No commit message is allowed to match this regex, e.g. `ssh\\:\\/\\/`.",
				Optional:            true,
				Computed:            true,
				PlanModifiers: []planmodifier.String{
					stringplanmodifier.UseStateForUnknown(),
				},
			},
			"commit_message_regex": schema.StringAttribute{
				MarkdownDescription: "All commit messages must match this regex, e.g. `Fixed \\d+\\..*`.",
				Optional:            true,
				Computed:            true,
				PlanModifiers: []planmodifier.String{
					stringplanmodifier.UseStateForUnknown(),
				},
			},
			"deny_delete_tag": schema.BoolAttribute{
				MarkdownDescription: "Deny deleting a tag.",
				Optional:            true,
				Computed:            true,
				PlanModifiers: []planmodifier.Bool{
					boolplanmodifier.UseStateForUnknown(),
				},
			},
			"file_name_regex": schema.StringAttribute{
				MarkdownDescription: "All committed filenames must not match this regex, e.g. `(jar|exe)$`.",
				Optional:            true,
				Computed:            true,
				PlanModifiers: []planmodifier.String{
					stringplanmodifier.UseStateForUnknown(),
				},
			},
			"max_file_size": schema.Int64Attribute{
				MarkdownDescription: "Maximum file size (MB).",
				Optional:            true,
				Computed:            true,
				PlanModifiers: []planmodifier.Int64{
					int64planmodifier.UseStateForUnknown(),
				},
				Validators: []validator.Int64{int64validator.AtLeast(0)},
			},
			"member_check": schema.BoolAttribute{
				MarkdownDescription: "Restrict commits by author (email) to existing GitLab users.",
				Optional:            true,
				Computed:            true,
				PlanModifiers: []planmodifier.Bool{
					boolplanmodifier.UseStateForUnknown(),
				},
			},
			"prevent_secrets": schema.BoolAttribute{
				MarkdownDescription: "GitLab will reject any files that are likely to contain secrets.",
				Optional:            true,
				Computed:            true,
				PlanModifiers: []planmodifier.Bool{
					boolplanmodifier.UseStateForUnknown(),
				},
			},
			"reject_unsigned_commits": schema.BoolAttribute{
				MarkdownDescription: "Reject commit when it’s not signed.",
				Optional:            true,
				Computed:            true,
				PlanModifiers: []planmodifier.Bool{
					boolplanmodifier.UseStateForUnknown(),
				},
			},
			"reject_non_dco_commits": schema.BoolAttribute{
				MarkdownDescription: "Reject commit when it’s not DCO certified.",
				Optional:            true,
				Computed:            true,
				PlanModifiers: []planmodifier.Bool{
					boolplanmodifier.UseStateForUnknown(),
				},
			},
		},
	}
}