Skip to content

Commit dc9dd04

Browse files
committed
Update file-api spec (strict mode support)
1 parent 6f0eb5a commit dc9dd04

File tree

28 files changed

+584
-188
lines changed

28 files changed

+584
-188
lines changed

.speakeasy/gen.lock

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
lockVersion: 2.0.0
22
id: 11c8545a-deb6-44f9-ba56-e71722af6a51
33
management:
4-
docChecksum: 50360e3007840627546142ce48be95c9
4+
docChecksum: 212bd2273c9b8279042fb22bd977068a
55
docVersion: 0.2.0
6-
speakeasyVersion: 1.379.0
7-
generationVersion: 2.404.3
8-
releaseVersion: 0.3.3
9-
configChecksum: c252e910cbbbab187f755ef146f553aa
6+
speakeasyVersion: 1.366.0
7+
generationVersion: 2.396.0
8+
releaseVersion: 0.4.0
9+
configChecksum: 600f6651c2bf8d84881581eb2d476d86
1010
repoURL: https://github.com/epilot-dev/terraform-provider-epilot-file.git
1111
repoSubDirectory: .
1212
published: true
@@ -15,12 +15,13 @@ features:
1515
additionalDependencies: 0.1.0
1616
additionalProperties: 0.1.2
1717
constsAndDefaults: 0.1.4
18-
core: 3.24.7
18+
core: 3.24.6
1919
deprecations: 2.81.1
2020
envVarSecurityUsage: 0.1.0
2121
globalSecurity: 2.81.8
2222
globalServerURLs: 2.82.1
2323
inputOutputModels: 2.83.0
24+
nullables: 0.0.0
2425
retries: 2.81.1
2526
unions: 2.81.16
2627
generatedFiles:
@@ -72,6 +73,8 @@ generatedFiles:
7273
- internal/sdk/models/shared/fileitem.go
7374
- internal/sdk/models/shared/s3ref.go
7475
- internal/sdk/models/shared/filetype.go
76+
- internal/sdk/models/shared/baseentityowner.go
77+
- internal/sdk/models/shared/baseentityacl.go
7578
- internal/sdk/models/shared/savefilepayload.go
7679
- internal/sdk/models/shared/saves3filepayload.go
7780
- internal/sdk/models/shared/filerelationitem.go
@@ -131,7 +134,8 @@ generatedFiles:
131134
- main.go
132135
- terraform-registry-manifest.json
133136
- tools/tools.go
134-
- internal/provider/types/acl.go
137+
- internal/provider/types/base_entity_acl.go
138+
- internal/provider/types/base_entity_owner.go
135139
- internal/provider/types/s3_ref.go
136140
- internal/provider/types/file_item.go
137141
- USAGE.md

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ terraform {
5959
required_providers {
6060
epilot-file = {
6161
source = "epilot-dev/epilot-file"
62-
version = "0.3.3"
62+
version = "0.4.0"
6363
}
6464
}
6565
}
@@ -91,6 +91,12 @@ TF_REATTACH_PROVIDERS=... terraform apply
9191
```
9292
<!-- End SDK Example Usage [usage] -->
9393

94+
<!-- Start Available Resources and Operations [operations] -->
95+
## Available Resources and Operations
96+
97+
98+
<!-- End Available Resources and Operations [operations] -->
99+
94100
<!-- Placeholder for Future Speakeasy SDK Sections -->
95101

96102
Terraform allows you to use local provider builds by setting a `dev_overrides` block in a configuration file called `.terraformrc`. This block overrides all other configured installation methods.

docs/data-sources/file.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,30 @@ File DataSource
1414

1515
```terraform
1616
data "epilot-file_file" "my_file" {
17-
id = "ef7d985c-2385-44f4-9c71-ae06a52264f8"
17+
id = "ef7d985c-2385-44f4-9c71-ae06a52264f8"
18+
strict = true
1819
}
1920
```
2021

2122
<!-- schema generated by tfplugindocs -->
2223
## Schema
2324

25+
### Optional
26+
27+
- `strict` (Boolean) When passed true, the response will contain only fields that match the schema, with non-matching fields included in `__additional`
28+
2429
### Read-Only
2530

2631
- `access_control` (String) must be one of ["private", "public-read"]
27-
- `acl` (Attributes) Access control list for file entity (readonly) (see [below for nested schema](#nestedatt--acl))
32+
- `acl` (Attributes) Access control list (ACL) for an entity. Defines sharing access to external orgs or users. (see [below for nested schema](#nestedatt--acl))
33+
- `additional` (Map of String) Additional fields that are not part of the schema
2834
- `created_at` (String)
2935
- `custom_download_url` (String) Custom external download url used for the file
3036
- `filename` (String)
3137
- `id` (String) The ID of this resource.
3238
- `mime_type` (String) MIME type of the file
3339
- `org` (String)
40+
- `owners` (Attributes List) (see [below for nested schema](#nestedatt--owners))
3441
- `public_url` (String) Direct URL for file (public only if file access control is public-read)
3542
- `purpose` (List of String)
3643
- `readable_size` (String) Human readable file size
@@ -54,6 +61,15 @@ Read-Only:
5461
- `view` (List of String)
5562

5663

64+
<a id="nestedatt--owners"></a>
65+
### Nested Schema for `owners`
66+
67+
Read-Only:
68+
69+
- `org_id` (String)
70+
- `user_id` (String)
71+
72+
5773
<a id="nestedatt--s3ref"></a>
5874
### Nested Schema for `s3ref`
5975

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ terraform {
1717
required_providers {
1818
epilot-file = {
1919
source = "epilot-dev/epilot-file"
20-
version = "0.3.3"
20+
version = "0.4.0"
2121
}
2222
}
2323
}

docs/resources/file.md

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ resource "epilot-file_file" "my_file" {
2121
filename = "document.pdf"
2222
mime_type = "application/pdf"
2323
source_url = "https://productengineer-content.s3.eu-west-1.amazonaws.com/product-engineer-checklist.pdf"
24-
type = "unknown"
24+
strict = true
25+
type = "application"
2526
}
2627
```
2728

@@ -31,29 +32,42 @@ resource "epilot-file_file" "my_file" {
3132
### Optional
3233

3334
- `access_control` (String) must be one of ["private", "public-read"]; Default: "private"
35+
- `acl` (Attributes) Access control list (ACL) for an entity. Defines sharing access to external orgs or users. (see [below for nested schema](#nestedatt--acl))
36+
- `additional` (Map of String) Additional fields that are not part of the schema
3437
- `custom_download_url` (String) Custom external download url used for the file
3538
- `filename` (String)
3639
- `mime_type` (String) MIME type of the file
3740
- `purpose` (List of String)
3841
- `s3ref` (Attributes) (see [below for nested schema](#nestedatt--s3ref))
3942
- `source_url` (String) Source URL for the file. Included if the entity was created from source_url, or when ?source_url=true
43+
- `strict` (Boolean) When passed true, the response will contain only fields that match the schema, with non-matching fields included in `__additional`. Default: false
4044
- `tags` (List of String)
4145
- `title` (String)
4246
- `type` (String) must be one of ["document", "document_template", "text", "image", "video", "audio", "spreadsheet", "presentation", "font", "archive", "application", "unknown"]
4347

4448
### Read-Only
4549

46-
- `acl` (Attributes) Access control list for file entity (readonly) (see [below for nested schema](#nestedatt--acl))
4750
- `created_at` (String)
4851
- `id` (String) The ID of this resource.
4952
- `org` (String)
53+
- `owners` (Attributes List) (see [below for nested schema](#nestedatt--owners))
5054
- `public_url` (String) Direct URL for file (public only if file access control is public-read)
5155
- `readable_size` (String) Human readable file size
5256
- `schema` (String) must be one of ["file"]
5357
- `size_bytes` (Number) File size in bytes
5458
- `updated_at` (String)
5559
- `versions` (Attributes List) (see [below for nested schema](#nestedatt--versions))
5660

61+
<a id="nestedatt--acl"></a>
62+
### Nested Schema for `acl`
63+
64+
Optional:
65+
66+
- `delete` (List of String)
67+
- `edit` (List of String)
68+
- `view` (List of String)
69+
70+
5771
<a id="nestedatt--s3ref"></a>
5872
### Nested Schema for `s3ref`
5973

@@ -63,14 +77,13 @@ Optional:
6377
- `key` (String) Not Null
6478

6579

66-
<a id="nestedatt--acl"></a>
67-
### Nested Schema for `acl`
80+
<a id="nestedatt--owners"></a>
81+
### Nested Schema for `owners`
6882

6983
Read-Only:
7084

71-
- `delete` (List of String)
72-
- `edit` (List of String)
73-
- `view` (List of String)
85+
- `org_id` (String)
86+
- `user_id` (String)
7487

7588

7689
<a id="nestedatt--versions"></a>
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
data "epilot-file_file" "my_file" {
2-
id = "ef7d985c-2385-44f4-9c71-ae06a52264f8"
2+
id = "ef7d985c-2385-44f4-9c71-ae06a52264f8"
3+
strict = true
34
}

examples/provider/provider.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_providers {
33
epilot-file = {
44
source = "epilot-dev/epilot-file"
5-
version = "0.3.3"
5+
version = "0.4.0"
66
}
77
}
88
}

examples/resources/epilot-file_file-import/generated_resources.tf

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,24 @@
33

44
# __generated__ by Terraform from "91b9fd89-05ac-464d-8ac5-1379824471ac"
55
resource "epilot-file_file" "my_file" {
6-
access_control = "private"
6+
access_control = "private"
7+
acl = {
8+
delete = ["org_739224"]
9+
edit = ["org_739224"]
10+
view = ["org_739224"]
11+
}
12+
additional = null
713
custom_download_url = null
814
filename = "8z87al.jpg"
915
mime_type = "image/jpeg"
16+
purpose = []
1017
s3ref = {
1118
bucket = "epilot-dev-user-content"
1219
key = "739224/69f04890-fa8d-4d2e-9347-4ac384da107b/8z87al.jpg"
1320
}
1421
source_url = "https://file.dev.sls.epilot.io/v1/files/public/links/739224-taqDBUyNjSX7c_n2v6Zvv/8z87al.jpg"
15-
tags = null
22+
strict = null
23+
tags = []
1624
title = "8z87al.jpg"
1725
type = "image"
1826
}
Lines changed: 12 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,17 @@
1-
# import {
2-
# to = epilot-file_file.my_file
3-
# id = "91b9fd89-05ac-464d-8ac5-1379824471ac"
4-
# }
1+
import {
2+
to = epilot-file_file.my_file
3+
id = "91b9fd89-05ac-464d-8ac5-1379824471ac"
4+
}
55

66
# resource "epilot-file_file" "my_file" {
77
# }
88

99
# epilot-file_file.my_file:
10-
resource "epilot-file_file" "my_file" {
11-
access_control = "private"
12-
filename = "8z87al.jpg"
13-
mime_type = "image/jpeg"
14-
source_url = "https://file.dev.sls.epilot.io/v1/files/public/links/739224-taqDBUyNjSX7c_n2v6Zvv/8z87al.jpg"
15-
title = "8z87al.jpg"
16-
type = "image"
17-
}
18-
19-
terraform {
20-
required_providers {
21-
epilot-file = {
22-
source = "epilot-dev/epilot-file"
23-
version = "2.1.1"
24-
}
25-
}
26-
}
27-
28-
variable "epilot_auth" {
29-
type = string
30-
description = "epilot_auth"
31-
}
32-
33-
34-
provider "epilot-file" {
35-
# Configuration options
36-
epilot_auth = var.epilot_auth
37-
server_url = "https://file.dev.sls.epilot.io"
38-
}
10+
# resource "epilot-file_file" "my_file" {
11+
# access_control = "private"
12+
# filename = "8z87al.jpg"
13+
# mime_type = "image/jpeg"
14+
# source_url = "https://file.dev.sls.epilot.io/v1/files/public/links/739224-taqDBUyNjSX7c_n2v6Zvv/8z87al.jpg"
15+
# title = "8z87al.jpg"
16+
# type = "image"
17+
# }

examples/resources/epilot-file_file/resource.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ resource "epilot-file_file" "my_file" {
66
filename = "document.pdf"
77
mime_type = "application/pdf"
88
source_url = "https://productengineer-content.s3.eu-west-1.amazonaws.com/product-engineer-checklist.pdf"
9-
type = "unknown"
9+
strict = true
10+
type = "application"
1011
}

0 commit comments

Comments
 (0)