-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathexplorer.go
More file actions
56 lines (47 loc) · 1.49 KB
/
explorer.go
File metadata and controls
56 lines (47 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Copyright IBM Corp. 2023, 2026
// SPDX-License-Identifier: MPL-2.0
package explorer
import (
"github.com/pb33f/libopenapi/datamodel/high/base"
high "github.com/pb33f/libopenapi/datamodel/high/v3"
)
// Explorer implements methods that relate OpenAPI operations to a set of Terraform Provider resource/data source actions (CRUD)
type Explorer interface {
FindProvider() (Provider, error)
FindResources() (map[string]Resource, error)
FindDataSources() (map[string]DataSource, error)
}
// Resource contains CRUD operations and schema options for configuration.
type Resource struct {
CreateOp *high.Operation
ReadOp *high.Operation
UpdateOp *high.Operation
DeleteOp *high.Operation
CommonParameters []*high.Parameter
SchemaOptions SchemaOptions
Description string // Resource-level description from OpenAPI tags
}
// DataSource contains a Read operation and schema options for configuration.
type DataSource struct {
ReadOp *high.Operation
CommonParameters []*high.Parameter
SchemaOptions SchemaOptions
Description string // DataSource-level description from OpenAPI tags
}
// Provider contains a name and a schema.
type Provider struct {
Name string
SchemaProxy *base.SchemaProxy
Ignores []string
}
type SchemaOptions struct {
Ignores []string
AttributeOptions AttributeOptions
}
type AttributeOptions struct {
Aliases map[string]string
Overrides map[string]Override
}
type Override struct {
Description string
}