github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/apigatewayv2/getExport.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package apigatewayv2 5 6 import ( 7 "context" 8 "reflect" 9 10 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 // Exports a definition of an API in a particular output format and specification. 15 // 16 // ## Example Usage 17 // 18 // <!--Start PulumiCodeChooser --> 19 // ```go 20 // package main 21 // 22 // import ( 23 // 24 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigatewayv2" 25 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 26 // 27 // ) 28 // 29 // func main() { 30 // pulumi.Run(func(ctx *pulumi.Context) error { 31 // _, err := apigatewayv2.GetExport(ctx, &apigatewayv2.GetExportArgs{ 32 // ApiId: testAwsApigatewayv2Route.ApiId, 33 // Specification: "OAS30", 34 // OutputType: "JSON", 35 // }, nil) 36 // if err != nil { 37 // return err 38 // } 39 // return nil 40 // }) 41 // } 42 // 43 // ``` 44 // <!--End PulumiCodeChooser --> 45 func GetExport(ctx *pulumi.Context, args *GetExportArgs, opts ...pulumi.InvokeOption) (*GetExportResult, error) { 46 opts = internal.PkgInvokeDefaultOpts(opts) 47 var rv GetExportResult 48 err := ctx.Invoke("aws:apigatewayv2/getExport:getExport", args, &rv, opts...) 49 if err != nil { 50 return nil, err 51 } 52 return &rv, nil 53 } 54 55 // A collection of arguments for invoking getExport. 56 type GetExportArgs struct { 57 // API identifier. 58 ApiId string `pulumi:"apiId"` 59 // Version of the API Gateway export algorithm. API Gateway uses the latest version by default. Currently, the only supported version is `1.0`. 60 ExportVersion *string `pulumi:"exportVersion"` 61 // Whether to include API Gateway extensions in the exported API definition. API Gateway extensions are included by default. 62 IncludeExtensions *bool `pulumi:"includeExtensions"` 63 // Output type of the exported definition file. Valid values are `JSON` and `YAML`. 64 OutputType string `pulumi:"outputType"` 65 // Version of the API specification to use. `OAS30`, for OpenAPI 3.0, is the only supported value. 66 Specification string `pulumi:"specification"` 67 // Name of the API stage to export. If you don't specify this property, a representation of the latest API configuration is exported. 68 StageName *string `pulumi:"stageName"` 69 } 70 71 // A collection of values returned by getExport. 72 type GetExportResult struct { 73 ApiId string `pulumi:"apiId"` 74 // ID of the API. 75 Body string `pulumi:"body"` 76 ExportVersion *string `pulumi:"exportVersion"` 77 // The provider-assigned unique ID for this managed resource. 78 Id string `pulumi:"id"` 79 IncludeExtensions *bool `pulumi:"includeExtensions"` 80 OutputType string `pulumi:"outputType"` 81 Specification string `pulumi:"specification"` 82 StageName *string `pulumi:"stageName"` 83 } 84 85 func GetExportOutput(ctx *pulumi.Context, args GetExportOutputArgs, opts ...pulumi.InvokeOption) GetExportResultOutput { 86 return pulumi.ToOutputWithContext(context.Background(), args). 87 ApplyT(func(v interface{}) (GetExportResult, error) { 88 args := v.(GetExportArgs) 89 r, err := GetExport(ctx, &args, opts...) 90 var s GetExportResult 91 if r != nil { 92 s = *r 93 } 94 return s, err 95 }).(GetExportResultOutput) 96 } 97 98 // A collection of arguments for invoking getExport. 99 type GetExportOutputArgs struct { 100 // API identifier. 101 ApiId pulumi.StringInput `pulumi:"apiId"` 102 // Version of the API Gateway export algorithm. API Gateway uses the latest version by default. Currently, the only supported version is `1.0`. 103 ExportVersion pulumi.StringPtrInput `pulumi:"exportVersion"` 104 // Whether to include API Gateway extensions in the exported API definition. API Gateway extensions are included by default. 105 IncludeExtensions pulumi.BoolPtrInput `pulumi:"includeExtensions"` 106 // Output type of the exported definition file. Valid values are `JSON` and `YAML`. 107 OutputType pulumi.StringInput `pulumi:"outputType"` 108 // Version of the API specification to use. `OAS30`, for OpenAPI 3.0, is the only supported value. 109 Specification pulumi.StringInput `pulumi:"specification"` 110 // Name of the API stage to export. If you don't specify this property, a representation of the latest API configuration is exported. 111 StageName pulumi.StringPtrInput `pulumi:"stageName"` 112 } 113 114 func (GetExportOutputArgs) ElementType() reflect.Type { 115 return reflect.TypeOf((*GetExportArgs)(nil)).Elem() 116 } 117 118 // A collection of values returned by getExport. 119 type GetExportResultOutput struct{ *pulumi.OutputState } 120 121 func (GetExportResultOutput) ElementType() reflect.Type { 122 return reflect.TypeOf((*GetExportResult)(nil)).Elem() 123 } 124 125 func (o GetExportResultOutput) ToGetExportResultOutput() GetExportResultOutput { 126 return o 127 } 128 129 func (o GetExportResultOutput) ToGetExportResultOutputWithContext(ctx context.Context) GetExportResultOutput { 130 return o 131 } 132 133 func (o GetExportResultOutput) ApiId() pulumi.StringOutput { 134 return o.ApplyT(func(v GetExportResult) string { return v.ApiId }).(pulumi.StringOutput) 135 } 136 137 // ID of the API. 138 func (o GetExportResultOutput) Body() pulumi.StringOutput { 139 return o.ApplyT(func(v GetExportResult) string { return v.Body }).(pulumi.StringOutput) 140 } 141 142 func (o GetExportResultOutput) ExportVersion() pulumi.StringPtrOutput { 143 return o.ApplyT(func(v GetExportResult) *string { return v.ExportVersion }).(pulumi.StringPtrOutput) 144 } 145 146 // The provider-assigned unique ID for this managed resource. 147 func (o GetExportResultOutput) Id() pulumi.StringOutput { 148 return o.ApplyT(func(v GetExportResult) string { return v.Id }).(pulumi.StringOutput) 149 } 150 151 func (o GetExportResultOutput) IncludeExtensions() pulumi.BoolPtrOutput { 152 return o.ApplyT(func(v GetExportResult) *bool { return v.IncludeExtensions }).(pulumi.BoolPtrOutput) 153 } 154 155 func (o GetExportResultOutput) OutputType() pulumi.StringOutput { 156 return o.ApplyT(func(v GetExportResult) string { return v.OutputType }).(pulumi.StringOutput) 157 } 158 159 func (o GetExportResultOutput) Specification() pulumi.StringOutput { 160 return o.ApplyT(func(v GetExportResult) string { return v.Specification }).(pulumi.StringOutput) 161 } 162 163 func (o GetExportResultOutput) StageName() pulumi.StringPtrOutput { 164 return o.ApplyT(func(v GetExportResult) *string { return v.StageName }).(pulumi.StringPtrOutput) 165 } 166 167 func init() { 168 pulumi.RegisterOutputType(GetExportResultOutput{}) 169 }