generated from hashicorp/terraform-provider-scaffolding
/
documentation_part_singular_data_source_gen.go
168 lines (155 loc) · 9.49 KB
/
documentation_part_singular_data_source_gen.go
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
// Code generated by generators/singular-data-source/main.go; DO NOT EDIT.
package apigateway
import (
"context"
"github.com/hashicorp/terraform-plugin-framework/datasource"
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
"github.com/hashicorp/terraform-provider-awscc/internal/generic"
"github.com/hashicorp/terraform-provider-awscc/internal/registry"
)
func init() {
registry.AddDataSourceFactory("awscc_apigateway_documentation_part", documentationPartDataSource)
}
// documentationPartDataSource returns the Terraform awscc_apigateway_documentation_part data source.
// This Terraform data source corresponds to the CloudFormation AWS::ApiGateway::DocumentationPart resource.
func documentationPartDataSource(ctx context.Context) (datasource.DataSource, error) {
attributes := map[string]schema.Attribute{ /*START SCHEMA*/
// Property: DocumentationPartId
// CloudFormation resource type schema:
//
// {
// "description": "",
// "type": "string"
// }
"documentation_part_id": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Location
// CloudFormation resource type schema:
//
// {
// "additionalProperties": false,
// "description": "The location of the targeted API entity of the to-be-created documentation part.",
// "properties": {
// "Method": {
// "description": "The HTTP verb of a method. It is a valid field for the API entity types of ``METHOD``, ``PATH_PARAMETER``, ``QUERY_PARAMETER``, ``REQUEST_HEADER``, ``REQUEST_BODY``, ``RESPONSE``, ``RESPONSE_HEADER``, and ``RESPONSE_BODY``. The default value is ``*`` for any method. When an applicable child entity inherits the content of an entity of the same type with more general specifications of the other ``location`` attributes, the child entity's ``method`` attribute must match that of the parent entity exactly.",
// "type": "string"
// },
// "Name": {
// "description": "The name of the targeted API entity. It is a valid and required field for the API entity types of ``AUTHORIZER``, ``MODEL``, ``PATH_PARAMETER``, ``QUERY_PARAMETER``, ``REQUEST_HEADER``, ``REQUEST_BODY`` and ``RESPONSE_HEADER``. It is an invalid field for any other entity type.",
// "type": "string"
// },
// "Path": {
// "description": "The URL path of the target. It is a valid field for the API entity types of ``RESOURCE``, ``METHOD``, ``PATH_PARAMETER``, ``QUERY_PARAMETER``, ``REQUEST_HEADER``, ``REQUEST_BODY``, ``RESPONSE``, ``RESPONSE_HEADER``, and ``RESPONSE_BODY``. The default value is ``/`` for the root resource. When an applicable child entity inherits the content of another entity of the same type with more general specifications of the other ``location`` attributes, the child entity's ``path`` attribute must match that of the parent entity as a prefix.",
// "type": "string"
// },
// "StatusCode": {
// "description": "The HTTP status code of a response. It is a valid field for the API entity types of ``RESPONSE``, ``RESPONSE_HEADER``, and ``RESPONSE_BODY``. The default value is ``*`` for any status code. When an applicable child entity inherits the content of an entity of the same type with more general specifications of the other ``location`` attributes, the child entity's ``statusCode`` attribute must match that of the parent entity exactly.",
// "type": "string"
// },
// "Type": {
// "description": "The type of API entity to which the documentation content applies. Valid values are ``API``, ``AUTHORIZER``, ``MODEL``, ``RESOURCE``, ``METHOD``, ``PATH_PARAMETER``, ``QUERY_PARAMETER``, ``REQUEST_HEADER``, ``REQUEST_BODY``, ``RESPONSE``, ``RESPONSE_HEADER``, and ``RESPONSE_BODY``. Content inheritance does not apply to any entity of the ``API``, ``AUTHORIZER``, ``METHOD``, ``MODEL``, ``REQUEST_BODY``, or ``RESOURCE`` type.",
// "enum": [
// "API",
// "AUTHORIZER",
// "MODEL",
// "RESOURCE",
// "METHOD",
// "PATH_PARAMETER",
// "QUERY_PARAMETER",
// "REQUEST_HEADER",
// "REQUEST_BODY",
// "RESPONSE",
// "RESPONSE_HEADER",
// "RESPONSE_BODY"
// ],
// "type": "string"
// }
// },
// "type": "object"
// }
"location": schema.SingleNestedAttribute{ /*START ATTRIBUTE*/
Attributes: map[string]schema.Attribute{ /*START SCHEMA*/
// Property: Method
"method": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The HTTP verb of a method. It is a valid field for the API entity types of ``METHOD``, ``PATH_PARAMETER``, ``QUERY_PARAMETER``, ``REQUEST_HEADER``, ``REQUEST_BODY``, ``RESPONSE``, ``RESPONSE_HEADER``, and ``RESPONSE_BODY``. The default value is ``*`` for any method. When an applicable child entity inherits the content of an entity of the same type with more general specifications of the other ``location`` attributes, the child entity's ``method`` attribute must match that of the parent entity exactly.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Name
"name": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The name of the targeted API entity. It is a valid and required field for the API entity types of ``AUTHORIZER``, ``MODEL``, ``PATH_PARAMETER``, ``QUERY_PARAMETER``, ``REQUEST_HEADER``, ``REQUEST_BODY`` and ``RESPONSE_HEADER``. It is an invalid field for any other entity type.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Path
"path": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The URL path of the target. It is a valid field for the API entity types of ``RESOURCE``, ``METHOD``, ``PATH_PARAMETER``, ``QUERY_PARAMETER``, ``REQUEST_HEADER``, ``REQUEST_BODY``, ``RESPONSE``, ``RESPONSE_HEADER``, and ``RESPONSE_BODY``. The default value is ``/`` for the root resource. When an applicable child entity inherits the content of another entity of the same type with more general specifications of the other ``location`` attributes, the child entity's ``path`` attribute must match that of the parent entity as a prefix.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: StatusCode
"status_code": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The HTTP status code of a response. It is a valid field for the API entity types of ``RESPONSE``, ``RESPONSE_HEADER``, and ``RESPONSE_BODY``. The default value is ``*`` for any status code. When an applicable child entity inherits the content of an entity of the same type with more general specifications of the other ``location`` attributes, the child entity's ``statusCode`` attribute must match that of the parent entity exactly.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Type
"type": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The type of API entity to which the documentation content applies. Valid values are ``API``, ``AUTHORIZER``, ``MODEL``, ``RESOURCE``, ``METHOD``, ``PATH_PARAMETER``, ``QUERY_PARAMETER``, ``REQUEST_HEADER``, ``REQUEST_BODY``, ``RESPONSE``, ``RESPONSE_HEADER``, and ``RESPONSE_BODY``. Content inheritance does not apply to any entity of the ``API``, ``AUTHORIZER``, ``METHOD``, ``MODEL``, ``REQUEST_BODY``, or ``RESOURCE`` type.",
Computed: true,
}, /*END ATTRIBUTE*/
}, /*END SCHEMA*/
Description: "The location of the targeted API entity of the to-be-created documentation part.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: Properties
// CloudFormation resource type schema:
//
// {
// "description": "The new documentation content map of the targeted API entity. Enclosed key-value pairs are API-specific, but only OpenAPI-compliant key-value pairs can be exported and, hence, published.",
// "type": "string"
// }
"properties": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The new documentation content map of the targeted API entity. Enclosed key-value pairs are API-specific, but only OpenAPI-compliant key-value pairs can be exported and, hence, published.",
Computed: true,
}, /*END ATTRIBUTE*/
// Property: RestApiId
// CloudFormation resource type schema:
//
// {
// "description": "The string identifier of the associated RestApi.",
// "type": "string"
// }
"rest_api_id": schema.StringAttribute{ /*START ATTRIBUTE*/
Description: "The string identifier of the associated RestApi.",
Computed: true,
}, /*END ATTRIBUTE*/
} /*END SCHEMA*/
attributes["id"] = schema.StringAttribute{
Description: "Uniquely identifies the resource.",
Required: true,
}
schema := schema.Schema{
Description: "Data Source schema for AWS::ApiGateway::DocumentationPart",
Attributes: attributes,
}
var opts generic.DataSourceOptions
opts = opts.WithCloudFormationTypeName("AWS::ApiGateway::DocumentationPart").WithTerraformTypeName("awscc_apigateway_documentation_part")
opts = opts.WithTerraformSchema(schema)
opts = opts.WithAttributeNameMap(map[string]string{
"documentation_part_id": "DocumentationPartId",
"location": "Location",
"method": "Method",
"name": "Name",
"path": "Path",
"properties": "Properties",
"rest_api_id": "RestApiId",
"status_code": "StatusCode",
"type": "Type",
})
v, err := generic.NewSingularDataSource(ctx, opts...)
if err != nil {
return nil, err
}
return v, nil
}