in internal/services/azapi_resource_action_data_source.go [57:147]
func (r *ResourceActionDataSource) Schema(ctx context.Context, request datasource.SchemaRequest, response *datasource.SchemaResponse) {
response.Schema = schema.Schema{
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
Computed: true,
MarkdownDescription: docstrings.ID(),
},
"type": schema.StringAttribute{
Required: true,
Validators: []validator.String{
myvalidator.StringIsResourceType(),
},
MarkdownDescription: docstrings.Type(),
},
"resource_id": schema.StringAttribute{
Optional: true,
Validators: []validator.String{
myvalidator.StringIsResourceID(),
},
MarkdownDescription: "The ID of the Azure resource to perform the action on.",
},
"action": schema.StringAttribute{
Optional: true,
MarkdownDescription: docstrings.ResourceAction(),
},
"method": schema.StringAttribute{
Optional: true,
Computed: true,
Validators: []validator.String{
stringvalidator.OneOf("POST", "GET"),
},
MarkdownDescription: "The HTTP method to use when performing the action. Must be one of `POST`, `GET`. Defaults to `POST`.",
},
// The body attribute is a dynamic attribute that only allows users to specify the resource body as an HCL object
"body": schema.DynamicAttribute{
Optional: true,
Validators: []validator.Dynamic{
myvalidator.DynamicIsNotStringValidator(),
},
},
"response_export_values": schema.DynamicAttribute{
Optional: true,
MarkdownDescription: docstrings.ResponseExportValues(),
},
"sensitive_response_export_values": schema.DynamicAttribute{
Optional: true,
MarkdownDescription: docstrings.SensitiveResponseExportValues(),
},
"output": schema.DynamicAttribute{
Computed: true,
MarkdownDescription: docstrings.Output("data.azapi_resource_action"),
},
"sensitive_output": schema.DynamicAttribute{
Computed: true,
Sensitive: true,
MarkdownDescription: docstrings.SensitiveOutput("data.azapi_resource_action"),
},
"retry": retry.RetrySchema(ctx),
"headers": schema.MapAttribute{
ElementType: types.StringType,
Optional: true,
MarkdownDescription: "A map of headers to include in the request",
},
"query_parameters": schema.MapAttribute{
ElementType: types.ListType{
ElemType: types.StringType,
},
Optional: true,
MarkdownDescription: "A map of query parameters to include in the request",
},
},
Blocks: map[string]schema.Block{
"timeouts": timeouts.Block(ctx, timeouts.Opts{
Read: true,
}),
},
}
}