func()

in internal/provider/datasource_gitlab_release.go [74:171]


func (d *gitlabReleaseDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
	resp.Schema = schema.Schema{
		MarkdownDescription: `The ` + "`gitlab_release`" + ` data source retrieves information about a gitlab release for a project.

**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_id": schema.StringAttribute{
				MarkdownDescription: "The ID or URL-encoded path of the project.",
				Required:            true,
			},
			"tag_name": schema.StringAttribute{
				MarkdownDescription: "The Git tag the release is associated with.",
				Required:            true,
			},
			"description": schema.StringAttribute{
				MarkdownDescription: "An HTML rendered description of the release.",
				Computed:            true,
			},
			"name": schema.StringAttribute{
				MarkdownDescription: "The name of the release.",
				Computed:            true,
			},
			"created_at": schema.StringAttribute{
				MarkdownDescription: "The date the release was created.",
				Computed:            true,
			},
			"released_at": schema.StringAttribute{
				MarkdownDescription: "The date the release was created.",
				Computed:            true,
			},
		},
		Blocks: map[string]schema.Block{

			// The assets block stores the assets, both source and link,
			// for the reslse
			"assets": schema.SingleNestedBlock{
				MarkdownDescription: "The assets for a release",
				Attributes: map[string]schema.Attribute{
					"count": schema.Int64Attribute{
						MarkdownDescription: "The number of assets for a release",
						Computed:            true,
					},
				},
				Blocks: map[string]schema.Block{

					// The "Sources" stores the source links
					// for the release
					"sources": schema.ListNestedBlock{
						MarkdownDescription: "The sources for a release",
						NestedObject: schema.NestedBlockObject{
							Attributes: map[string]schema.Attribute{
								"format": schema.StringAttribute{
									MarkdownDescription: "The format of the source",
									Computed:            true,
								},
								"url": schema.StringAttribute{
									MarkdownDescription: "The URL of the source",
									Computed:            true,
								},
							},
						},
					},

					// The "Links" stores the custom release links
					// for the release
					"links": schema.ListNestedBlock{
						MarkdownDescription: "The links for a release",
						NestedObject: schema.NestedBlockObject{
							Attributes: map[string]schema.Attribute{
								"id": schema.Int64Attribute{
									MarkdownDescription: "The ID of the link",
									Computed:            true,
								},
								"name": schema.StringAttribute{
									MarkdownDescription: "The name of the link",
									Computed:            true,
								},
								"url": schema.StringAttribute{
									MarkdownDescription: "The URL of the link",
									Computed:            true,
								},
								"link_type": schema.StringAttribute{
									MarkdownDescription: "The type of the link",
									Computed:            true,
								},
							},
						},
					},
				},
			},
		},
	}
}