feat: implement activity resource and data source
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
---
|
||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
||||
page_title: "immich_activities Data Source - terraform-provider-immich"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
Retrieves a list of activities for an album or asset.
|
||||
---
|
||||
|
||||
# immich_activities (Data Source)
|
||||
|
||||
Retrieves a list of activities for an album or asset.
|
||||
|
||||
## Example Usage
|
||||
|
||||
```terraform
|
||||
data "immich_activities" "album_activities" {
|
||||
album_id = "your-album-uuid"
|
||||
}
|
||||
|
||||
output "all_comments" {
|
||||
value = [for a in data.immich_activities.album_activities.activities : a.comment if a.type == "COMMENT"]
|
||||
}
|
||||
|
||||
output "like_count" {
|
||||
value = length([for a in data.immich_activities.album_activities.activities : a if a.type == "LIKE"])
|
||||
}
|
||||
```
|
||||
|
||||
<!-- schema generated by tfplugindocs -->
|
||||
## Schema
|
||||
|
||||
### Required
|
||||
|
||||
- `album_id` (String) ID of the album.
|
||||
|
||||
### Optional
|
||||
|
||||
- `asset_id` (String) ID of the asset.
|
||||
|
||||
### Read-Only
|
||||
|
||||
- `activities` (Attributes List) List of activities. (see [below for nested schema](#nestedatt--activities))
|
||||
|
||||
<a id="nestedatt--activities"></a>
|
||||
### Nested Schema for `activities`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `comment` (String) Comment text.
|
||||
- `created_at` (String) Timestamp when the activity was created.
|
||||
- `id` (String) Unique identifier for the activity.
|
||||
- `type` (String) Type of activity (COMMENT or LIKE).
|
||||
- `user_id` (String) ID of the user who performed the activity.
|
||||
@@ -0,0 +1,46 @@
|
||||
---
|
||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
||||
page_title: "immich_activity Resource - terraform-provider-immich"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
Manages an Immich activity (comment or like).
|
||||
---
|
||||
|
||||
# immich_activity (Resource)
|
||||
|
||||
Manages an Immich activity (comment or like).
|
||||
|
||||
## Example Usage
|
||||
|
||||
```terraform
|
||||
resource "immich_activity" "album_comment" {
|
||||
album_id = "your-album-uuid"
|
||||
type = "comment"
|
||||
comment = "This is a great album!"
|
||||
}
|
||||
|
||||
resource "immich_activity" "asset_like" {
|
||||
album_id = "your-album-uuid"
|
||||
asset_id = "your-asset-uuid"
|
||||
type = "like"
|
||||
}
|
||||
```
|
||||
|
||||
<!-- schema generated by tfplugindocs -->
|
||||
## Schema
|
||||
|
||||
### Required
|
||||
|
||||
- `album_id` (String) ID of the album.
|
||||
- `type` (String) Type of activity (comment or like).
|
||||
|
||||
### Optional
|
||||
|
||||
- `asset_id` (String) ID of the asset.
|
||||
- `comment` (String) Comment text (required for type 'comment').
|
||||
|
||||
### Read-Only
|
||||
|
||||
- `created_at` (String) Timestamp when the activity was created.
|
||||
- `id` (String) Unique identifier for the activity.
|
||||
- `user_id` (String) ID of the user who performed the activity.
|
||||
Reference in New Issue
Block a user