Skip to content

Commit

Permalink
Update file-api spec (strict mode support)
Browse files Browse the repository at this point in the history
  • Loading branch information
anttiviljami committed Aug 29, 2024
1 parent 6f0eb5a commit dc9dd04
Show file tree
Hide file tree
Showing 28 changed files with 584 additions and 188 deletions.
18 changes: 11 additions & 7 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: 11c8545a-deb6-44f9-ba56-e71722af6a51
management:
docChecksum: 50360e3007840627546142ce48be95c9
docChecksum: 212bd2273c9b8279042fb22bd977068a
docVersion: 0.2.0
speakeasyVersion: 1.379.0
generationVersion: 2.404.3
releaseVersion: 0.3.3
configChecksum: c252e910cbbbab187f755ef146f553aa
speakeasyVersion: 1.366.0
generationVersion: 2.396.0
releaseVersion: 0.4.0
configChecksum: 600f6651c2bf8d84881581eb2d476d86
repoURL: https://github.com/epilot-dev/terraform-provider-epilot-file.git
repoSubDirectory: .
published: true
Expand All @@ -15,12 +15,13 @@ features:
additionalDependencies: 0.1.0
additionalProperties: 0.1.2
constsAndDefaults: 0.1.4
core: 3.24.7
core: 3.24.6
deprecations: 2.81.1
envVarSecurityUsage: 0.1.0
globalSecurity: 2.81.8
globalServerURLs: 2.82.1
inputOutputModels: 2.83.0
nullables: 0.0.0
retries: 2.81.1
unions: 2.81.16
generatedFiles:
Expand Down Expand Up @@ -72,6 +73,8 @@ generatedFiles:
- internal/sdk/models/shared/fileitem.go
- internal/sdk/models/shared/s3ref.go
- internal/sdk/models/shared/filetype.go
- internal/sdk/models/shared/baseentityowner.go
- internal/sdk/models/shared/baseentityacl.go
- internal/sdk/models/shared/savefilepayload.go
- internal/sdk/models/shared/saves3filepayload.go
- internal/sdk/models/shared/filerelationitem.go
Expand Down Expand Up @@ -131,7 +134,8 @@ generatedFiles:
- main.go
- terraform-registry-manifest.json
- tools/tools.go
- internal/provider/types/acl.go
- internal/provider/types/base_entity_acl.go
- internal/provider/types/base_entity_owner.go
- internal/provider/types/s3_ref.go
- internal/provider/types/file_item.go
- USAGE.md
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ terraform {
required_providers {
epilot-file = {
source = "epilot-dev/epilot-file"
version = "0.3.3"
version = "0.4.0"
}
}
}
Expand Down Expand Up @@ -91,6 +91,12 @@ TF_REATTACH_PROVIDERS=... terraform apply
```
<!-- End SDK Example Usage [usage] -->

<!-- Start Available Resources and Operations [operations] -->
## Available Resources and Operations


<!-- End Available Resources and Operations [operations] -->

<!-- Placeholder for Future Speakeasy SDK Sections -->

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.
Expand Down
20 changes: 18 additions & 2 deletions docs/data-sources/file.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,30 @@ File DataSource

```terraform
data "epilot-file_file" "my_file" {
id = "ef7d985c-2385-44f4-9c71-ae06a52264f8"
id = "ef7d985c-2385-44f4-9c71-ae06a52264f8"
strict = true
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `strict` (Boolean) When passed true, the response will contain only fields that match the schema, with non-matching fields included in `__additional`

### Read-Only

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


<a id="nestedatt--owners"></a>
### Nested Schema for `owners`

Read-Only:

- `org_id` (String)
- `user_id` (String)


<a id="nestedatt--s3ref"></a>
### Nested Schema for `s3ref`

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ terraform {
required_providers {
epilot-file = {
source = "epilot-dev/epilot-file"
version = "0.3.3"
version = "0.4.0"
}
}
}
Expand Down
27 changes: 20 additions & 7 deletions docs/resources/file.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ resource "epilot-file_file" "my_file" {
filename = "document.pdf"
mime_type = "application/pdf"
source_url = "https://productengineer-content.s3.eu-west-1.amazonaws.com/product-engineer-checklist.pdf"
type = "unknown"
strict = true
type = "application"
}
```

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

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

### Read-Only

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

<a id="nestedatt--acl"></a>
### Nested Schema for `acl`

Optional:

- `delete` (List of String)
- `edit` (List of String)
- `view` (List of String)


<a id="nestedatt--s3ref"></a>
### Nested Schema for `s3ref`

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


<a id="nestedatt--acl"></a>
### Nested Schema for `acl`
<a id="nestedatt--owners"></a>
### Nested Schema for `owners`

Read-Only:

- `delete` (List of String)
- `edit` (List of String)
- `view` (List of String)
- `org_id` (String)
- `user_id` (String)


<a id="nestedatt--versions"></a>
Expand Down
3 changes: 2 additions & 1 deletion examples/data-sources/epilot-file_file/data-source.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
data "epilot-file_file" "my_file" {
id = "ef7d985c-2385-44f4-9c71-ae06a52264f8"
id = "ef7d985c-2385-44f4-9c71-ae06a52264f8"
strict = true
}
2 changes: 1 addition & 1 deletion examples/provider/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
epilot-file = {
source = "epilot-dev/epilot-file"
version = "0.3.3"
version = "0.4.0"
}
}
}
Expand Down
12 changes: 10 additions & 2 deletions examples/resources/epilot-file_file-import/generated_resources.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,24 @@

# __generated__ by Terraform from "91b9fd89-05ac-464d-8ac5-1379824471ac"
resource "epilot-file_file" "my_file" {
access_control = "private"
access_control = "private"
acl = {
delete = ["org_739224"]
edit = ["org_739224"]
view = ["org_739224"]
}
additional = null
custom_download_url = null
filename = "8z87al.jpg"
mime_type = "image/jpeg"
purpose = []
s3ref = {
bucket = "epilot-dev-user-content"
key = "739224/69f04890-fa8d-4d2e-9347-4ac384da107b/8z87al.jpg"
}
source_url = "https://file.dev.sls.epilot.io/v1/files/public/links/739224-taqDBUyNjSX7c_n2v6Zvv/8z87al.jpg"
tags = null
strict = null
tags = []
title = "8z87al.jpg"
type = "image"
}
45 changes: 12 additions & 33 deletions examples/resources/epilot-file_file-import/resource.tf
Original file line number Diff line number Diff line change
@@ -1,38 +1,17 @@
# import {
# to = epilot-file_file.my_file
# id = "91b9fd89-05ac-464d-8ac5-1379824471ac"
# }
import {
to = epilot-file_file.my_file
id = "91b9fd89-05ac-464d-8ac5-1379824471ac"
}

# resource "epilot-file_file" "my_file" {
# }

# epilot-file_file.my_file:
resource "epilot-file_file" "my_file" {
access_control = "private"
filename = "8z87al.jpg"
mime_type = "image/jpeg"
source_url = "https://file.dev.sls.epilot.io/v1/files/public/links/739224-taqDBUyNjSX7c_n2v6Zvv/8z87al.jpg"
title = "8z87al.jpg"
type = "image"
}

terraform {
required_providers {
epilot-file = {
source = "epilot-dev/epilot-file"
version = "2.1.1"
}
}
}

variable "epilot_auth" {
type = string
description = "epilot_auth"
}


provider "epilot-file" {
# Configuration options
epilot_auth = var.epilot_auth
server_url = "https://file.dev.sls.epilot.io"
}
# resource "epilot-file_file" "my_file" {
# access_control = "private"
# filename = "8z87al.jpg"
# mime_type = "image/jpeg"
# source_url = "https://file.dev.sls.epilot.io/v1/files/public/links/739224-taqDBUyNjSX7c_n2v6Zvv/8z87al.jpg"
# title = "8z87al.jpg"
# type = "image"
# }
3 changes: 2 additions & 1 deletion examples/resources/epilot-file_file/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ resource "epilot-file_file" "my_file" {
filename = "document.pdf"
mime_type = "application/pdf"
source_url = "https://productengineer-content.s3.eu-west-1.amazonaws.com/product-engineer-checklist.pdf"
type = "unknown"
strict = true
type = "application"
}
2 changes: 1 addition & 1 deletion gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ go:
outputModelSuffix: output
packageName: openapi
terraform:
version: 0.3.3
version: 0.4.0
additionalDataSources: []
additionalDependencies: {}
additionalResources: []
Expand Down
Loading

0 comments on commit dc9dd04

Please sign in to comment.