in internal/provider/datasource_gitlab_project_merge_request.go [54:148]
func (d *gitlabProjectMergeRequestDataSource) Schema(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
userAttributes := map[string]schema.Attribute{
"id": schema.Int32Attribute{
MarkdownDescription: "The internal ID number of the user.",
Computed: true,
},
"avatar_url": schema.StringAttribute{
MarkdownDescription: "A link to the user's avatar image.",
Computed: true,
},
"name": schema.StringAttribute{
MarkdownDescription: "The name of the user.",
Computed: true,
},
"state": schema.StringAttribute{
MarkdownDescription: "The state of the user account.",
Computed: true,
},
"username": schema.StringAttribute{
MarkdownDescription: "The username of the user.",
Computed: true,
},
"web_url": schema.StringAttribute{
MarkdownDescription: "A link to the user's profile page.",
Computed: true,
},
}
resp.Schema = schema.Schema{
MarkdownDescription: `
The ` + "`gitlab_project_merge_request`" + ` data source retrieves
information about a single merge request related to a specific project.
**Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/api/merge_requests/#get-single-mr)
`,
Attributes: map[string]schema.Attribute{
"id": schema.Int32Attribute{
MarkdownDescription: "The unique instance level ID of the merge request.",
Computed: true,
},
"iid": schema.Int32Attribute{
MarkdownDescription: "The unique project level ID of the merge request.",
Required: true,
},
"project": schema.StringAttribute{
MarkdownDescription: "The ID or path of the project.",
Required: true,
},
"assignee": schema.SingleNestedAttribute{
MarkdownDescription: "First assignee of the merge request.",
Computed: true,
Attributes: userAttributes,
},
"assignees": schema.ListNestedAttribute{
MarkdownDescription: "Assignees of the merge request.",
Computed: true,
NestedObject: schema.NestedAttributeObject{
Attributes: userAttributes,
},
},
"author": schema.SingleNestedAttribute{
MarkdownDescription: "User who created this merge request.",
Computed: true,
Attributes: userAttributes,
},
"blocking_discussions_resolved": schema.BoolAttribute{
MarkdownDescription: `
Indicates if all discussions are resolved only if all are
required before merge request can be merged.
`,
Computed: true,
},
"changes_count": schema.StringAttribute{
MarkdownDescription: `
Number of changes made on the merge request. Empty when the
merge request is created, and populates asynchronously.
`,
Computed: true,
},
"closed_at": schema.StringAttribute{
MarkdownDescription: "Timestamp of when the merge request was closed.",
Computed: true,
},
"closed_by": schema.SingleNestedAttribute{
MarkdownDescription: "User who closed this merge request.",
Computed: true,
Attributes: userAttributes,
},
"created_at": schema.StringAttribute{
MarkdownDescription: "Timestamp of when the merge request was created.",
Computed: true,
},
},
}
}