in internal/provider/resource_gitlab_global_level_notification.go [71:197]
func (d *gitlabGlobalLevelNotificationsResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
resp.Schema = schema.Schema{
Version: 1,
MarkdownDescription: `The ` + "`" + `gitlab_global_level_notifications` + "`" + ` resource allows to manage global notifications.
**Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/api/notification_settings/#group--project-level-notification-settings)`,
// Schema is external because we'll need to re-implement the state migration function.
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
Computed: true,
MarkdownDescription: "The ID of the resource.This is a static value named gitlab",
},
"level": schema.StringAttribute{
MarkdownDescription: fmt.Sprintf("The level of the notification. Valid values are: %s.", utils.RenderValueListForDocs(allowedNotificationLevels)),
Optional: true,
Computed: true,
Validators: []validator.String{
stringvalidator.OneOf(allowedGlobalNotificationLevels...),
},
PlanModifiers: []planmodifier.String{stringplanmodifier.UseStateForUnknown()},
},
"new_note": schema.BoolAttribute{
MarkdownDescription: "Enable notifications for new notes on merge requests. Can only be used when `level` is `custom`.",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.Bool{boolplanmodifier.UseStateForUnknown()},
},
"new_issue": schema.BoolAttribute{
MarkdownDescription: "Enable notifications for new issues. Can only be used when `level` is `custom`.",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.Bool{boolplanmodifier.UseStateForUnknown()},
},
"reopen_issue": schema.BoolAttribute{
MarkdownDescription: "Enable notifications for reopened issues. Can only be used when `level` is `custom`.",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.Bool{boolplanmodifier.UseStateForUnknown()},
},
"close_issue": schema.BoolAttribute{
MarkdownDescription: "Enable notifications for closed issues. Can only be used when `level` is `custom`.",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.Bool{boolplanmodifier.UseStateForUnknown()},
},
"reassign_issue": schema.BoolAttribute{
MarkdownDescription: "Enable notifications for issue reassignments. Can only be used when `level` is `custom`.",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.Bool{boolplanmodifier.UseStateForUnknown()},
},
"issue_due": schema.BoolAttribute{
MarkdownDescription: "Enable notifications for due issues. Can only be used when `level` is `custom`.",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.Bool{boolplanmodifier.UseStateForUnknown()},
},
"new_merge_request": schema.BoolAttribute{
MarkdownDescription: "Enable notifications for new merge requests. Can only be used when `level` is `custom`.",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.Bool{boolplanmodifier.UseStateForUnknown()},
},
"push_to_merge_request": schema.BoolAttribute{
MarkdownDescription: "Enable notifications for push to merge request branches. Can only be used when `level` is `custom`.",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.Bool{boolplanmodifier.UseStateForUnknown()},
},
"reopen_merge_request": schema.BoolAttribute{
MarkdownDescription: "Enable notifications for reopened merge requests. Can only be used when `level` is `custom`.",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.Bool{boolplanmodifier.UseStateForUnknown()},
},
"close_merge_request": schema.BoolAttribute{
MarkdownDescription: "Enable notifications for closed merge requests. Can only be used when `level` is `custom`.",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.Bool{boolplanmodifier.UseStateForUnknown()},
},
"reassign_merge_request": schema.BoolAttribute{
MarkdownDescription: "Enable notifications for merge request reassignments. Can only be used when `level` is `custom`.",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.Bool{boolplanmodifier.UseStateForUnknown()},
},
"merge_merge_request": schema.BoolAttribute{
MarkdownDescription: "Enable notifications for merged merge requests. Can only be used when `level` is `custom`.",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.Bool{boolplanmodifier.UseStateForUnknown()},
},
"failed_pipeline": schema.BoolAttribute{
MarkdownDescription: "Enable notifications for failed pipelines. Can only be used when `level` is `custom`.",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.Bool{boolplanmodifier.UseStateForUnknown()},
},
"fixed_pipeline": schema.BoolAttribute{
MarkdownDescription: "Enable notifications for fixed pipelines. Can only be used when `level` is `custom`.",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.Bool{boolplanmodifier.UseStateForUnknown()},
},
"success_pipeline": schema.BoolAttribute{
MarkdownDescription: "Enable notifications for successful pipelines. Can only be used when `level` is `custom`.",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.Bool{boolplanmodifier.UseStateForUnknown()},
},
"moved_project": schema.BoolAttribute{
MarkdownDescription: "Enable notifications for moved projects. Can only be used when `level` is `custom`.",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.Bool{boolplanmodifier.UseStateForUnknown()},
},
"merge_when_pipeline_succeeds": schema.BoolAttribute{
MarkdownDescription: "Enable notifications for merged merge requests when the pipeline succeeds. Can only be used when `level` is `custom`.",
Optional: true,
Computed: true,
PlanModifiers: []planmodifier.Bool{boolplanmodifier.UseStateForUnknown()},
},
},
}
}