/
getExport.go
161 lines (138 loc) · 6.35 KB
/
getExport.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
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package apigateway
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/apigateway"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := apigateway.GetExport(ctx, &apigateway.GetExportArgs{
// RestApiId: aws_api_gateway_stage.Example.Rest_api_id,
// StageName: aws_api_gateway_stage.Example.Stage_name,
// ExportType: "oas30",
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
func GetExport(ctx *pulumi.Context, args *GetExportArgs, opts ...pulumi.InvokeOption) (*GetExportResult, error) {
var rv GetExportResult
err := ctx.Invoke("aws:apigateway/getExport:getExport", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getExport.
type GetExportArgs struct {
// The content-type of the export. Valid values are `application/json` and `application/yaml` are supported for `exportType` `ofoas30` and `swagger`.
Accepts *string `pulumi:"accepts"`
// The type of export. Acceptable values are `oas30` for OpenAPI 3.0.x and `swagger` for Swagger/OpenAPI 2.0.
ExportType string `pulumi:"exportType"`
// A key-value map of query string parameters that specify properties of the export. the following parameters are supported: `extensions='integrations'` or `extensions='apigateway'` will export the API with x-amazon-apigateway-integration extensions. `extensions='authorizers'` will export the API with x-amazon-apigateway-authorizer extensions.
Parameters map[string]string `pulumi:"parameters"`
// The identifier of the associated REST API.
RestApiId string `pulumi:"restApiId"`
// The name of the Stage that will be exported.
StageName string `pulumi:"stageName"`
}
// A collection of values returned by getExport.
type GetExportResult struct {
Accepts *string `pulumi:"accepts"`
// The API Spec.
Body string `pulumi:"body"`
// The content-disposition header value in the HTTP response.
ContentDisposition string `pulumi:"contentDisposition"`
// The content-type header value in the HTTP response.
ContentType string `pulumi:"contentType"`
ExportType string `pulumi:"exportType"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
Parameters map[string]string `pulumi:"parameters"`
RestApiId string `pulumi:"restApiId"`
StageName string `pulumi:"stageName"`
}
func GetExportOutput(ctx *pulumi.Context, args GetExportOutputArgs, opts ...pulumi.InvokeOption) GetExportResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetExportResult, error) {
args := v.(GetExportArgs)
r, err := GetExport(ctx, &args, opts...)
return *r, err
}).(GetExportResultOutput)
}
// A collection of arguments for invoking getExport.
type GetExportOutputArgs struct {
// The content-type of the export. Valid values are `application/json` and `application/yaml` are supported for `exportType` `ofoas30` and `swagger`.
Accepts pulumi.StringPtrInput `pulumi:"accepts"`
// The type of export. Acceptable values are `oas30` for OpenAPI 3.0.x and `swagger` for Swagger/OpenAPI 2.0.
ExportType pulumi.StringInput `pulumi:"exportType"`
// A key-value map of query string parameters that specify properties of the export. the following parameters are supported: `extensions='integrations'` or `extensions='apigateway'` will export the API with x-amazon-apigateway-integration extensions. `extensions='authorizers'` will export the API with x-amazon-apigateway-authorizer extensions.
Parameters pulumi.StringMapInput `pulumi:"parameters"`
// The identifier of the associated REST API.
RestApiId pulumi.StringInput `pulumi:"restApiId"`
// The name of the Stage that will be exported.
StageName pulumi.StringInput `pulumi:"stageName"`
}
func (GetExportOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetExportArgs)(nil)).Elem()
}
// A collection of values returned by getExport.
type GetExportResultOutput struct{ *pulumi.OutputState }
func (GetExportResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetExportResult)(nil)).Elem()
}
func (o GetExportResultOutput) ToGetExportResultOutput() GetExportResultOutput {
return o
}
func (o GetExportResultOutput) ToGetExportResultOutputWithContext(ctx context.Context) GetExportResultOutput {
return o
}
func (o GetExportResultOutput) Accepts() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetExportResult) *string { return v.Accepts }).(pulumi.StringPtrOutput)
}
// The API Spec.
func (o GetExportResultOutput) Body() pulumi.StringOutput {
return o.ApplyT(func(v GetExportResult) string { return v.Body }).(pulumi.StringOutput)
}
// The content-disposition header value in the HTTP response.
func (o GetExportResultOutput) ContentDisposition() pulumi.StringOutput {
return o.ApplyT(func(v GetExportResult) string { return v.ContentDisposition }).(pulumi.StringOutput)
}
// The content-type header value in the HTTP response.
func (o GetExportResultOutput) ContentType() pulumi.StringOutput {
return o.ApplyT(func(v GetExportResult) string { return v.ContentType }).(pulumi.StringOutput)
}
func (o GetExportResultOutput) ExportType() pulumi.StringOutput {
return o.ApplyT(func(v GetExportResult) string { return v.ExportType }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o GetExportResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetExportResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o GetExportResultOutput) Parameters() pulumi.StringMapOutput {
return o.ApplyT(func(v GetExportResult) map[string]string { return v.Parameters }).(pulumi.StringMapOutput)
}
func (o GetExportResultOutput) RestApiId() pulumi.StringOutput {
return o.ApplyT(func(v GetExportResult) string { return v.RestApiId }).(pulumi.StringOutput)
}
func (o GetExportResultOutput) StageName() pulumi.StringOutput {
return o.ApplyT(func(v GetExportResult) string { return v.StageName }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(GetExportResultOutput{})
}