func()

in internal/provider/resource_gitlab_release.go [109:313]


func (r *gitlabReleaseResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
	resp.Schema = schema.Schema{
		MarkdownDescription: fmt.Sprintf(`The ` + "`gitlab_release`" + ` resource allows to manage the lifecycle of releases in gitlab.

**Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/api/releases/)`),

		Attributes: map[string]schema.Attribute{
			"id": schema.StringAttribute{
				MarkdownDescription: "The ID of this Terraform resource. In the format of `<project_id:tag_name>`.",
				Computed:            true,
			},
			"project": schema.StringAttribute{
				MarkdownDescription: "The ID or full path of the project.",
				Required:            true,
				PlanModifiers:       []planmodifier.String{stringplanmodifier.RequiresReplace()},
				Validators:          []validator.String{stringvalidator.LengthAtLeast(1)},
			},
			"name": schema.StringAttribute{
				MarkdownDescription: "The name of the release.",
				Optional:            true,
				Computed:            true,
			},
			"tag_name": schema.StringAttribute{
				MarkdownDescription: "The tag where the release is created from.",
				Required:            true,
				PlanModifiers:       []planmodifier.String{stringplanmodifier.RequiresReplace()},
				Validators:          []validator.String{stringvalidator.LengthAtLeast(1)},
			},
			"tag_message": schema.StringAttribute{
				MarkdownDescription: "Message to use if creating a new annotated tag.",
				Optional:            true,
			},
			"tag_path": schema.StringAttribute{
				MarkdownDescription: "The path to the tag.",
				Computed:            true,
			},
			"description": schema.StringAttribute{
				MarkdownDescription: "The description of the release. You can use Markdown.",
				Optional:            true,
				Computed:            true,
			},
			"description_html": schema.StringAttribute{
				MarkdownDescription: "HTML rendered Markdown of the release description.",
				Computed:            true,
			},
			"ref": schema.StringAttribute{
				MarkdownDescription: "If a tag specified in tag_name doesn't exist, the release is created from ref and tagged with tag_name. It can be a commit SHA, another tag name, or a branch name.",
				Optional:            true,
				Computed:            true,
			},
			"milestones": schema.SetAttribute{
				MarkdownDescription: "The title of each milestone the release is associated with. GitLab Premium customers can specify group milestones.",
				Optional:            true,
				ElementType:         types.StringType,
			},
			"created_at": schema.StringAttribute{
				MarkdownDescription: "Date and time the release was created. In ISO 8601 format (2019-03-15T08:00:00Z).",
				Computed:            true,
			},
			"released_at": schema.StringAttribute{
				MarkdownDescription: "Date and time for the release. Defaults to the current time. Expected in ISO 8601 format (2019-03-15T08:00:00Z). Only provide this field if creating an upcoming or historical release.",
				Optional:            true,
				Computed:            true,
			},
			"author": schema.SingleNestedAttribute{
				MarkdownDescription: "The author of the release.",
				Computed:            true,
				Attributes: map[string]schema.Attribute{
					"id": schema.Int64Attribute{
						MarkdownDescription: "The ID of the author's user.",
						Computed:            true,
					},
					"name": schema.StringAttribute{
						MarkdownDescription: "The name of the author.",
						Computed:            true,
					},
					"username": schema.StringAttribute{
						MarkdownDescription: "The username of the author.",
						Computed:            true,
					},
					"state": schema.StringAttribute{
						MarkdownDescription: "The state of the author's user.",
						Computed:            true,
					},
					"avatar_url": schema.StringAttribute{
						MarkdownDescription: "The url of the author's' user avatar.",
						Computed:            true,
					},
					"web_url": schema.StringAttribute{
						MarkdownDescription: "The url to the author's user profile.",
						Computed:            true,
					},
				},
			},
			"commit": schema.SingleNestedAttribute{
				MarkdownDescription: "The release commit.",
				Computed:            true,
				Attributes: map[string]schema.Attribute{
					"id": schema.StringAttribute{
						MarkdownDescription: "The git commit full SHA",
						Computed:            true,
					},
					"short_id": schema.StringAttribute{
						MarkdownDescription: "The git commit short SHA.",
						Computed:            true,
					},
					"title": schema.StringAttribute{
						MarkdownDescription: "The title of the commit.",
						Computed:            true,
					},
					"created_at": schema.StringAttribute{
						MarkdownDescription: "The date and time the commit was created. In ISO 8601 format (2019-03-15T08:00:00Z).",
						Computed:            true,
					},
					"parent_ids": schema.SetAttribute{
						MarkdownDescription: "The full SHA of any parent commits.",
						Computed:            true,
						ElementType:         types.StringType,
					},
					"message": schema.StringAttribute{
						MarkdownDescription: "The commit message.",
						Computed:            true,
					},
					"author_name": schema.StringAttribute{
						MarkdownDescription: "The name of the commit author.",
						Computed:            true,
					},
					"author_email": schema.StringAttribute{
						MarkdownDescription: "The email address of the commit author.",
						Computed:            true,
					},
					"authored_date": schema.StringAttribute{
						MarkdownDescription: "The date and time the commit was authored. In ISO 8601 format (2019-03-15T08:00:00Z).",
						Computed:            true,
					},
					"committer_name": schema.StringAttribute{
						MarkdownDescription: "The name of the committer.",
						Computed:            true,
					},
					"committer_email": schema.StringAttribute{
						MarkdownDescription: "The email address of the committer.",
						Computed:            true,
					},
					"committed_date": schema.StringAttribute{
						MarkdownDescription: "The date and time the commit was made. In ISO 8601 format (2019-03-15T08:00:00Z).",
						Computed:            true,
					},
				},
			},
			"upcoming_release": schema.BoolAttribute{
				MarkdownDescription: "Whether the release_at attribute is set to a future date.",
				Computed:            true,
			},
			"commit_path": schema.StringAttribute{
				MarkdownDescription: "The path to the commit",
				Computed:            true,
			},
			"assets": schema.SingleNestedAttribute{
				MarkdownDescription: "The release assets.",
				Optional:            true,
				Computed:            true,
				Attributes: map[string]schema.Attribute{
					"count": schema.Int64Attribute{
						MarkdownDescription: "The total count of assets in this release.",
						Computed:            true,
					},
				},
			},
			"links": schema.SingleNestedAttribute{
				MarkdownDescription: "Links of the release",
				Computed:            true,
				Attributes: map[string]schema.Attribute{
					"closed_issues_url": schema.StringAttribute{
						MarkdownDescription: "URL of the release's closed issues.",
						Computed:            true,
					},
					"closed_merge_requests_url": schema.StringAttribute{
						MarkdownDescription: "URL of the release's closed merge requests.",
						Computed:            true,
					},
					"edit_url": schema.StringAttribute{
						MarkdownDescription: "URL of the release's edit page.",
						Computed:            true,
					},
					"merged_merge_requests_url": schema.StringAttribute{
						MarkdownDescription: "URL of the release's merged merge requests.",
						Computed:            true,
					},
					"opened_issues_url": schema.StringAttribute{
						MarkdownDescription: "URL of the release's open issues.",
						Computed:            true,
					},
					"opened_merge_requests_url": schema.StringAttribute{
						MarkdownDescription: "URL of the release's open merge requests.",
						Computed:            true,
					},
					"self": schema.StringAttribute{
						MarkdownDescription: "URL of the release.",
						Computed:            true,
					},
				},
			},
		},
	}
}