func()

in internal/provider/datasource_gitlab_pipeline_schedules.go [60:152]


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

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

		Attributes: map[string]schema.Attribute{
			"id": schema.StringAttribute{
				MarkdownDescription: "The ID of this Terraform resource.",
				Computed:            true,
			},
			"project": schema.StringAttribute{
				MarkdownDescription: "The name or id of the project to add the schedule to.",
				Required:            true,
			},
			"pipeline_schedules": schema.ListNestedAttribute{
				MarkdownDescription: "The list of pipeline schedules.",
				Computed:            true,
				NestedObject: schema.NestedAttributeObject{
					Attributes: map[string]schema.Attribute{
						"id": schema.Int64Attribute{
							MarkdownDescription: "The pipeline schedule id.",
							Required:            true,
						},
						"description": schema.StringAttribute{
							MarkdownDescription: "The description of the pipeline schedule.",
							Computed:            true,
						},
						"ref": schema.StringAttribute{
							MarkdownDescription: "The branch/tag name to be triggered. This will be the full branch reference, for example: `refs/heads/main`, not `main`.",
							Computed:            true,
						},
						"cron": schema.StringAttribute{
							MarkdownDescription: "The cron (e.g. `0 1 * * *`).",
							Computed:            true,
						},
						"cron_timezone": schema.StringAttribute{
							MarkdownDescription: "The timezone.",
							Optional:            true,
							Computed:            true,
						},
						"next_run_at": schema.StringAttribute{
							MarkdownDescription: "The datetime of when the schedule will next run.",
							Computed:            true,
						},
						"active": schema.BoolAttribute{
							MarkdownDescription: "The activation status of pipeline schedule.",
							Computed:            true,
						},
						"created_at": schema.StringAttribute{
							MarkdownDescription: "The datetime of when the schedule was created.",
							Computed:            true,
						},
						"updated_at": schema.StringAttribute{
							MarkdownDescription: "The datetime of when the schedule was last updated.",
							Computed:            true,
						},
						"owner": schema.SingleNestedAttribute{
							MarkdownDescription: "The details of the pipeline schedule owner.",
							Computed:            true,
							Attributes: map[string]schema.Attribute{
								"id": schema.Int64Attribute{
									MarkdownDescription: "The user ID.",
									Computed:            true,
								},
								"name": schema.StringAttribute{
									MarkdownDescription: "Name.",
									Computed:            true,
								},
								"username": schema.StringAttribute{
									MarkdownDescription: "Username.",
									Computed:            true,
								},
								"state": schema.StringAttribute{
									MarkdownDescription: "User's state, one of: active, blocked.",
									Computed:            true,
								},
								"avatar_url": schema.StringAttribute{
									MarkdownDescription: "Image URL for the user's avatar.",
									Computed:            true,
								},
								"web_url": schema.StringAttribute{
									MarkdownDescription: "URL to the user's profile.",
									Computed:            true,
								},
							},
						},
					},
				},
			},
		},
	}
}