func()

in teamcity/vcsroot.go [71:203]


func (r *vcsRootResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
	resp.Schema = schema.Schema{
		Description: "A VCS root in TeamCity defines a connection to a version control system. More info [here](https://www.jetbrains.com/help/teamcity/vcs-root.html)",
		Attributes: map[string]schema.Attribute{
			"name": schema.StringAttribute{
				Required: true,
			},
			"id": schema.StringAttribute{
				Optional: true,
				Computed: true,
				PlanModifiers: []planmodifier.String{
					stringplanmodifier.UseStateForUnknown(),
				},
			},
			"project_id": schema.StringAttribute{
				Required: true,
			},
			"polling_interval": schema.Int64Attribute{
				Optional: true,
			},
			"git": schema.SingleNestedAttribute{
				Required: true,
				Attributes: map[string]schema.Attribute{
					"url": schema.StringAttribute{
						Required: true,
					},
					"push_url": schema.StringAttribute{
						Optional: true,
					},
					"branch": schema.StringAttribute{
						Required: true,
					},
					"branch_spec": schema.StringAttribute{
						Optional: true,
					},
					"tags_as_branches": schema.BoolAttribute{
						Optional: true,
					},
					"username_style": schema.StringAttribute{
						Optional: true,
						Computed: true,
						Validators: []validator.String{
							//TODO other syntax?
							stringvalidator.OneOf([]string{"USERID", "NAME", "EMAIL", "FULL"}...),
						},
						Default: stringdefault.StaticString("USERID"),
					},
					"submodules": schema.StringAttribute{
						Optional: true,
						Computed: true,
						Validators: []validator.String{
							//TODO other syntax?
							stringvalidator.OneOf([]string{"IGNORE", "CHECKOUT"}...),
						},
						Default: stringdefault.StaticString("CHECKOUT"),
					},
					"username_for_tags": schema.StringAttribute{
						Optional: true,
					},
					"auth_method": schema.StringAttribute{
						Optional: true,
						Validators: []validator.String{
							stringvalidator.OneOf([]string{
								//TODO other syntax? alternate nested types
								"ANONYMOUS",
								"PASSWORD",
								"TEAMCITY_SSH_KEY",
								"ACCESS_TOKEN",
								"PRIVATE_KEY_DEFAULT",
								"PRIVATE_KEY_FILE",
							}...),
						},
					},
					"username": schema.StringAttribute{
						Optional: true,
					},
					"password": schema.StringAttribute{
						Optional:  true,
						Sensitive: true,
					},
					"uploaded_key": schema.StringAttribute{
						Optional: true,
					},
					"private_key_path": schema.StringAttribute{
						Optional: true,
					},
					"passphrase": schema.StringAttribute{
						Optional:  true,
						Sensitive: true,
					},
					"ignore_known_hosts": schema.BoolAttribute{
						Optional: true,
						Computed: true,
						Default:  booldefault.StaticBool(true),
					},
					"convert_crlf": schema.BoolAttribute{
						Optional: true,
					},
					"path_to_git": schema.StringAttribute{
						Optional: true,
					},
					"checkout_policy": schema.StringAttribute{
						Optional: true,
						Computed: true,
						Validators: []validator.String{
							stringvalidator.OneOf([]string{"AUTO", "USE_MIRRORS", "NO_MIRRORS", "SHALLOW_CLONE"}...),
						},
						Default: stringdefault.StaticString("AUTO"),
					},
					"clean_policy": schema.StringAttribute{
						Optional: true,
						Computed: true,
						Validators: []validator.String{
							stringvalidator.OneOf([]string{"ON_BRANCH_CHANGE", "ALWAYS", "NEVER"}...),
						},
						Default: stringdefault.StaticString("ON_BRANCH_CHANGE"),
					},
					"clean_files_policy": schema.StringAttribute{
						Optional: true,
						Computed: true,
						Validators: []validator.String{
							stringvalidator.OneOf([]string{"ALL_UNTRACKED", "IGNORED_ONLY", "NON_IGNORED_ONLY"}...),
						},
						Default: stringdefault.StaticString("ALL_UNTRACKED"),
					},
					"token_id": schema.StringAttribute{
						Optional: true,
					},
				},
			},
		},
	}
}